@@ -23,7 +23,7 @@ REGISTRY=$1
23
23
TAG=$2
24
24
ARCH=$3
25
25
26
- if [[ -z " $REGISTRY " || -z " $TAG " || -z " $ARCH " ]]; then
26
+ if [[ -z " ${ REGISTRY} " || -z " ${ TAG} " || -z " ${ ARCH} " ]]; then
27
27
echo " Image registry, tag and cpu-architecture must be set"
28
28
echo " Usage: $0 <image-registry> <image-tag> <cpu-architecture>" 1>&2
29
29
exit 1
32
32
SUPPORTED_CPU_ARCHS=(amd64 arm64 ppc64le)
33
33
function check_specified_cpu_arch() {
34
34
for SUPPORTED_ARCH in " ${SUPPORTED_CPU_ARCHS[@]} " ; do
35
- if [ " $ARCH " = " $SUPPORTED_ARCH " ]; then
35
+ if [ " ${ ARCH} " = " ${ SUPPORTED_ARCH} " ]; then
36
36
return 0
37
37
fi
38
38
done
39
- echo " CPU architecture '$ARCH ' is not supported"
39
+ echo " CPU architecture '${ ARCH} ' is not supported"
40
40
echo " You can use '${SUPPORTED_CPU_ARCHS[*]} '"
41
41
echo " To get machine architecture run: uname -m"
42
42
return 1
@@ -56,96 +56,92 @@ cd "${SCRIPT_ROOT}"
56
56
57
57
# Katib core images
58
58
echo -e " \nBuilding Katib controller image...\n"
59
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /katib-controller:${TAG} " -f ${CMD_PREFIX} /katib-controller/${VERSION} /Dockerfile .
59
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /katib-controller:${TAG} " -f ${CMD_PREFIX} /katib-controller/${VERSION} /Dockerfile .
60
60
61
61
echo -e " \nBuilding Katib DB manager image...\n"
62
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /katib-db-manager:${TAG} " -f ${CMD_PREFIX} /db-manager/${VERSION} /Dockerfile .
62
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /katib-db-manager:${TAG} " -f ${CMD_PREFIX} /db-manager/${VERSION} /Dockerfile .
63
63
64
64
# TODO (andreyvelich): Switch to ${CMD_PREFIX}/ui/${VERSION}/Dockerfile once old UI is deprecated.
65
65
echo -e " \nBuilding Katib UI image...\n"
66
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /katib-ui:${TAG} " -f ${CMD_PREFIX} /new-ui/${VERSION} /Dockerfile .
66
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /katib-ui:${TAG} " -f ${CMD_PREFIX} /new-ui/${VERSION} /Dockerfile .
67
67
68
68
echo -e " \nBuilding Katib cert generator image...\n"
69
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /cert-generator:${TAG} " -f ${CMD_PREFIX} /cert-generator/${VERSION} /Dockerfile .
69
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /cert-generator:${TAG} " -f ${CMD_PREFIX} /cert-generator/${VERSION} /Dockerfile .
70
70
71
71
echo -e " \nBuilding file metrics collector image...\n"
72
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /file-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /file-metricscollector/Dockerfile .
72
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /file-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /file-metricscollector/Dockerfile .
73
73
74
74
echo -e " \nBuilding TF Event metrics collector image...\n"
75
- if [ " $ARCH " == " ppc64le" ]; then
76
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /tfevent-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /tfevent-metricscollector/Dockerfile.ppc64le .
75
+ if [ " ${ ARCH} " == " ppc64le" ]; then
76
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /tfevent-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /tfevent-metricscollector/Dockerfile.ppc64le .
77
77
else
78
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /tfevent-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /tfevent-metricscollector/Dockerfile .
78
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /tfevent-metrics-collector:${TAG} " -f ${CMD_PREFIX} /metricscollector/${VERSION} /tfevent-metricscollector/Dockerfile .
79
79
fi
80
80
81
81
# Suggestion images
82
82
echo -e " \nBuilding suggestion images..."
83
83
84
84
echo -e " \nBuilding hyperopt suggestion...\n"
85
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-hyperopt:${TAG} " -f ${CMD_PREFIX} /suggestion/hyperopt/${VERSION} /Dockerfile .
85
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-hyperopt:${TAG} " -f ${CMD_PREFIX} /suggestion/hyperopt/${VERSION} /Dockerfile .
86
86
87
87
echo -e " \nBuilding chocolate suggestion...\n"
88
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-chocolate:${TAG} " -f ${CMD_PREFIX} /suggestion/chocolate/${VERSION} /Dockerfile .
88
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-chocolate:${TAG} " -f ${CMD_PREFIX} /suggestion/chocolate/${VERSION} /Dockerfile .
89
89
90
90
echo -e " \nBuilding hyperband suggestion...\n"
91
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-hyperband:${TAG} " -f ${CMD_PREFIX} /suggestion/hyperband/${VERSION} /Dockerfile .
91
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-hyperband:${TAG} " -f ${CMD_PREFIX} /suggestion/hyperband/${VERSION} /Dockerfile .
92
92
93
93
echo -e " \nBuilding skopt suggestion...\n"
94
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-skopt:${TAG} " -f ${CMD_PREFIX} /suggestion/skopt/${VERSION} /Dockerfile .
94
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-skopt:${TAG} " -f ${CMD_PREFIX} /suggestion/skopt/${VERSION} /Dockerfile .
95
95
96
96
echo -e " \nBuilding goptuna suggestion...\n"
97
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-goptuna:${TAG} " -f ${CMD_PREFIX} /suggestion/goptuna/${VERSION} /Dockerfile .
97
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-goptuna:${TAG} " -f ${CMD_PREFIX} /suggestion/goptuna/${VERSION} /Dockerfile .
98
98
99
99
echo -e " \nBuilding optuna suggestion...\n"
100
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-optuna:${TAG} " -f ${CMD_PREFIX} /suggestion/optuna/${VERSION} /Dockerfile .
100
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-optuna:${TAG} " -f ${CMD_PREFIX} /suggestion/optuna/${VERSION} /Dockerfile .
101
101
102
102
echo -e " \nBuilding ENAS suggestion...\n"
103
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-enas:${TAG} " -f ${CMD_PREFIX} /suggestion/nas/enas/${VERSION} /Dockerfile .
103
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-enas:${TAG} " -f ${CMD_PREFIX} /suggestion/nas/enas/${VERSION} /Dockerfile .
104
104
105
105
echo -e " \nBuilding DARTS suggestion...\n"
106
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-darts:${TAG} " -f ${CMD_PREFIX} /suggestion/nas/darts/${VERSION} /Dockerfile .
106
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-darts:${TAG} " -f ${CMD_PREFIX} /suggestion/nas/darts/${VERSION} /Dockerfile .
107
107
108
108
echo -e " \nBuilding PBT suggestion...\n"
109
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /suggestion-pbt:${TAG} " -f ${CMD_PREFIX} /suggestion/pbt/${VERSION} /Dockerfile .
109
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /suggestion-pbt:${TAG} " -f ${CMD_PREFIX} /suggestion/pbt/${VERSION} /Dockerfile .
110
110
111
111
# Early stopping images
112
112
echo -e " \nBuilding early stopping images...\n"
113
113
114
114
echo -e " \nBuilding median stopping rule...\n"
115
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /earlystopping-medianstop:${TAG} " -f ${CMD_PREFIX} /earlystopping/medianstop/${VERSION} /Dockerfile .
115
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /earlystopping-medianstop:${TAG} " -f ${CMD_PREFIX} /earlystopping/medianstop/${VERSION} /Dockerfile .
116
116
117
117
# Training container images
118
118
echo -e " \nBuilding training container images..."
119
119
120
- if [ ! " $ARCH " = " amd64" ]; then
121
- echo -e " \nSome training container images are supported only amd64."
122
- else
123
- echo -e " \nBuilding dynamic learning rate training container example for PBT...\n"
124
- docker buildx build --platform linux/amd64 -t " ${REGISTRY} /simple-pbt:${TAG} " -f examples/${VERSION} /trial-images/simple-pbt/Dockerfile .
125
- fi
120
+ echo -e " \nBuilding dynamic learning rate training container example for PBT...\n"
121
+ docker buildx build --platform " linux/${ARCH} " -t " ${REGISTRY} /simple-pbt:${TAG} " -f examples/${VERSION} /trial-images/simple-pbt/Dockerfile .
126
122
127
123
echo -e " \nBuilding PyTorch CIFAR-10 CNN training container example for DARTS with CPU support...\n"
128
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /darts-cnn-cifar10-cpu:${TAG} " -f examples/${VERSION} /trial-images/darts-cnn-cifar10/Dockerfile.cpu .
124
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /darts-cnn-cifar10-cpu:${TAG} " -f examples/${VERSION} /trial-images/darts-cnn-cifar10/Dockerfile.cpu .
129
125
130
126
echo -e " \nBuilding PyTorch CIFAR-10 CNN training container example for DARTS with GPU support...\n"
131
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /darts-cnn-cifar10-gpu:${TAG} " -f examples/${VERSION} /trial-images/darts-cnn-cifar10/Dockerfile.gpu .
127
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /darts-cnn-cifar10-gpu:${TAG} " -f examples/${VERSION} /trial-images/darts-cnn-cifar10/Dockerfile.gpu .
132
128
133
129
echo -e " \nBuilding mxnet mnist training container example...\n"
134
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /mxnet-mnist:${TAG} " -f examples/${VERSION} /trial-images/mxnet-mnist/Dockerfile .
130
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /mxnet-mnist:${TAG} " -f examples/${VERSION} /trial-images/mxnet-mnist/Dockerfile .
135
131
136
132
echo -e " \nBuilding PyTorch mnist training container example with CPU support...\n"
137
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /pytorch-mnist-cpu:${TAG} " -f examples/${VERSION} /trial-images/pytorch-mnist/Dockerfile.cpu .
133
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /pytorch-mnist-cpu:${TAG} " -f examples/${VERSION} /trial-images/pytorch-mnist/Dockerfile.cpu .
138
134
139
135
echo -e " \nBuilding PyTorch mnist training container example with GPU support...\n"
140
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /pytorch-mnist-gpu:${TAG} " -f examples/${VERSION} /trial-images/pytorch-mnist/Dockerfile.gpu .
136
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /pytorch-mnist-gpu:${TAG} " -f examples/${VERSION} /trial-images/pytorch-mnist/Dockerfile.gpu .
141
137
142
138
echo -e " \nBuilding Tensorflow with summaries mnist training container example...\n"
143
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /tf-mnist-with-summaries:${TAG} " -f examples/${VERSION} /trial-images/tf-mnist-with-summaries/Dockerfile .
139
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /tf-mnist-with-summaries:${TAG} " -f examples/${VERSION} /trial-images/tf-mnist-with-summaries/Dockerfile .
144
140
145
141
echo -e " \nBuilding Keras CIFAR-10 CNN training container example for ENAS with CPU support...\n"
146
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /enas-cnn-cifar10-cpu:${TAG} " -f examples/${VERSION} /trial-images/enas-cnn-cifar10/Dockerfile.cpu .
142
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /enas-cnn-cifar10-cpu:${TAG} " -f examples/${VERSION} /trial-images/enas-cnn-cifar10/Dockerfile.cpu .
147
143
148
144
echo -e " \nBuilding Keras CIFAR-10 CNN training container example for ENAS with GPU support...\n"
149
- docker buildx build --platform " linux/$ARCH " -t " ${REGISTRY} /enas-cnn-cifar10-gpu:${TAG} " -f examples/${VERSION} /trial-images/enas-cnn-cifar10/Dockerfile.gpu .
145
+ docker buildx build --platform " linux/${ ARCH} " -t " ${REGISTRY} /enas-cnn-cifar10-gpu:${TAG} " -f examples/${VERSION} /trial-images/enas-cnn-cifar10/Dockerfile.gpu .
150
146
151
147
echo -e " \nAll Katib images with ${TAG} tag have been built successfully!\n"
0 commit comments