forked from Kaggle/docker-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·44 lines (42 loc) · 1.28 KB
/
test
File metadata and controls
executable file
·44 lines (42 loc) · 1.28 KB
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
#!/bin/bash
set -e
rm -rf /tmp/python-build
docker rm jupyter_test || true
mkdir -p /tmp/python-build/tmp
mkdir -p /tmp/python-build/devshm
mkdir -p /tmp/python-build/working
# Check that Jupyter server can run; if it dies on startup, the `docker kill` command will throw an error.
docker run \
-d \
--name=jupyter_test \
--read-only \
--net=none \
-e HOME=/tmp \
-v $PWD:/input:ro \
-v /tmp/python-build/working:/working \
-w=/working \
-v /tmp/python-build/tmp:/tmp \
-v /tmp/python-build/devshm:/dev/shm \
kaggle/python-build \
jupyter notebook --allow-root --ip="*"
sleep 3
docker kill jupyter_test && docker rm jupyter_test
docker run \
--rm \
-t \
--read-only \
--net=none \
-e HOME=/tmp \
-e KAGGLE_DATA_PROXY_TOKEN=test-key \
-e KAGGLE_DATA_PROXY_URL=http://127.0.0.1:8000 \
-e KAGGLE_DATA_PROXY_PROJECT=test \
-e EXPECT_GPU="$EXPECT_GPU" \
-v $PWD:/input:ro \
-v /tmp/python-build/working:/working \
-w=/working \
-v /tmp/python-build/tmp:/tmp \
-v /tmp/python-build/devshm:/dev/shm \
kaggle/python-build \
/bin/bash -c 'python /input/test_build.py'
# The test_build.py script creates a plot called plot1.png; check that it exists.
[ -s /tmp/python-build/working/plot1.png ] || exit 1