FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Split build script into build/test/push. · HadokenCode/docker-python@64fb057 · GitHub

Commit 64fb057

Browse files
Seb Boving
committed
Split build script into build/test/push.
The push will by default push a 'testing' labeled image. Use `./push prod` to push the production affecting image.
1 parent 6515aba commit 64fb057

3 files changed

Lines changed: 28 additions & 22 deletions

File tree

‎build‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,3 @@ else
99
docker pull continuumio/anaconda3:latest
1010
docker build --rm --no-cache -t kaggle/python-build .
1111
fi
12-
13-
14-
15-
rm -rf /tmp/python-build
16-
docker rm jupyter_test || true
17-
mkdir -p /tmp/python-build/tmp
18-
mkdir -p /tmp/python-build/devshm
19-
mkdir -p /tmp/python-build/working
20-
# Check that Jupyter server can run; if it dies on startup, the `docker kill` command will throw an error
21-
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="*"
22-
sleep 3
23-
docker kill jupyter_test && docker rm jupyter_test
24-
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 -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'
25-
26-
# The test_build.py script creates a plot called plot1.png; check that it exists
27-
[ -s /tmp/python-build/working/plot1.png ] || exit 1
28-
29-
docker tag kaggle/python-build gcr.io/kaggle-images/python
30-
gcloud docker -- push gcr.io/kaggle-images/python
31-
32-
docker tag kaggle/python-build:latest kaggle/python:latest
33-
docker push kaggle/python:latest

‎push‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
label=${1:-testing}
6+
7+
docker tag kaggle/python-build:latest gcr.io/kaggle-images/python:${label}
8+
gcloud docker -- push gcr.io/kaggle-images/python:${label}
9+
10+
docker tag kaggle/python-build:latest kaggle/python:${label}
11+
docker push kaggle/python:${label}

‎test‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
rm -rf /tmp/python-build
6+
docker rm jupyter_test || true
7+
mkdir -p /tmp/python-build/tmp
8+
mkdir -p /tmp/python-build/devshm
9+
mkdir -p /tmp/python-build/working
10+
# Check that Jupyter server can run; if it dies on startup, the `docker kill` command will throw an error
11+
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="*"
12+
sleep 3
13+
docker kill jupyter_test && docker rm jupyter_test
14+
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 -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'
15+
16+
# The test_build.py script creates a plot called plot1.png; check that it exists
17+
[ -s /tmp/python-build/working/plot1.png ] || exit 1

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL