Skip to content

Commit

Permalink
updated compatible base images & removed arch dependencies in differe…
Browse files Browse the repository at this point in the history
…nt components for multiple arch support (#6650)

* updated base images in Volume Web component for multiple arch

* updated base images in Tensorboard Web component for multiple arch

* updated base images in Jupyter Web component for multiple arch

* updated admission webhook component for multiple arch

* removed goarch depedency for multiarch building

* removed goarch depedency for multiarch building in admission webhook component

* removed goarch depedency & added powerPC case for multiarch building in access-management component

* removed goarch depedency for multiarch building in tensorboard controller

* removed goarch depedency for multiarch building in notebook Controller

* Removing empty computation to resolve future build issues
  • Loading branch information
pranavpandit1 authored Nov 23, 2022
1 parent 5961e64 commit 51fe34f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 31 deletions.
10 changes: 6 additions & 4 deletions components/access-management/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ FROM golang:${GOLANG_VERSION} as builder
WORKDIR /workspace

COPY . .
RUN go mod download

RUN if [ "$(uname -m)" = "aarch64" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -gcflags 'all=-N -l' -o access-management main.go; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags 'all=-N -l' -o access-management main.go; \
go mod download; \
elif [ "$(uname -m)" = "ppc64le" ]; then \
git config --global http.sslVerify false && go mod download; \
fi

RUN CGO_ENABLED=0 GOOS=linux go build -gcflags 'all=-N -l' -o access-management main.go

RUN chmod a+rx access-management

# Use distroless as minimal base image to package the manager binary
Expand Down
8 changes: 2 additions & 6 deletions components/admission-webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ COPY . .
ENV GO111MODULE=on

# Build
RUN if [ "$(uname -m)" = "aarch64" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o webhook -a . ; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webhook -a . ; \
fi

RUN CGO_ENABLED=0 GOOS=linux go build -o webhook -a . ;

# Copy the controller-manager into a distroless image
FROM gcr.io/distroless/static-debian10:fd0d99e8c54d7d7b2f3dd29f5093d030d192cbbc
WORKDIR /
Expand Down
4 changes: 2 additions & 2 deletions components/crud-web-apps/jupyter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --- Build the backend kubeflow-wheel ---
FROM python:3.8-slim-buster AS backend-kubeflow-wheel
FROM python:3.8-slim AS backend-kubeflow-wheel

WORKDIR /src

Expand Down Expand Up @@ -42,7 +42,7 @@ RUN npm run build -- --output-path=./dist/default --configuration=production
RUN npm run build -- --output-path=./dist/rok --configuration=rok-prod

# Web App
FROM python:3.8-slim-buster
FROM python:3.8-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
4 changes: 2 additions & 2 deletions components/crud-web-apps/tensorboards/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --- Build the backend kubeflow-wheel ---
FROM python:3.8-slim-buster AS backend-kubeflow-wheel
FROM python:3.8-slim AS backend-kubeflow-wheel

WORKDIR /src

Expand Down Expand Up @@ -41,7 +41,7 @@ COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
RUN npm run build -- --output-path=./dist --configuration=production

# Web App
FROM python:3.8-slim-buster
FROM python:3.8-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
4 changes: 2 additions & 2 deletions components/crud-web-apps/volumes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY ./common/backend/ .
RUN python3 setup.py bdist_wheel

# --- Build the frontend kubeflow library ---
FROM node:12 as frontend-kubeflow-lib
FROM node:12-buster-slim as frontend-kubeflow-lib

WORKDIR /src

Expand Down Expand Up @@ -42,7 +42,7 @@ RUN npm run build -- --output-path=./dist/default --configuration=production
RUN npm run build -- --output-path=./dist/rok --configuration=rok-prod

# Web App
FROM python:3.7-slim-buster
FROM python:3.7-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
6 changes: 1 addition & 5 deletions components/notebook-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ RUN cd /workspace/notebook-controller && go mod download
WORKDIR /workspace/notebook-controller

# Build
RUN if [ "$(uname -m)" = "aarch64" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -a -mod=mod -o manager main.go; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -mod=mod -o manager main.go; \
fi
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -mod=mod -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
6 changes: 1 addition & 5 deletions components/profile-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ COPY controllers/ controllers/
RUN cp /bin/dash /workspace/dash

# Build
RUN if [ "$(uname -m)" = "aarch64" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -a -o manager main.go; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go; \
fi
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go;

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
6 changes: 1 addition & 5 deletions components/tensorboard-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ RUN cd /workspace/tensorboard-controller && go mod download
WORKDIR /workspace/tensorboard-controller

# Build
RUN if [ "$(uname -m)" = "aarch64" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -a -o manager main.go; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go; \
fi
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down

0 comments on commit 51fe34f

Please sign in to comment.