-
-
Notifications
You must be signed in to change notification settings - Fork 620
/
push_all.sh
73 lines (49 loc) · 2 KB
/
push_all.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
echo "Push all PyTorch-Ignite docker images"
if [ -z $DOCKER_USER ]; then
echo "Can not find DOCKER_USER env variable"
echo "Please, export DOCKER_USER=<username> before calling this script"
exit 1
fi
if [ -z $DOCKER_TOKEN ]; then
echo "Can not find DOCKER_TOKEN env variable"
echo "Please, export DOCKER_TOKEN=<token> before calling this script"
exit 1
fi
if [ -z "$1" ]; then
push_selected_image="all"
else
push_selected_image="$1"
fi
set -eu
echo $DOCKER_TOKEN | docker login --username=$DOCKER_USER --password-stdin
set -xeu
if [ ${push_selected_image} == "all" ]; then
image_name="base"
image_tag=`docker run --rm -i pytorchignite/${image_name}:latest python -c "import torch; import ignite; print(torch.__version__.split('+')[0] + \"-\" + ignite.__version__, end=\"\")"`
for image_name in "base" "vision" "nlp" "apex" "apex-vision" "apex-nlp"
do
docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}
done
for image_name in "hvd-base" "hvd-vision" "hvd-nlp" "hvd-apex" "hvd-apex-vision" "hvd-apex-nlp"
do
docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}
done
# DEPRECATED due to no activity
# for image_name in "msdp-apex" "msdp-apex-vision" "msdp-apex-nlp"
# do
# docker push pytorchignite/${image_name}:latest
# docker push pytorchignite/${image_name}:${image_tag}
# done
else
image_name=${push_selected_image}
image_tag=`docker run --rm -i pytorchignite/${image_name}:latest python -c "import torch; import ignite; print(torch.__version__.split('+')[0] + \"-\" + ignite.__version__, end=\"\")"`
docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}
fi
# If use locally, mind to clean dangling images
# docker images | grep 'pytorchignite\|<none>' | awk '{print $3}' | xargs docker rmi -f
# or
# docker image prune