Skip to content

Commit dff76cb

Browse files
committed
UPSTREAM: <carry>: Fixed Dockerfile
Signed-off-by: Helber Belmiro <[email protected]>
1 parent 6dcafaf commit dff76cb

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

backend/Dockerfile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ ARG SOURCE_CODE=.
1818
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as builder
1919

2020
USER root
21-
# Downloading Argo CLI so that the samples are validated
22-
ENV ARGO_VERSION v3.5.14
23-
RUN curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz && \
24-
gunzip argo-linux-amd64.gz && \
25-
chmod +x argo-linux-amd64 && \
26-
mv ./argo-linux-amd64 /usr/local/bin/argo
2721

2822
RUN dnf install -y cmake clang openssl
2923

@@ -40,13 +34,41 @@ COPY ${SOURCE_CODE}/ ./
4034
RUN GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/apiserver ./backend/src/apiserver/ && \
4135
dnf clean all
4236

37+
# 2. Compile preloaded pipeline samples
38+
FROM registry.access.redhat.com/ubi9/python-39:9.5 as compiler
39+
USER root
40+
RUN dnf install -y python3-setuptools jq
41+
RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
42+
COPY backend/requirements.txt .
43+
RUN python3 -m pip install -r requirements.txt --no-cache-dir
44+
45+
# Downloading Argo CLI so that the samples are validated
46+
ENV ARGO_VERSION v3.5.14
47+
RUN curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz && \
48+
gunzip argo-linux-amd64.gz && \
49+
chmod +x argo-linux-amd64 && \
50+
mv ./argo-linux-amd64 /usr/local/bin/argo
51+
52+
WORKDIR /
53+
COPY ./samples /samples
54+
COPY backend/src/apiserver/config/sample_config.json /samples/
55+
56+
# Compiling the preloaded samples.
57+
# The default image is replaced with the GCR-hosted python image.
58+
RUN set -e; \
59+
< /samples/sample_config.json jq ".pipelines[].file" --raw-output | while read pipeline_yaml; do \
60+
pipeline_py="${pipeline_yaml%.yaml}"; \
61+
echo "Compiling: \"$pipeline_py\"" && python3 "$pipeline_py" && echo -n "Output: " && ls "$pipeline_py.yaml"; \
62+
done
63+
4364
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
4465

4566
WORKDIR /bin
4667

4768
COPY --from=builder /opt/app-root/src/backend/src/apiserver/config/ /config
4869
COPY --from=builder /bin/apiserver /bin/apiserver
4970

71+
COPY --from=compiler /samples/ /samples/
5072
RUN chmod +x /bin/apiserver
5173

5274
USER root

0 commit comments

Comments
 (0)