Skip to content

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ipython-notebook-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ubuntu:latest
Maintainer Matt Klich, Mike Risse
Copy link
Contributor

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 ?


# 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; \
Copy link
Contributor

Choose a reason for hiding this comment

The 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

21 changes: 21 additions & 0 deletions ipython-notebook-server/README.md
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
```
9 changes: 9 additions & 0 deletions ipython-notebook-server/notebook/Empty Notebook.ipynb
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 ipython-notebook-server/notebook/scrapinghub-explore.ipynb
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": {}
}
]
}
9 changes: 9 additions & 0 deletions ipython-notebook-server/run.sh
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}