Skip to content

Commit

Permalink
Merge pull request #1 from rimolive/rmartine-rhds
Browse files Browse the repository at this point in the history
Add CPaaS images for argoexec and workflowcontroller
  • Loading branch information
HumairAK authored Aug 20, 2024
2 parents c65043a + 7b2d430 commit 8c78135
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
72 changes: 72 additions & 0 deletions rhoai/Dockerfile.argoexec
Original file line number Diff line number Diff line change
@@ -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" ]
65 changes: 65 additions & 0 deletions rhoai/Dockerfile.workflowcontroller
Original file line number Diff line number Diff line change
@@ -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" ]

0 comments on commit 8c78135

Please sign in to comment.