Skip to content

Commit 405399a

Browse files
committed
support for arm64 in simple-pbt image
Signed-off-by: tenzen-y <[email protected]>
1 parent 58a3f4b commit 405399a

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed

scripts/v1beta1/build.sh

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ REGISTRY=$1
2323
TAG=$2
2424
ARCH=$3
2525

26-
if [[ -z "$REGISTRY" || -z "$TAG" || -z "$ARCH" ]]; then
26+
if [[ -z "${REGISTRY}" || -z "${TAG}" || -z "${ARCH}" ]]; then
2727
echo "Image registry, tag and cpu-architecture must be set"
2828
echo "Usage: $0 <image-registry> <image-tag> <cpu-architecture>" 1>&2
2929
exit 1
@@ -32,11 +32,11 @@ fi
3232
SUPPORTED_CPU_ARCHS=(amd64 arm64 ppc64le)
3333
function check_specified_cpu_arch() {
3434
for SUPPORTED_ARCH in "${SUPPORTED_CPU_ARCHS[@]}"; do
35-
if [ "$ARCH" = "$SUPPORTED_ARCH" ]; then
35+
if [ "${ARCH}" = "${SUPPORTED_ARCH}" ]; then
3636
return 0
3737
fi
3838
done
39-
echo "CPU architecture '$ARCH' is not supported"
39+
echo "CPU architecture '${ARCH}' is not supported"
4040
echo "You can use '${SUPPORTED_CPU_ARCHS[*]}'"
4141
echo "To get machine architecture run: uname -m"
4242
return 1
@@ -56,96 +56,92 @@ cd "${SCRIPT_ROOT}"
5656

5757
# Katib core images
5858
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 .
6060

6161
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 .
6363

6464
# TODO (andreyvelich): Switch to ${CMD_PREFIX}/ui/${VERSION}/Dockerfile once old UI is deprecated.
6565
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 .
6767

6868
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 .
7070

7171
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 .
7373

7474
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 .
7777
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 .
7979
fi
8080

8181
# Suggestion images
8282
echo -e "\nBuilding suggestion images..."
8383

8484
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 .
8686

8787
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 .
8989

9090
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 .
9292

9393
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 .
9595

9696
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 .
9898

9999
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 .
101101

102102
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 .
104104

105105
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 .
107107

108108
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 .
110110

111111
# Early stopping images
112112
echo -e "\nBuilding early stopping images...\n"
113113

114114
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 .
116116

117117
# Training container images
118118
echo -e "\nBuilding training container images..."
119119

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 .
126122

127123
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 .
129125

130126
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 .
132128

133129
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 .
135131

136132
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 .
138134

139135
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 .
141137

142138
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 .
144140

145141
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 .
147143

148144
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 .
150146

151147
echo -e "\nAll Katib images with ${TAG} tag have been built successfully!\n"

0 commit comments

Comments
 (0)