diff --git a/Dockerfile.konflux b/Dockerfile.konflux new file mode 100644 index 00000000..c3f465a7 --- /dev/null +++ b/Dockerfile.konflux @@ -0,0 +1,70 @@ + +# Build arguments +ARG SOURCE_CODE=. + +FROM registry.redhat.io/ubi8/ubi-minimal@sha256:7583ca0ea52001562bd81a961da3f75222209e6192e4e413ee226cff97dbd48c AS stage + +# Define a build argument for the PNC list of built files +ARG PNC_FILES_JSON +RUN echo "Files to download: $PNC_FILES_JSON" + +# Install packages for the install script and extract archives +RUN microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y unzip jq wget + +ENV STAGE_DIR="/tmp/artifacts" +WORKDIR $STAGE_DIR + +# Filter the zip files only and unzip them in /root/ +RUN echo "$PNC_FILES_JSON" | jq -r '.[] | select(test("\\.zip$"))' | \ + while read url; do wget --no-check-certificate "$url"; done && \ + for file in *.zip; do unzip -d /root/ "$file"; done + + +############################################################################### +#latest tag +FROM registry.redhat.io/ubi8/openjdk-17-runtime@sha256:e2f33a6c60db4f4e70882a4a557eec5890997f8a1be7e3eb8971a0ff8a45a1a8 as runtime + +## Build args to be used at this step +ARG USERID=2000 + +LABEL com.redhat.component="odh-modelmesh-container" \ + name="managed-open-data-hub/odh-modelmesh-rhel8" \ + description="Modelmesh is a distributed LRU cache for serving runtime models" \ + summary="odh-modelmesh" \ + maintainer="['managed-open-data-hub@redhat.com']" \ + io.openshift.expose-services="" \ + io.k8s.display-name="odh-modelmesh" \ + io.k8s.description="odh-modelmesh" \ + com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" + +USER root + +RUN sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security \ + && sed -i 's:#security.provider.1=SunPKCS11 ${java.home}/lib/security/nss.cfg:security.provider.12=SunPKCS11 ${java.home}/lib/security/nss.cfg:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security + +COPY --from=stage root/target/dockerhome/ /opt/kserve/mmesh/ +COPY --from=stage root/target/dockerhome/version /etc/modelmesh-version + + +# Make this the current directory when starting the container +WORKDIR /opt/kserve/mmesh + +RUN microdnf install shadow-utils + +RUN useradd -c "Application User" -U -u ${USERID} -m app && \ + chown -R app:0 /home/app && \ + chmod g+w /etc/passwd && \ + ln -s /opt/kserve/mmesh /opt/kserve/tas && \ + mkdir -p log && \ + chown -R app:0 . && \ + chmod -R 771 . && chmod 775 *.sh *.py && \ + echo "${CI_CONTAINER_VERSION}" > /opt/kserve/mmesh/build-version + +EXPOSE 8080 + +# Run as non-root user by default, to allow runAsNonRoot:true without runAsUser +USER ${USERID} + + +# The command to run by default when the container is first launched +CMD ["sh", "-c", "exec /opt/kserve/mmesh/start.sh"] diff --git a/rpms.in.yaml b/rpms.in.yaml new file mode 100644 index 00000000..4a9b0660 --- /dev/null +++ b/rpms.in.yaml @@ -0,0 +1,8 @@ +contentOrigin: + repofiles: + - ubi.repo +packages: + - unzip + - jq + - wget + - shadow-utils \ No newline at end of file diff --git a/rpms.lock.yaml b/rpms.lock.yaml new file mode 100644 index 00000000..17bdcdf5 --- /dev/null +++ b/rpms.lock.yaml @@ -0,0 +1,64 @@ +--- +lockfileVersion: 1 +lockfileVendor: redhat +arches: +- arch: x86_64 + packages: + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/j/jq-1.6-9.el8_10.x86_64.rpm + repoid: ubi-8-appstream-rpms + size: 207896 + checksum: sha256:baaa3660d87c4f3c12776e051b7f13835fee8918389a57673519e3389eb7aa3b + name: jq + evr: 1.6-9.el8_10 + sourcerpm: jq-1.6-9.el8_10.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/o/oniguruma-6.8.2-3.el8.x86_64.rpm + repoid: ubi-8-appstream-rpms + size: 192632 + checksum: sha256:1c5c91d8a33987892ec7320c08311a31245be91800aa5879e20d137971bd053f + name: oniguruma + evr: 6.8.2-3.el8 + sourcerpm: oniguruma-6.8.2-3.el8.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/w/wget-1.19.5-12.el8_10.x86_64.rpm + repoid: ubi-8-appstream-rpms + size: 751872 + checksum: sha256:8d609774711cea9728faf684ff7e9b389f0f3c2052aa04bcf3061950a830058b + name: wget + evr: 1.19.5-12.el8_10 + sourcerpm: wget-1.19.5-12.el8_10.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/e/expat-2.2.5-15.el8_10.x86_64.rpm + repoid: ubi-8-baseos-rpms + size: 117148 + checksum: sha256:1ae9138f9947f182ad077393c16522941bce2f225eee687a0387f0f71c416bc0 + name: expat + evr: 2.2.5-15.el8_10 + sourcerpm: expat-2.2.5-15.el8_10.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libmetalink-0.1.3-7.el8.x86_64.rpm + repoid: ubi-8-baseos-rpms + size: 32784 + checksum: sha256:cd7c30d21e7240f60f0861c229e17fda43e855ab4c78fab39f47f7ae2be5720e + name: libmetalink + evr: 0.1.3-7.el8 + sourcerpm: libmetalink-0.1.3-7.el8.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libsemanage-2.9-9.el8_6.x86_64.rpm + repoid: ubi-8-baseos-rpms + size: 172128 + checksum: sha256:1f686a73273028ca85b5a6ac858292d7b7d2fcbe379d6912ba12fc0a49ac4cce + name: libsemanage + evr: 2.9-9.el8_6 + sourcerpm: libsemanage-2.9-9.el8_6.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/s/shadow-utils-4.6-22.el8.x86_64.rpm + repoid: ubi-8-baseos-rpms + size: 1292332 + checksum: sha256:ea73ee201451bbca0d6d14ca434c93800f01c8fb1b9daef727a5af1a27356d07 + name: shadow-utils + evr: 2:4.6-22.el8 + sourcerpm: shadow-utils-4.6-22.el8.src.rpm + - url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/u/unzip-6.0-46.el8.x86_64.rpm + repoid: ubi-8-baseos-rpms + size: 200568 + checksum: sha256:af382b8bbb076e8662abf092c89ddd233796c6b8ed201d37fbcfcc07824295dd + name: unzip + evr: 6.0-46.el8 + sourcerpm: unzip-6.0-46.el8.src.rpm + source: [] + module_metadata: [] diff --git a/ubi.repo b/ubi.repo new file mode 100644 index 00000000..bdc28e0a --- /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