[CI] optimize katib ui dockerfile (#2505)

* 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]>
This commit is contained in:
Mahdi Khashan
2025-02-01 20:42:33 +00:00
committed by GitHub
parent 7599a8fdf4
commit f59d959bd9
+13 -13
View File
@@ -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 ./
@@ -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
@@ -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/