FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-python/test at master · dbbevan/docker-python · GitHub
dbbevan
/
docker-python
Public
forked from
Kaggle/docker-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-python
/
test
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
62 lines (55 loc) · 1.75 KB
Breadcrumbs
docker-python
/
test
Copy path
File metadata and controls
executable file
·
62 lines (55 loc) · 1.75 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
51
52
53
54
55
56
57
58
59
60
61
62
#!
/bin/bash
set
-e
usage
() {
cat
<<
EOF
Usage:
$0
[OPTIONS]
Run tests for a newly-built Python Docker image.
By default, it runs the tests for the CPU image.
Options:
-g, --gpu Run tests for the GPU image.
EOF
}
IMAGE_TAG=
"
kaggle/python-build
"
ADDITONAL_OPTS=
"
"
while
:
;
do
case
"
$1
"
in
-h|--help)
usage
exit
;;
-g|--gpu)
IMAGE_TAG=
"
kaggle/python-gpu-build
"
ADDITONAL_OPTS=
"
-v /tmp/empty_dir:/usr/local/cuda/lib64/stubs:ro
"
;;
-
?*
)
usage
printf
'
ERROR: Unknown option: %s\n
'
"
$1
"
>&2
exit
;;
*
)
break
esac
shift
done
readonly
IMAGE_TAG
readonly
ADDITONAL_OPTS
set
-x
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
"
$IMAGE_TAG
"
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 \
-v
$PWD
:/input:ro -v /tmp/python-build/working:/working \
-v /tmp/python-build/tmp:/tmp -v /tmp/python-build/devshm:/dev/shm \
-w=/working \
$ADDITONAL_OPTS
\
"
$IMAGE_TAG
"
\
/bin/bash -c
'
python -m unittest discover -s /input/tests
'
Back
|
FazBrowse Home
|
New Git URL