diff --git a/.github/workflows/template-publish-image/action.yaml b/.github/workflows/template-publish-image/action.yaml index 53106172091..56d51b8a2e6 100644 --- a/.github/workflows/template-publish-image/action.yaml +++ b/.github/workflows/template-publish-image/action.yaml @@ -12,7 +12,7 @@ runs: using: composite steps: - name: Set Up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Docker Login uses: docker/login-action@v1 @@ -38,3 +38,4 @@ runs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max + platforms: linux/amd64 diff --git a/.github/workflows/template-setup-e2e-test/action.yaml b/.github/workflows/template-setup-e2e-test/action.yaml index b060c8b966e..10e66b2b430 100644 --- a/.github/workflows/template-setup-e2e-test/action.yaml +++ b/.github/workflows/template-setup-e2e-test/action.yaml @@ -17,7 +17,7 @@ runs: github token: ${{ env.GITHUB_TOKEN }} - name: Set Up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Set Up Go env uses: actions/setup-go@v2 diff --git a/cmd/cert-generator/v1beta1/Dockerfile b/cmd/cert-generator/v1beta1/Dockerfile index e8a9b2e6a12..3984005a8c1 100644 --- a/cmd/cert-generator/v1beta1/Dockerfile +++ b/cmd/cert-generator/v1beta1/Dockerfile @@ -1,6 +1,8 @@ -# Build the Katib Cert Generatoe. +# Build the Katib Cert Generator. FROM golang:alpine AS build-env +ARG TARGETARCH + WORKDIR /go/src/github.com/kubeflow/katib # Download packages. @@ -13,13 +15,7 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-cert-generator ./cmd/cert-generator/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o katib-cert-generator ./cmd/cert-generator/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o katib-cert-generator ./cmd/cert-generator/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o katib-cert-generator ./cmd/cert-generator/v1beta1 # Copy the cert-generator into a thin image. FROM gcr.io/distroless/static:nonroot diff --git a/cmd/db-manager/v1beta1/Dockerfile b/cmd/db-manager/v1beta1/Dockerfile index d36cdd10077..7dae3cb5de2 100644 --- a/cmd/db-manager/v1beta1/Dockerfile +++ b/cmd/db-manager/v1beta1/Dockerfile @@ -1,6 +1,7 @@ # Build the Katib DB manager. FROM golang:alpine AS build-env +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 WORKDIR /go/src/github.com/kubeflow/katib @@ -15,23 +16,11 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-db-manager ./cmd/db-manager/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o katib-db-manager ./cmd/db-manager/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o katib-db-manager ./cmd/db-manager/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH="${TARGETARCH}" go build -a -o katib-db-manager ./cmd/db-manager/v1beta1 # Add GRPC health probe. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe +RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe # Copy the db-manager into a thin image. FROM alpine:3.15 diff --git a/cmd/earlystopping/medianstop/v1beta1/Dockerfile b/cmd/earlystopping/medianstop/v1beta1/Dockerfile index 5f51a61b2fd..1a5ebd35e2a 100644 --- a/cmd/earlystopping/medianstop/v1beta1/Dockerfile +++ b/cmd/earlystopping/medianstop/v1beta1/Dockerfile @@ -1,9 +1,11 @@ FROM python:3.9-slim +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV EARLY_STOPPING_DIR cmd/earlystopping/medianstop/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "arm64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ @@ -12,12 +14,11 @@ RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ ADD ./pkg/ ${TARGET_DIR}/pkg/ ADD ./${EARLY_STOPPING_DIR}/ ${TARGET_DIR}/${EARLY_STOPPING_DIR}/ + WORKDIR ${TARGET_DIR}/${EARLY_STOPPING_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/katib-controller/v1beta1/Dockerfile b/cmd/katib-controller/v1beta1/Dockerfile index df056452533..158c1cd8275 100644 --- a/cmd/katib-controller/v1beta1/Dockerfile +++ b/cmd/katib-controller/v1beta1/Dockerfile @@ -1,6 +1,8 @@ # Build the Katib controller. FROM golang:alpine AS build-env +ARG TARGETARCH + WORKDIR /go/src/github.com/kubeflow/katib # Download packages. @@ -13,13 +15,7 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-controller ./cmd/katib-controller/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o katib-controller ./cmd/katib-controller/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o katib-controller ./cmd/katib-controller/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o katib-controller ./cmd/katib-controller/v1beta1 # Copy the controller-manager into a thin image. FROM alpine:3.15 diff --git a/cmd/metricscollector/v1beta1/file-metricscollector/Dockerfile b/cmd/metricscollector/v1beta1/file-metricscollector/Dockerfile index 88544685d37..00004363b25 100644 --- a/cmd/metricscollector/v1beta1/file-metricscollector/Dockerfile +++ b/cmd/metricscollector/v1beta1/file-metricscollector/Dockerfile @@ -1,6 +1,8 @@ # Build the Katib file metrics collector. FROM golang:alpine AS build-env +ARG TARGETARCH + WORKDIR /go/src/github.com/kubeflow/katib # Download packages. @@ -13,13 +15,7 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o file-metricscollector ./cmd/metricscollector/v1beta1/file-metricscollector; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o file-metricscollector ./cmd/metricscollector/v1beta1/file-metricscollector; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o file-metricscollector ./cmd/metricscollector/v1beta1/file-metricscollector; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o file-metricscollector ./cmd/metricscollector/v1beta1/file-metricscollector # Copy the file metrics collector into a thin image. FROM alpine:3.15 diff --git a/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile b/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile index fc26dfdfcd9..c5ff6427ec3 100644 --- a/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile +++ b/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile @@ -1,13 +1,16 @@ FROM python:3.9-slim +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV METRICS_COLLECTOR_DIR cmd/metricscollector/v1beta1/tfevent-metricscollector +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/metricscollector/v1beta1/tfevent-metricscollector/::${TARGET_DIR}/pkg/metricscollector/v1beta1/common/ ADD ./pkg/ ${TARGET_DIR}/pkg/ ADD ./${METRICS_COLLECTOR_DIR}/ ${TARGET_DIR}/${METRICS_COLLECTOR_DIR}/ + WORKDIR ${TARGET_DIR}/${METRICS_COLLECTOR_DIR} -RUN if [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "arm64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libpcre3 libpcre3-dev && \ apt-get clean && \ @@ -15,10 +18,7 @@ RUN if [ "$(uname -m)" = "aarch64" ]; then \ fi RUN pip install --no-cache-dir -r requirements.txt - RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/metricscollector/v1beta1/tfevent-metricscollector/::${TARGET_DIR}/pkg/metricscollector/v1beta1/common/ - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/new-ui/v1beta1/Dockerfile b/cmd/new-ui/v1beta1/Dockerfile index b9130b4478b..8a513a138a3 100644 --- a/cmd/new-ui/v1beta1/Dockerfile +++ b/cmd/new-ui/v1beta1/Dockerfile @@ -35,6 +35,8 @@ RUN npm run build:prod # --- Build the backend --- FROM golang:alpine AS go-build +ARG TARGETARCH + WORKDIR /go/src/github.com/kubeflow/katib # Download packages. @@ -47,13 +49,7 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-ui ./cmd/new-ui/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o katib-ui ./cmd/new-ui/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o katib-ui ./cmd/new-ui/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o katib-ui ./cmd/new-ui/v1beta1 # --- Compose the web app --- FROM alpine:3.15 diff --git a/cmd/suggestion/chocolate/v1beta1/Dockerfile b/cmd/suggestion/chocolate/v1beta1/Dockerfile index 4be183490a1..bff97750af4 100644 --- a/cmd/suggestion/chocolate/v1beta1/Dockerfile +++ b/cmd/suggestion/chocolate/v1beta1/Dockerfile @@ -1,21 +1,21 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/chocolate/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python RUN apt-get -y update && \ apt-get -y install git && \ - if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ + if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "arm64" ]; then \ apt-get -y install gfortran libopenblas-dev liblapack-dev g++; \ fi && \ apt-get clean && \ @@ -26,11 +26,9 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/goptuna/v1beta1/Dockerfile b/cmd/suggestion/goptuna/v1beta1/Dockerfile index ffd68e20926..440a2f610af 100644 --- a/cmd/suggestion/goptuna/v1beta1/Dockerfile +++ b/cmd/suggestion/goptuna/v1beta1/Dockerfile @@ -1,6 +1,7 @@ # Build the Goptuna Suggestion. FROM golang:alpine AS build-env +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 WORKDIR /go/src/github.com/kubeflow/katib @@ -15,23 +16,11 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o goptuna-suggestion ./cmd/suggestion/goptuna/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o goptuna-suggestion ./cmd/suggestion/goptuna/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o goptuna-suggestion ./cmd/suggestion/goptuna/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o goptuna-suggestion ./cmd/suggestion/goptuna/v1beta1 # Add GRPC health probe. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe # Copy the Goptuna suggestion into a thin image. FROM alpine:3.15 @@ -39,6 +28,7 @@ FROM alpine:3.15 ENV TARGET_DIR /opt/katib WORKDIR ${TARGET_DIR} + COPY --from=build-env /bin/grpc_health_probe /bin/ COPY --from=build-env /go/src/github.com/kubeflow/katib/goptuna-suggestion ${TARGET_DIR}/ diff --git a/cmd/suggestion/hyperband/v1beta1/Dockerfile b/cmd/suggestion/hyperband/v1beta1/Dockerfile index 79e8572b597..c116991242b 100644 --- a/cmd/suggestion/hyperband/v1beta1/Dockerfile +++ b/cmd/suggestion/hyperband/v1beta1/Dockerfile @@ -1,19 +1,19 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/hyperband/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "arm64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ @@ -25,11 +25,9 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/hyperopt/v1beta1/Dockerfile b/cmd/suggestion/hyperopt/v1beta1/Dockerfile index 6d69588692a..2324c12753c 100644 --- a/cmd/suggestion/hyperopt/v1beta1/Dockerfile +++ b/cmd/suggestion/hyperopt/v1beta1/Dockerfile @@ -1,19 +1,19 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/hyperopt/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ @@ -25,11 +25,9 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/nas/darts/v1beta1/Dockerfile b/cmd/suggestion/nas/darts/v1beta1/Dockerfile index 173371fbf67..e94341f0779 100644 --- a/cmd/suggestion/nas/darts/v1beta1/Dockerfile +++ b/cmd/suggestion/nas/darts/v1beta1/Dockerfile @@ -1,19 +1,19 @@ FROM alpine:3.15 as downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/nas/darts/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ @@ -25,11 +25,9 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/nas/enas/v1beta1/Dockerfile b/cmd/suggestion/nas/enas/v1beta1/Dockerfile index 7ae66e87f71..639d21b2750 100644 --- a/cmd/suggestion/nas/enas/v1beta1/Dockerfile +++ b/cmd/suggestion/nas/enas/v1beta1/Dockerfile @@ -1,20 +1,20 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/nas/enas/v1beta1 ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ @@ -26,11 +26,9 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/optuna/v1beta1/Dockerfile b/cmd/suggestion/optuna/v1beta1/Dockerfile index 3d445c883b2..7b7129f7f44 100644 --- a/cmd/suggestion/optuna/v1beta1/Dockerfile +++ b/cmd/suggestion/optuna/v1beta1/Dockerfile @@ -1,34 +1,33 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/optuna/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*; \ fi + ADD ./pkg/ ${TARGET_DIR}/pkg/ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/pbt/v1beta1/Dockerfile b/cmd/suggestion/pbt/v1beta1/Dockerfile index 06f56c90c2d..e969ee39c21 100644 --- a/cmd/suggestion/pbt/v1beta1/Dockerfile +++ b/cmd/suggestion/pbt/v1beta1/Dockerfile @@ -1,37 +1,33 @@ +FROM alpine:3.15 AS downloader + +ARG TARGETARCH +ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 + +RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe + FROM python:3.9-slim +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/pbt/v1beta1 -ENV GRPC_HEALTH_PROBE_VERSION v0.4.6 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ - apt-get -y update && \ - apt-get -y install gfortran libopenblas-dev liblapack-dev wget && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/*; \ - else \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ - apt-get -y install wget && \ + apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*; \ fi -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe ADD ./pkg/ ${TARGET_DIR}/pkg/ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ +COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe + WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/suggestion/skopt/v1beta1/Dockerfile b/cmd/suggestion/skopt/v1beta1/Dockerfile index 7e683a9d8e7..a0f934fafbf 100644 --- a/cmd/suggestion/skopt/v1beta1/Dockerfile +++ b/cmd/suggestion/skopt/v1beta1/Dockerfile @@ -1,34 +1,33 @@ FROM alpine:3.15 AS downloader + +ARG TARGETARCH ENV GRPC_HEALTH_PROBE_VERSION v0.4.11 -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \ - else \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \ - fi && \ - chmod +x /bin/grpc_health_probe + +RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \ + && chmod +x /bin/grpc_health_probe FROM python:3.9-slim + +ARG TARGETARCH ENV TARGET_DIR /opt/katib ENV SUGGESTION_DIR cmd/suggestion/skopt/v1beta1 +ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python -RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libopenblas-dev liblapack-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*; \ fi + ADD ./pkg/ ${TARGET_DIR}/pkg/ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/ COPY --from=downloader /bin/grpc_health_probe /bin/grpc_health_probe WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR} -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN chgrp -R 0 ${TARGET_DIR} \ && chmod -R g+rwX ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python - ENTRYPOINT ["python", "main.py"] diff --git a/cmd/ui/v1beta1/Dockerfile b/cmd/ui/v1beta1/Dockerfile index 5a9a1ab0bad..505cc7eada8 100644 --- a/cmd/ui/v1beta1/Dockerfile +++ b/cmd/ui/v1beta1/Dockerfile @@ -10,6 +10,8 @@ RUN rm -rf /frontend/node_modules # Build backend. FROM golang:alpine AS go-build +ARG TARGETARCH + WORKDIR /go/src/github.com/kubeflow/katib # Download packages. @@ -22,13 +24,7 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ # Build the binary. -RUN if [ "$(uname -m)" = "ppc64le" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -a -o katib-ui ./cmd/ui/v1beta1; \ - elif [ "$(uname -m)" = "aarch64" ]; then \ - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o katib-ui ./cmd/ui/v1beta1; \ - else \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o katib-ui ./cmd/ui/v1beta1; \ - fi +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o katib-ui ./cmd/ui/v1beta1 # Copy the backend and frontend into a thin image. FROM alpine:3.15 diff --git a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu index bf7160a40cd..067628cf06e 100644 --- a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu @@ -3,6 +3,7 @@ FROM python:3.9-slim ENV TARGET_DIR /opt/darts-cnn-cifar10 ADD examples/v1beta1/trial-images/darts-cnn-cifar10 ${TARGET_DIR} + WORKDIR ${TARGET_DIR} RUN pip install --no-cache-dir -r requirements.txt diff --git a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.gpu b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.gpu index 903516fc01d..819b8fb77fa 100644 --- a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.gpu +++ b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.gpu @@ -5,6 +5,7 @@ FROM pytorch/pytorch:1.0-cuda${cuda_version}-cudnn${cudnn_version}-runtime ENV TARGET_DIR /opt/darts-cnn-cifar10 ADD examples/v1beta1/trial-images/darts-cnn-cifar10 ${TARGET_DIR} + WORKDIR ${TARGET_DIR} RUN chgrp -R 0 ${TARGET_DIR} \ diff --git a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu index 4b693640e7c..8eec13594d6 100644 --- a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu @@ -1,13 +1,14 @@ FROM python:3.9-slim +ARG TARGETARCH ENV TARGET_DIR /opt/enas-cnn-cifar10 +ENV PYTHONPATH ${TARGET_DIR} ADD examples/v1beta1/trial-images/enas-cnn-cifar10 ${TARGET_DIR} -WORKDIR ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR} +WORKDIR ${TARGET_DIR} -RUN if [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libpcre3 libpcre3-dev && \ apt-get clean && \ diff --git a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.gpu b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.gpu index fb37258ea8a..f7071a4f759 100644 --- a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.gpu +++ b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.gpu @@ -1,11 +1,11 @@ FROM tensorflow/tensorflow:2.9.1-gpu ENV TARGET_DIR /opt/enas-cnn-cifar10 +ENV PYTHONPATH ${TARGET_DIR} ADD examples/v1beta1/trial-images/enas-cnn-cifar10 ${TARGET_DIR} -WORKDIR ${TARGET_DIR} -ENV PYTHONPATH ${TARGET_DIR} +WORKDIR ${TARGET_DIR} RUN pip install --no-cache-dir scipy==1.8.1 RUN chgrp -R 0 ${TARGET_DIR} \ diff --git a/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile b/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile index a229f847207..4c46894aa1a 100644 --- a/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile +++ b/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.9-slim ADD examples/v1beta1/trial-images/mxnet-mnist /opt/mxnet-mnist + WORKDIR /opt/mxnet-mnist RUN apt-get -y update \ diff --git a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu index 8780095f9e2..1ebab4fa036 100644 --- a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu @@ -1,6 +1,7 @@ FROM python:3.9-slim ADD examples/v1beta1/trial-images/pytorch-mnist /opt/pytorch-mnist + WORKDIR /opt/pytorch-mnist # Add folder for the logs. diff --git a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.gpu b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.gpu index cdb6190f247..0cc37f2cd5d 100644 --- a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.gpu +++ b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.gpu @@ -1,6 +1,7 @@ FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime ADD examples/v1beta1/trial-images/pytorch-mnist /opt/pytorch-mnist + WORKDIR /opt/pytorch-mnist # Add folder for the logs. diff --git a/examples/v1beta1/trial-images/simple-pbt/Dockerfile b/examples/v1beta1/trial-images/simple-pbt/Dockerfile index 4f024455998..f7285447c14 100644 --- a/examples/v1beta1/trial-images/simple-pbt/Dockerfile +++ b/examples/v1beta1/trial-images/simple-pbt/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.9-slim ADD examples/v1beta1/trial-images/simple-pbt /opt/pbt + WORKDIR /opt/pbt RUN python3 -m pip install -r requirements.txt - RUN chgrp -R 0 /opt/pbt \ && chmod -R g+rwX /opt/pbt diff --git a/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile b/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile index 74919c6ad09..7a78a66fea6 100644 --- a/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile +++ b/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile @@ -1,9 +1,12 @@ FROM python:3.9-slim +ARG TARGETARCH + ADD examples/v1beta1/trial-images/tf-mnist-with-summaries /opt/tf-mnist-with-summaries + WORKDIR /opt/tf-mnist-with-summaries -RUN if [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${TARGETARCH}" = "aarch64" ]; then \ apt-get -y update && \ apt-get -y install gfortran libpcre3 libpcre3-dev && \ apt-get clean && \