@@ -18,12 +18,6 @@ ARG SOURCE_CODE=.
18
18
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as builder
19
19
20
20
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
27
21
28
22
RUN dnf install -y cmake clang openssl
29
23
@@ -40,13 +34,41 @@ COPY ${SOURCE_CODE}/ ./
40
34
RUN GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/apiserver ./backend/src/apiserver/ && \
41
35
dnf clean all
42
36
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
+
43
64
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
44
65
45
66
WORKDIR /bin
46
67
47
68
COPY --from=builder /opt/app-root/src/backend/src/apiserver/config/ /config
48
69
COPY --from=builder /bin/apiserver /bin/apiserver
49
70
71
+ COPY --from=compiler /samples/ /samples/
50
72
RUN chmod +x /bin/apiserver
51
73
52
74
USER root
0 commit comments