Skip to content

Commit f9fb144

Browse files
committed
Correct - to _ in orchestrate arguments
1 parent 185c9c7 commit f9fb144

File tree

2 files changed

+84
-6
lines changed

2 files changed

+84
-6
lines changed

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@ token:
7878
#proxy: proxy-image token
7979
proxy:
8080
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$(TOKEN) --name proxy \
81-
jupyter/configurable-http-proxy \
82-
--default-target http://$(DOCKER_HOST):9999
81+
jupyter/configurable-http-proxy --default-target http://$(DOCKER_HOST):9999
8382

8483
#tmpnb: tmpnb-image token
8584
tmpnb:
8685
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$(TOKEN) --name tmpnb \
8786
-v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py \
8887
--image=$(DEMO_IMAGE) --cull_timeout=$(CULL_TIMEOUT) --cull_period=$(CULL_PERIOD) \
8988
--pool_size=$(POOL_SIZE) --cull_max=$(CULL_MAX) \
90-
--redirect-uri="/notebooks/Prometheus.ipynb" \
89+
--redirect_uri="/notebooks/Prometheus.ipynb" \
9190
--command="jupyter notebook --NotebookApp.base_url={base_path} --ip=0.0.0.0 --port {port} --no-browser"
9291
# --logging=$(LOGGING)
9392

@@ -105,9 +104,9 @@ run:
105104
-e CONFIGPROXY_ENDPOINT=http://$(DOCKER_HOST):8001 \
106105
-v /var/run/docker.sock:/docker.sock \
107106
jupyter/tmpnb python orchestrate.py --image=$(DEMO_IMAGE) \
108-
--pool-size=$(POOL_SIZE) --mem-limit=$(MEM_LIMIT) --cpu-shares=$(CPU_SHARES) \
109-
--cull-timeout=$(CULL_TIMEOUT) --cull_period=$(CULL_PERIOD) --cull_max=$(CULL_MAX) \
110-
--redirect-uri="/notebooks/Prometheus.ipynb" \
107+
--pool_size=$(POOL_SIZE) --mem_limit=$(MEM_LIMIT) --cpu_shares=$(CPU_SHARES) \
108+
--cull_timeout=$(CULL_TIMEOUT) --cull_period=$(CULL_PERIOD) --cull_max=$(CULL_MAX) \
109+
--redirect_uri="/notebooks/Prometheus.ipynb" \
111110
--command="jupyter notebook --NotebookApp.base_url={base_path} --ip=0.0.0.0 --port {port} --no-browser"
112111

113112
go: redirect token proxy tmpnb image

notes.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
sudo docker pull nginx
2+
sudo docker run --name docker-nginx -p 80:80 nginx
3+
# Detached mode
4+
sudo docker run --name docker-nginx -p 80:80 -d nginx
5+
sudo docker ps
6+
sudo docker stop docker-nginx
7+
sudo docker ps -a
8+
mkdir html
9+
cp index.html html
10+
docker run --name docker-nginx -p 80:80 -v ~/html:/usr/share/nginx/html -d nginx
11+
12+
# -v ~/docker-nginx/default.conf:/etc/nginx/conf.d/default.conf
13+
14+
# Dockerfile
15+
#FROM nginx
16+
#ADD nginx.conf /etc/nginx/nginx.conf
17+
18+
19+
docker pull jupyter/minimal-notebook
20+
export TOKEN=$( head -c 30 /dev/urandom | xxd -p )
21+
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
22+
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=tmpnb -v /var/run/docker.sock:/docker.sock jupyter/tmpnb
23+
24+
25+
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8000
26+
docker run -d --name configproxy --net=host -e CONFIGPROXY_AUTH_TOKEN=LEGIT_KEY jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
27+
docker run -d --name tmpnb --net=host -e CONFIGPROXY_AUTH_TOKEN=LEGIT_KEY -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py --cull-timeout=120 --docker-version=1.13 --pool-size=512 --image=jupyter/demo --static-files=/srv/ipython/IPython/html/static/ --redirect-uri=/tree --command='ipython3 notebook --NotebookApp.base_url={base_path}' --max-dock-workers=8
28+
29+
tmpnb nginx setup
30+
31+
This host should have its own DNS record for the redirector to point to, e.g. yetanother.tmpnb.org
32+
33+
apt-get update && apt-get upgrade -y && apt-get install nginx
34+
mkdir -p /var/www/tmpnb-static && cd /var/www/tmpnb-static
35+
# Grab the static.tar *somehow*
36+
tar -xvf static.tar
37+
38+
# Grab the nginx configuration *somehow*
39+
cp nginx.conf /etc/nginx/sites-available/default
40+
# Change the nginx configuration to point to the tmpnb node that this server goes with
41+
42+
# Put the certs in `/etc/ssl`
43+
44+
service nginx restart
45+
46+
47+
https://raw.githubusercontent.com/ProjectPyRhO/PyRhO/master/pyrho/gui/PyRhO_logo.png
48+
49+
# Original ga.html
50+
# Differences (apart from UA)
51+
- missing https: before //www.google-analytics.com/analytics.js
52+
- has an extra line: ga('require', 'displayfeatures');
53+
54+
<script>
55+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
56+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
57+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
58+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
59+
60+
ga('create', 'UA-56096826-1', 'auto');
61+
ga('require', 'displayfeatures');
62+
ga('send', 'pageview');
63+
</script>
64+
65+
# Do I copy in templates? static? where? how are they included?
66+
# Do I still need a jupyter_notebook_config.py ? This might be for JupyterHub - see issue 379
67+
# Does orchestrate handle all the templates now? --NotebookApp.base_url={base_path} --NotebookApp.trust_xheaders=True"
68+
69+
docker run -d \
70+
--net=host \
71+
-e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
72+
-v /var/run/docker.sock:/docker.sock \
73+
jupyter/tmpnb \
74+
python orchestrate.py --image='jupyter/minimal-notebook' \
75+
--command='start-notebook.sh \
76+
"--NotebookApp.base_url={base_path} \
77+
--ip=0.0.0.0 \
78+
--port={port} \
79+
--NotebookApp.trust_xheaders=True"'

0 commit comments

Comments
 (0)