-
Notifications
You must be signed in to change notification settings - Fork 8
Add iPython notebook server + sample notebook with SH Python bindings #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
redapple
wants to merge
1
commit into
master
Choose a base branch
from
ipython-notebook-server
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM ubuntu:latest | ||
Maintainer Matt Klich, Mike Risse | ||
|
||
# Build: docker build -t docker-ipython-notebook:latest . | ||
# Run: docker run -d -P docker-ipython-notebook:latest | ||
|
||
RUN apt-get update; \ | ||
DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install --yes \ | ||
git wget build-essential python-dev ipython ipython-notebook python-pip \ | ||
python-numpy python-scipy python-matplotlib python-pandas python-sympy \ | ||
python-nose python-sklearn libsndfile-dev; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better to install python libraries directly from pypi. |
||
pip install scikits.audiolab; \ | ||
pip install git+git://github.com/scrapinghub/python-scrapinghub; \ | ||
pip install git+git://github.com/scrapinghub/python-hubstorage; | ||
|
||
ADD ./notebook/ /tmp/notebook/ | ||
|
||
EXPOSE 8080 | ||
ADD ./run.sh /run.sh | ||
CMD /run.sh | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
docker-ipython-notebook | ||
======================= | ||
|
||
Docker container image capable of running an iPython notebook server | ||
|
||
This project backs a docker trusted build at https://index.docker.io/u/unfairbanks/docker-ipython-notebook | ||
|
||
We use this image with the [dockernotebook](https://github.com/rissem/dockernotebook) project. We intend for it to be able to run _most_ iPython notebooks. Find out more about dockernotebook at http://dockernotebook.com. | ||
|
||
Build: | ||
|
||
``` | ||
sudo docker build -t docker-ipython-notebook:latest . | ||
``` | ||
|
||
Run: | ||
|
||
``` | ||
export SH_APIKEY='<yourapikey>' | ||
sudo docker run -d -p 8888:8080 --env SH_APIKEY=$SH_APIKEY docker-ipython-notebook:latest | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"metadata": { | ||
"name": "", | ||
"signature": "sha256:3ae768c50bada88ddb3edc26617c8237cf497f04d3e8e0583286599b518b5bab" | ||
}, | ||
"nbformat": 3, | ||
"nbformat_minor": 0, | ||
"worksheets": [] | ||
} |
47 changes: 47 additions & 0 deletions
47
ipython-notebook-server/notebook/scrapinghub-explore.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"metadata": { | ||
"name": "" | ||
}, | ||
"nbformat": 3, | ||
"nbformat_minor": 0, | ||
"worksheets": [ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"collapsed": false, | ||
"input": [ | ||
"%pylab inline\n", | ||
"\n", | ||
"import os\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"import pandas as pd\n", | ||
"\n", | ||
"import scrapinghub\n", | ||
"import hubstorage\n", | ||
"\n", | ||
"APIKEY = os.environ.get('SH_APIKEY')\n", | ||
"shconn = scrapinghub.Connection(APIKEY)\n", | ||
"hsconn = hubstorage.HubstorageClient(auth=APIKEY)" | ||
], | ||
"language": "python", | ||
"metadata": {}, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"collapsed": false, | ||
"input": [ | ||
"PROJECT = '11111'\n", | ||
"project = shconn[PROJECT]" | ||
], | ||
"language": "python", | ||
"metadata": {}, | ||
"outputs": [] | ||
} | ||
], | ||
"metadata": {} | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/bash | ||
set -e | ||
if [ -z "$GIT_REPO" ]; then | ||
echo "Git Repo not defined. Blank project will be used" | ||
else | ||
cd /tmp/notebook && git clone https://github.com/$GIT_REPO | ||
fi | ||
|
||
ipython notebook --no-browser --ip=0.0.0.0 --port=8080 --notebook-dir=/tmp/notebook/${GIT_REPO/*\/}/${REPO_DIR} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont you want to update the Maintainer ?