Skip to content

Commit

Permalink
[CI] optimize katib ui dockerfile (#2505)
Browse files Browse the repository at this point in the history
* fix flakiness

Signed-off-by: mahdikhashan <[email protected]>

* fix flakiness 2

Signed-off-by: mahdikhashan <[email protected]>

* fix flakiness 3

Signed-off-by: mahdikhashan <[email protected]>

* use alpine for first stage

Signed-off-by: mahdikhashan <[email protected]>

* use alpline git

Signed-off-by: mahdikhashan <[email protected]>

* no security audit

Signed-off-by: mahdikhashan <[email protected]>

* force npm ci

Signed-off-by: mahdikhashan <[email protected]>

---------

Signed-off-by: mahdikhashan <[email protected]>
  • Loading branch information
mahdikhashan authored Feb 1, 2025
1 parent bf03463 commit 3e736dc
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cmd/ui/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# --- Clone the kubeflow/kubeflow code ---
FROM ubuntu AS fetch-kubeflow-kubeflow

RUN apt-get update && apt-get install git -y
FROM alpine/git AS fetch-kubeflow-kubeflow

WORKDIR /kf
COPY ./pkg/ui/v1beta1/frontend/COMMIT ./
Expand All @@ -11,7 +9,7 @@ RUN git clone https://github.com/kubeflow/kubeflow.git && \
git checkout $COMMIT

# --- Build the frontend kubeflow library ---
FROM node:16 AS frontend-kubeflow-lib
FROM node:16-alpine AS frontend-kubeflow-lib

WORKDIR /src

Expand All @@ -21,25 +19,27 @@ RUN npm config set fetch-retry-mintimeout 200000 && \
npm config set fetch-retry-maxtimeout 1200000 && \
npm config get registry && \
npm config set registry https://registry.npmjs.org/ && \
npm config get https-proxy && \
npm config rm https-proxy && \
npm ci
npm config delete https-proxy && \
npm config set loglevel verbose && \
npm cache clean --force && \
npm ci --force --prefer-offline --no-audit

COPY --from=fetch-kubeflow-kubeflow $LIB/ ./
RUN npm run build

# --- Build the frontend ---
FROM node:16 AS frontend
FROM node:16-alpine AS frontend

WORKDIR /src
COPY ./pkg/ui/v1beta1/frontend/package*.json ./
RUN npm config set fetch-retry-mintimeout 20000 && \
npm config set fetch-retry-maxtimeout 120000 && \
RUN npm config set fetch-retry-mintimeout 200000 && \
npm config set fetch-retry-maxtimeout 1200000 && \
npm config get registry && \
npm config set registry https://registry.npmjs.org/ && \
npm config get https-proxy && \
npm config rm https-proxy && \
npm ci
npm config delete https-proxy && \
npm config set loglevel verbose && \
npm cache clean --force && \
npm ci --force --prefer-offline --no-audit

COPY ./pkg/ui/v1beta1/frontend/ .
COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
Expand Down

0 comments on commit 3e736dc

Please sign in to comment.