From 78232bf102c068f88665065a3a9337547293168a Mon Sep 17 00:00:00 2001 From: MohammadiIram Date: Tue, 8 Oct 2024 15:15:22 +0530 Subject: [PATCH 1/4] Review Dockerfile and RPMs file for building argo-argoexec and argo-workflowcontroller in Konflux --- argo-argoexec/Dockerfile.konflux | 53 ++++++++++++++++ argo-workflowcontroller/Dockerfile.konflux | 48 +++++++++++++++ rpms.in.yaml | 5 ++ rpms.lock.yaml | 15 +++++ ubi.repo | 70 ++++++++++++++++++++++ 5 files changed, 191 insertions(+) create mode 100644 argo-argoexec/Dockerfile.konflux create mode 100644 argo-workflowcontroller/Dockerfile.konflux create mode 100644 rpms.in.yaml create mode 100644 rpms.lock.yaml create mode 100644 ubi.repo diff --git a/argo-argoexec/Dockerfile.konflux b/argo-argoexec/Dockerfile.konflux new file mode 100644 index 000000000000..e1539e551d2a --- /dev/null +++ b/argo-argoexec/Dockerfile.konflux @@ -0,0 +1,53 @@ +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@sha256:4ec05fd5b355106cc0d990021a05b71bbfb9231e4f5bdc0c5316515edf6a1c96 as builder + +# Build args to be used at this step +ARG SOURCE_CODE +WORKDIR /workspace + +USER root +RUN dnf install -y mailcap + +COPY ${SOURCE_CODE}/go.mod . +COPY ${SOURCE_CODE}/go.sum . +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" ] \ No newline at end of file diff --git a/argo-workflowcontroller/Dockerfile.konflux b/argo-workflowcontroller/Dockerfile.konflux new file mode 100644 index 000000000000..c2453087cf23 --- /dev/null +++ b/argo-workflowcontroller/Dockerfile.konflux @@ -0,0 +1,48 @@ +# 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@sha256:4ec05fd5b355106cc0d990021a05b71bbfb9231e4f5bdc0c5316515edf6a1c96 as builder + +# Build args to be used at this step +ARG SOURCE_CODE +WORKDIR /workspace + +USER root +RUN dnf install -y mailcap + +COPY ${SOURCE_CODE}/go.mod . +COPY ${SOURCE_CODE}/go.sum . +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" ] \ No newline at end of file diff --git a/rpms.in.yaml b/rpms.in.yaml new file mode 100644 index 000000000000..c2b571b18be5 --- /dev/null +++ b/rpms.in.yaml @@ -0,0 +1,5 @@ +contentOrigin: + repofiles: + - ubi.repo +packages: + - mailcap \ No newline at end of file diff --git a/rpms.lock.yaml b/rpms.lock.yaml new file mode 100644 index 000000000000..d9957f2e5f17 --- /dev/null +++ b/rpms.lock.yaml @@ -0,0 +1,15 @@ +--- +lockfileVersion: 1 +lockfileVendor: redhat +arches: +- arch: x86_64 + packages: + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/m/mailcap-2.1.48-3.el8.noarch.rpm + repoid: ubi-8-baseos-rpms + size: 39708 + checksum: sha256:b2d5f3c4e187dc8c6f94b551fc021925188ab7675e02a317111aa0b49965f03e + name: mailcap + evr: 2.1.48-3.el8 + sourcerpm: mailcap-2.1.48-3.el8.src.rpm + source: [] + module_metadata: [] diff --git a/ubi.repo b/ubi.repo new file mode 100644 index 000000000000..bdc28e0a6add --- /dev/null +++ b/ubi.repo @@ -0,0 +1,70 @@ +[ubi-8-baseos-rpms] +name = Red Hat Universal Base Image 8 (RPMs) - BaseOS +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/os +enabled = 1 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-baseos-debug-rpms] +name = Red Hat Universal Base Image 8 (Debug RPMs) - BaseOS +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/debug +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-baseos-source] +name = Red Hat Universal Base Image 8 (Source RPMs) - BaseOS +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/source/SRPMS +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-appstream-rpms] +name = Red Hat Universal Base Image 8 (RPMs) - AppStream +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/os +enabled = 1 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-appstream-debug-rpms] +name = Red Hat Universal Base Image 8 (Debug RPMs) - AppStream +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/debug +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-appstream-source] +name = Red Hat Universal Base Image 8 (Source RPMs) - AppStream +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/source/SRPMS +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-codeready-builder-rpms] +name = Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/os +enabled = 1 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-codeready-builder] +name = Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/os +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + + +[ubi-8-codeready-builder-debug-rpms] +name = Red Hat Universal Base Image 8 (Debug RPMs) - CodeReady Builder +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/debug +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 + +[ubi-8-codeready-builder-source] +name = Red Hat Universal Base Image 8 (Source RPMs) - CodeReady Builder +baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/source/SRPMS +enabled = 0 +gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgcheck = 1 From 85280596adedf39ce56b09c54e25e7c944afdd24 Mon Sep 17 00:00:00 2001 From: MohammadiIram Date: Thu, 10 Oct 2024 16:02:35 +0530 Subject: [PATCH 2/4] Review Dockerfile and RPMs file for building argo-argoexec and argo-workflowcontroller in Konflux --- argo-argoexec/Dockerfile.konflux | 3 ++- argo-workflowcontroller/Dockerfile.konflux | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/argo-argoexec/Dockerfile.konflux b/argo-argoexec/Dockerfile.konflux index e1539e551d2a..8dd2be27e3f3 100644 --- a/argo-argoexec/Dockerfile.konflux +++ b/argo-argoexec/Dockerfile.konflux @@ -23,7 +23,8 @@ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache #################################################################################################### -FROM registry.redhat.io/ubi8/ubi-minimal:latest AS argoexec +FROM registry.redhat.io/ubi8/ubi-minimal@sha256:7583ca0ea52001562bd81a961da3f75222209e6192e4e413ee226cff97dbd48c AS argoexec + ARG CI_CONTAINER_VERSION diff --git a/argo-workflowcontroller/Dockerfile.konflux b/argo-workflowcontroller/Dockerfile.konflux index c2453087cf23..9c6560580a26 100644 --- a/argo-workflowcontroller/Dockerfile.konflux +++ b/argo-workflowcontroller/Dockerfile.konflux @@ -23,8 +23,8 @@ 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@sha256:7583ca0ea52001562bd81a961da3f75222209e6192e4e413ee226cff97dbd48c AS workflow-controller -FROM registry.redhat.io/ubi8/ubi-minimal:latest AS workflow-controller ARG CI_CONTAINER_VERSION From d9ef0fe4db4ea8f1fdd5aef05afb760302061b12 Mon Sep 17 00:00:00 2001 From: MohammadiIram Date: Tue, 15 Oct 2024 12:39:59 +0530 Subject: [PATCH 3/4] Review Dockerfile and RPMs file for building argo-argoexec and argo-workflowcontroller in Konflux --- argo-argoexec/Dockerfile.konflux | 8 +++----- argo-workflowcontroller/Dockerfile.konflux | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/argo-argoexec/Dockerfile.konflux b/argo-argoexec/Dockerfile.konflux index 8dd2be27e3f3..b3599dd25e6f 100644 --- a/argo-argoexec/Dockerfile.konflux +++ b/argo-argoexec/Dockerfile.konflux @@ -30,14 +30,12 @@ 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}" \ + description="Argo Executor for Argo Workflows used in Data Science Pipelines" \ summary="odh-data-science-pipelines-argo-argoexec" \ + maintainer="['managed-open-data-hub@redhat.com']" \ 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" \ + io.k8s.description="odh-data-science-pipelines-argo-argoexec" \ com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" WORKDIR /bin diff --git a/argo-workflowcontroller/Dockerfile.konflux b/argo-workflowcontroller/Dockerfile.konflux index 9c6560580a26..a1ab3243d03b 100644 --- a/argo-workflowcontroller/Dockerfile.konflux +++ b/argo-workflowcontroller/Dockerfile.konflux @@ -30,14 +30,12 @@ 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}" \ + description="Argo Workflow Controller for Argo Workflows used in Data Science Pipelines" \ summary="odh-data-science-pipelines-argo-workflowcontroller" \ + maintainer="['managed-open-data-hub@redhat.com']" \ 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" \ + io.k8s.description="odh-data-science-pipelines-argo-workflowcontroller" \ com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" WORKDIR /bin From dfdf4a8db8d038dbca7cec36f41dd9c2dd6346f5 Mon Sep 17 00:00:00 2001 From: MohammadiIram Date: Wed, 16 Oct 2024 11:20:02 +0530 Subject: [PATCH 4/4] Review Dockerfile and RPMs file for building argo-argoexec and argo-workflowcontroller in Konflux --- argo-argoexec/Dockerfile.konflux | 3 +-- argo-workflowcontroller/Dockerfile.konflux | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/argo-argoexec/Dockerfile.konflux b/argo-argoexec/Dockerfile.konflux index b3599dd25e6f..8b649c4f9c5a 100644 --- a/argo-argoexec/Dockerfile.konflux +++ b/argo-argoexec/Dockerfile.konflux @@ -1,6 +1,5 @@ ARG SOURCE_CODE=. -ARG CI_CONTAINER_VERSION="unknown" -ARG CI_CONTAINER_RELEASE="unknown" + # Builder args ARG GIT_COMMIT=unknown ARG GIT_TAG=unknown diff --git a/argo-workflowcontroller/Dockerfile.konflux b/argo-workflowcontroller/Dockerfile.konflux index a1ab3243d03b..be15381edb79 100644 --- a/argo-workflowcontroller/Dockerfile.konflux +++ b/argo-workflowcontroller/Dockerfile.konflux @@ -1,7 +1,6 @@ # 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