-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_pairing.sh
50 lines (33 loc) · 1.7 KB
/
test_pairing.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -e
# TODO: update tests to work with new setup (e.g. no worker-template and w/ dask-gateway)
# NOTEBOOK_IMAGE=$(python -c "import yaml; f = open('jupyter-config.yml'); spec = yaml.safe_load(f.read()); print(spec['jupyterhub']['singleuser']['image']['name']+':'+spec['jupyterhub']['singleuser']['image']['tag']);")
# echo "pull notebook $NOTEBOOK_IMAGE"
# docker pull $NOTEBOOK_IMAGE
# echo "start notebook image"
# docker run -d --name notebook -t $NOTEBOOK_IMAGE /bin/bash
# echo "copy worker template from running notebook"
# docker cp notebook:/pre-home/worker-template.yml worker-template.yml
# WORKER_IMAGE=$(python -c "import yaml; f = open('worker-template.yml'); spec = yaml.load(f.read()); print(spec['spec']['containers'][0]['image']);")
# echo "retrieved worker image $WORKER_IMAGE from notebook worker-template"
# echo "shut down notebook"
# docker stop notebook
# docker rm notebook
# echo "pull worker $WORKER_IMAGE"
# docker pull $WORKER_IMAGE
# echo "start scheduler in notebook server"
# docker run --net="host" -d $NOTEBOOK_IMAGE start.sh dask-scheduler --port 8786 --bokeh-port 8787 &
# echo "start worker"
# docker run --net="host" -d $WORKER_IMAGE dask-worker 127.0.0.1:8786 --worker-port 8666 --nanny-port 8785 &
# echo "notebook server for user connection"
# docker create --name tester --net="host" $NOTEBOOK_IMAGE
# echo "copy test suite to test image"
# docker cp notebook_test.py tester:/usr/bin
# echo "start the tester notebook"
# docker start tester
# echo "run test suite"
# docker exec tester /srv/conda/envs/notebook/bin/python /usr/bin/notebook_test.py
# echo "closing containers"
# docker stop $(docker ps -q);
# docker rm $(docker ps --all -q);
# echo "done"