Skip to content

Commit bccb970

Browse files
committed
Fix notebook startup and doc (fix #105), fix DB waiting script, use mysql:5
1 parent 570dc28 commit bccb970

5 files changed

Lines changed: 29 additions & 40 deletions

File tree

app/bin/app.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
SCRIPT_DIR="$(dirname "$0")"
44
source "$SCRIPT_DIR/app_base.sh"
55

6-
# django init
6+
# waiting for other network services
7+
sh $app/bin/wait.sh
78
python $manage wait-for-db
8-
python $manage migrate --noinput
9-
python $manage bower_install -- --allow-root
9+
10+
# django init
11+
if [ ! -f .init ]; then
12+
python $manage migrate --noinput
13+
python $manage bower_install -- --allow-root
14+
touch .init
15+
fi
1016

1117
# timeside setup
1218
python $manage timeside-create-admin-user

app/bin/wait.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#!/bin/bash
22

3+
# apt-get install -y --force-yes netcat
4+
35
set -e
46

57
host=$(env | grep _TCP_ADDR | cut -d = -f 2)
68
port=$(env | grep _TCP_PORT | cut -d = -f 2)
79

8-
if [ -n "${host:1}" ]; then
9-
echo -n "waiting for TCP connection to $host:$port..."
10-
while ! nc -w 1 $host $port 2>/dev/null
11-
do
12-
echo -n .
13-
sleep 1
14-
done
15-
fi
10+
echo -n "waiting for TCP connection to $host:$port..."
11+
12+
while ! nc -w 1 $host $port 2>/dev/null
13+
do
14+
echo -n .
15+
sleep 1
16+
done
17+
1618
echo 'ok'

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var:
3434
command: "true"
3535

3636
db:
37-
image: mysql
37+
image: mysql:5
3838
volumes:
3939
- ./var/lib/mysql:/var/lib/mysql
4040
volumes_from:

docs/source/ui.rst

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,33 @@
22
User Interfaces
33
===============
44

5-
Linux
6-
-----
5+
Ipython
6+
-------
77

8-
To run the python shell, just do it through the docker composition::
8+
To run the ipython shell, just do it through the docker composition::
99

1010
docker-compose run app ipython
1111

12-
13-
MacOS or Windows
14-
----------------
15-
16-
Same as in Linux, but you need to create a docker machine first::
17-
18-
docker-machine create --driver virtualbox --virtualbox-memory 8096 timeside
19-
eval "$(docker-machine env timeside)"
20-
docker-compose run app ipython
21-
22-
More infos about the TimeSide docker image: https://registry.hub.docker.com/u/parisson/timeside/
23-
24-
2512
Notebook
2613
---------
2714

2815
You can also run your code in the wonderful `Jupyter Notebook <http://jupyter.org/>`_ which gives you a web interface to run your own code and share the results with your collaborators::
2916

30-
docker-compose -f docker-compose.yml -f conf/dev.yml run --service-ports notebook
31-
32-
and then browse http://localhost:8888 to acces the Jupyter notebook interface.
33-
34-
On MacOS or Windows, you will need to ask the IP of the virtual machine to docker-machine::
35-
36-
docker-machine ip timeside
17+
docker-compose -f docker-compose.yml -f conf/notebook.yml up
3718

38-
If it gives you for example 192.168.59.103, you should be able to browse the notebook at http://192.168.59.103:8888/
19+
and then browse http://localhost:8888 to access the Jupyter notebook interface. Use the token given in the docker logs of the `notebook` container to login.
3920

4021
.. warning :: Running a Jupyter notebook server with this setup in a non-secured network is not safe. See `Running a notebook server <http://jupyter-notebook.readthedocs.org/en/latest/public_server.html/>`_ for a documented solution to this security problem.
4122
4223
4324
Use you own data
4425
----------------
4526

46-
The var/media directory is mounted in /srv/media in the container so you can use it to exchange data between the host and the app container.
27+
The `var/media` directory is mounted in `/srv/media` inside the container so you can use it to exchange data between the host and the app container.
4728

4829

49-
Web Server (experimental)
50-
-------------------------
30+
Web Server
31+
----------
5132

5233
TimeSide now includes an experimental web service with a REST API::
5334

env/notebook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ notebook:
2828
- "8888:8888"
2929
volumes_from:
3030
- app
31-
command: sh -c "cd /srv/src/timeside/docs/ipynb; jupyter notebook --no-browser --ip=0.0.0.0"
31+
command: sh -c "cd /srv/lib/timeside/docs/ipynb; jupyter notebook --no-browser --ip=0.0.0.0 --allow-root"

0 commit comments

Comments
 (0)