From 7b2d430529ea90e5e833f3544fd02d5f60949552 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Oliveira" Date: Mon, 19 Aug 2024 17:45:09 -0300 Subject: [PATCH] Add CPaaS images for argoexec and workflowcontroller Signed-off-by: Ricardo M. Oliveira --- rhoai/Dockerfile.argoexec | 72 +++++++++++++++++++++++++++++ rhoai/Dockerfile.workflowcontroller | 65 ++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 rhoai/Dockerfile.argoexec create mode 100644 rhoai/Dockerfile.workflowcontroller diff --git a/rhoai/Dockerfile.argoexec b/rhoai/Dockerfile.argoexec new file mode 100644 index 000000000000..72511bf39c42 --- /dev/null +++ b/rhoai/Dockerfile.argoexec @@ -0,0 +1,72 @@ +ARG SOURCE_CODE=. +ARG CI_CONTAINER_VERSION="unknown" +ARG CI_CONTAINER_RELEASE="unknown" +# Builder args +ARG GIT_COMMIT=unknown +ARG GIT_TAG=unknown +ARG GIT_TREE_STATE=unknown + +FROM registry.redhat.io/ubi8/go-toolset:1.21 as builder + +# Build args to be used at this step +ARG SOURCE_CODE +WORKDIR /workspace + +## CPaaS CODE BEGIN ## +COPY ${REMOTE_SOURCE} ${REMOTE_SOURCE_DIR} +ENV SOURCE_CODE=${REMOTE_SOURCE}/app/ +## CPaaS CODE END ## + +USER root +RUN dnf install -y \ + git \ + make \ + ca-certificates \ + wget \ + gcc \ + bash \ + mailcap + +COPY ${SOURCE_CODE}/go.mod . +COPY ${SOURCE_CODE}/go.sum . + +RUN if [ -z ${CACHITO_ENV_FILE} ]; then \ + go mod download; \ + else \ + source ${CACHITO_ENV_FILE}; \ + fi +# Copy the source +COPY ${SOURCE_CODE}/ ./ + +RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make dist/argoexec GIT_COMMIT=${GIT_COMMIT} GIT_TAG=${GIT_TAG} GIT_TREE_STATE=${GIT_TREE_STATE} + + +#################################################################################################### +FROM registry.redhat.io/ubi8/ubi-minimal:latest AS argoexec + +ARG CI_CONTAINER_VERSION + +LABEL com.redhat.component="odh-data-science-pipelines-argo-argoexec-container" \ + name="managed-open-data-hub/odh-data-science-pipelines-argo-argoexec-rhel8" \ + version="${CI_CONTAINER_VERSION}" \ + git.url="${CI_ARGO_WORKFLOWS_UPSTREAM_URL}" \ + git.commit="${CI_ARGO_WORKFLOWS_UPSTREAM_COMMIT}" \ + summary="odh-data-science-pipelines-argo-argoexec" \ + io.openshift.expose-services="" \ + io.k8s.display-name="odh-data-science-pipelines-argo-argoexec" \ + maintainer="['managed-open-data-hub@redhat.com']" \ + description="Argo Executor for Argo Workflows used in Data Science Pipelines" \ + com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" + +WORKDIR /bin + +COPY --from=builder /workspace/dist/argoexec /bin/ +COPY --from=builder /etc/mime.types /etc/mime.types +COPY --from=builder /workspace/hack/ssh_known_hosts /etc/ssh/ +COPY --from=builder /workspace/hack/nsswitch.conf /etc/ + +RUN chmod +x /bin/argoexec + +USER 2000 + +ENTRYPOINT [ "/bin/argoexec" ] diff --git a/rhoai/Dockerfile.workflowcontroller b/rhoai/Dockerfile.workflowcontroller new file mode 100644 index 000000000000..2d07d8fc0286 --- /dev/null +++ b/rhoai/Dockerfile.workflowcontroller @@ -0,0 +1,65 @@ +# Build arguments +ARG SOURCE_CODE=. +ARG CI_CONTAINER_VERSION="unknown" +ARG CI_CONTAINER_RELEASE="unknown" +# Builder args +ARG GIT_COMMIT=unknown +ARG GIT_TAG=unknown +ARG GIT_TREE_STATE=unknown + +FROM registry.redhat.io/ubi8/go-toolset:1.21 as builder + +# Build args to be used at this step +ARG SOURCE_CODE +WORKDIR /workspace + +## CPaaS CODE BEGIN ## +COPY ${REMOTE_SOURCE} ${REMOTE_SOURCE_DIR} +ENV SOURCE_CODE=${REMOTE_SOURCE}/app +## CPaaS CODE END ## +USER root +RUN dnf install -y \ + git \ + make \ + ca-certificates \ + wget \ + gcc \ + bash \ + mailcap + +COPY ${SOURCE_CODE}/go.mod . +COPY ${SOURCE_CODE}/go.sum . +RUN if [ -z ${CACHITO_ENV_FILE} ]; then \ + go mod download; \ + else \ + source ${CACHITO_ENV_FILE}; \ + fi +# Copy the source +COPY ${SOURCE_CODE}/ ./ + +RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make dist/workflow-controller GIT_COMMIT=${GIT_COMMIT} GIT_TAG=${GIT_TAG} GIT_TREE_STATE=${GIT_TREE_STATE} + +#################################################################################################### + +FROM registry.redhat.io/ubi8/ubi-minimal:latest AS workflow-controller + +ARG CI_CONTAINER_VERSION + +LABEL com.redhat.component="odh-data-science-pipelines-argo-workflowcontroller-container" \ + name="managed-open-data-hub/odh-data-science-pipelines-argo-workflowcontroller-rhel8" \ + version="${CI_CONTAINER_VERSION}" \ + git.url="${CI_ARGO_WORKFLOWS_UPSTREAM_URL}" \ + git.commit="${CI_ARGO_WORKFLOWS_UPSTREAM_COMMIT}" \ + summary="odh-data-science-pipelines-argo-workflowcontroller" \ + io.openshift.expose-services="" \ + io.k8s.display-name="odh-data-science-pipelines-argo-workflowcontroller" \ + maintainer="['managed-open-data-hub@redhat.com']" \ + description="Argo Workflow Controller for Argo Workflows used in Data Science Pipelines" \ + com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" + +WORKDIR /bin +USER 8737 +COPY --from=builder /workspace/hack/ssh_known_hosts /etc/ssh/ +COPY --from=builder /workspace/hack/nsswitch.conf /etc/ +COPY --chown=8737 --from=builder /workspace/dist/workflow-controller /bin/workflow-controller +ENTRYPOINT [ "/bin/workflow-controller" ]