diff --git a/devspaces-devfileregistry/.gitignore b/devspaces-devfileregistry/.gitignore index 602a67bd88..b7deebda50 100644 --- a/devspaces-devfileregistry/.gitignore +++ b/devspaces-devfileregistry/.gitignore @@ -1,5 +1,4 @@ resources/ node_modules/ -/root-local.tgz package-lock.json -/resources.tgz +REMOTE_SOURCES_DIR/ \ No newline at end of file diff --git a/devspaces-devfileregistry/Dockerfile b/devspaces-devfileregistry/Dockerfile index 42a42de1db..64bfda9900 100644 --- a/devspaces-devfileregistry/Dockerfile +++ b/devspaces-devfileregistry/Dockerfile @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2022 Red Hat, Inc. +# Copyright (c) 2018-2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -12,16 +12,21 @@ # # Builder: check meta.yamls and create index.json -# https://registry.access.redhat.com/ubi8/python-38 -FROM ubi8/python-38:1-121 as builder -USER 0 +# https://registry.access.redhat.com/ubi8/python-39 +FROM ubi8/python-39:1-97 as builder -################# -# PHASE ONE: create ubi8 image with yq -################# +# hadolint ignore=DL3002 +USER root + +# cachito #1 +COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR +ENV PYTHON_VERSION=3.9 + +# TODO remove BOOTSTRAP when we replace resources with cachito ARG BOOTSTRAP=false ENV BOOTSTRAP=${BOOTSTRAP} + # if not defined or string is null, allow all registries/tags in list_referenced_images # otherwise restrict to only those space-separated registries/tags; if others found, build will fail # useful for failing build if quay images in an RC, or wrong devspaces image tag (3.2 in 3.1 build) @@ -30,50 +35,42 @@ ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} ARG ALLOWED_TAGS="" ENV ALLOWED_TAGS=${ALLOWED_TAGS} -# to get all the python deps pre-fetched so we can build in Brew: -# 1. extract files in the container to your local filesystem -# find v3 -type f -exec dos2unix {} \; - -# NOTE: used to be in /root/.local but now can be found in /opt/app-root/src/.local -# CONTAINERNAME=devfileregistryoffline && \ -# docker build -t ${CONTAINERNAME} . --no-cache --target builder \ -# --build-arg BOOTSTRAP=true -f build/dockerfiles/Dockerfile -# mkdir -p /tmp/root-local/ && docker run --rm -v \ -# /tmp/root-local/:/tmp/root-local/ ${CONTAINERNAME} /bin/bash \ -# -c 'cd /opt/app-root/src/.local/ && cp -r bin/ lib/ /tmp/root-local/' -# pushd /tmp/root-local >/dev/null && sudo tar czf root-local.tgz lib/ bin/ && popd >/dev/null && mv -f /tmp/root-local/root-local.tgz . && sudo rm -fr /tmp/root-local/ - -# 2. then add it to dist-git so it's part of this repo -# rhpkg new-sources root-local.tgz - -# built in Brew, use tarball in lookaside cache; built locally, comment this out -COPY root-local.tgz /tmp/root-local.tgz - -# NOTE: uncomment for local build. Must also set full registry path in FROM to registry.redhat.io or registry.access.redhat.com -# enable rhel 7 or 8 content sets (from Brew) to resolve jq as rpm +# enable content sets to resolve jq as rpm COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ -COPY ./build/dockerfiles/rhel.install.sh /tmp -RUN /tmp/rhel.install.sh && rm -f /tmp/rhel.install.sh +# install yq and jq +# hadolint ignore=DL3003,DL4006,SC2086,DL3040,DL3041 +RUN dnf -y -q install python39 python39-devel python39-setuptools python39-pip jq tree && \ + # tree -L 2 "$REMOTE_SOURCES_DIR/*/app/" && \ + # cachito #2: install yq using cachito sources + cd $REMOTE_SOURCES_DIR/python-deps/app/devspaces-devfileregistry/build/python && \ + source $REMOTE_SOURCES_DIR/python-deps/cachito.env && \ + python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pip argcomplete setuptools yq && yq --version -COPY ./build/scripts /build/ -COPY ./devfiles /build/devfiles -# COPY ./resources /build/resources WORKDIR /build/ +COPY ./build/scripts ./versions.json ./job-config.json /build/ +COPY ./devfiles /build/devfiles + +# build eclipse-che/plugin-registry-generator +# hadolint ignore=DL3003,SC2086 +RUN cd $REMOTE_SOURCES_DIR/plugin-registry-generator/app/tools/build && \ + yarn install -# Registry, organization, and tag to use for base images in dockerfiles. Devfiles -# will be rewritten during build to use these values for base images. -# ARG PATCHED_IMAGES_REG="quay.io" -# ARG PATCHED_IMAGES_ORG="eclipse" -# ARG PATCHED_IMAGES_TAG="next" +# TODO use cachito to fetch sample project code (instead of ./resources or resources.tgz +# TODO can we run this inside brew? +# TODO do we need to overrride the version in versions.json? +# hadolint ignore=DL3003,SC2086 +RUN tree -L 2 $REMOTE_SOURCES_DIR/*/app/ && \ + ./generate_devworkspace_templates.sh && chmod -R g+rwX /build/resources # validate devfile content -RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" -RUN ./check_mandatory_fields.sh devfiles +RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" && \ + ./check_mandatory_fields.sh devfiles +# Cache projects in DS +# TODO remove resources.tgz in favour of cachito solution COPY ./build/dockerfiles/rhel.cache_projects.sh resources.tgz /tmp/ RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz && ./swap_yamlfiles.sh devfiles -# Cache projects in DS RUN ./index.sh > /build/devfiles/index.json && \ ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && \ ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && \ @@ -85,17 +82,19 @@ RUN ./index.sh > /build/devfiles/index.json && \ # Build registry, copying meta.yamls and index.json from builder # https://registry.access.redhat.com/rhel8/httpd-24 -FROM rhel8/httpd-24:1-248 AS registry +FROM rhel8/httpd-24:1-240.1675799498 AS registry +# hadolint ignore=DL3002 USER 0 # latest httpd container doesn't include ssl cert, so generate one +# hadolint ignore=DL4006 RUN chmod +x /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ - /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh -RUN \ + /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ yum -y -q update && \ yum -y -q clean all && rm -rf /var/cache/yum && \ echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" +# hadolint ignore=SC2140 RUN echo "" >> /etc/httpd/conf/httpd.conf && \ echo "Require all denied" >> /etc/httpd/conf/httpd.conf && \ echo "" >> /etc/httpd/conf/httpd.conf @@ -129,11 +128,13 @@ ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] CMD ["/usr/local/bin/rhel.entrypoint.sh"] # Offline build + #TODO can we enable these stages in Brew? # FROM builder AS offline-builder # RUN ./cache_projects.sh devfiles resources && \ # ./cache_images.sh devfiles resources && \ # chmod -R g+rwX /build + #TODO can we enable these stages in Brew? # FROM registry AS offline-registry # COPY --from=offline-builder /build/devfiles /var/www/html/devfiles # COPY --from=offline-builder /build/resources /var/www/html/resources diff --git a/devspaces-devfileregistry/bootstrap.Dockerfile b/devspaces-devfileregistry/bootstrap.Dockerfile deleted file mode 100644 index d6e5357f57..0000000000 --- a/devspaces-devfileregistry/bootstrap.Dockerfile +++ /dev/null @@ -1,58 +0,0 @@ -# -# Copyright (c) 2018-2023 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# IBM Corporation - implementation -# - -# Builder: check meta.yamls and create index.json -# https://registry.access.redhat.com/ubi8/python-38 -FROM registry.access.redhat.com/ubi8/python-38:1-121 as builder -#FROM registry-proxy.engineering.redhat.com/ubi8/python-38:1 as builder -USER 0 - -ARG BOOTSTRAP=true -ENV BOOTSTRAP=${BOOTSTRAP} -# if not defined or string is null, allow all registries/tags in list_referenced_images -# otherwise restrict to only those space-separated registries/tags; if others found, build will fail -# useful for failing build if quay images in an RC, or wrong devspaces image tag (3.2 in 3.1 build) -ARG ALLOWED_REGISTRIES="" -ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} -ARG ALLOWED_TAGS="" -ENV ALLOWED_TAGS=${ALLOWED_TAGS} - -COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ -COPY ./build/dockerfiles/rhel.install.sh /tmp -RUN /tmp/rhel.install.sh && rm -f /tmp/rhel.install.sh - -COPY ./build/scripts ./versions.json /build/ -COPY ./build/scripts/clone_and_zip.sh /build/build/scripts/ -COPY ./VERSION / -COPY ./devfiles /build/devfiles -WORKDIR /build/ - -RUN ./generate_devworkspace_templates.sh -RUN chmod -R g+rwX /build/resources - -# validate devfile content -RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" -RUN ./check_mandatory_fields.sh devfiles - -# Cache projects in DS -COPY ./build/dockerfiles/rhel.cache_projects.sh /tmp/ -RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz - -# don't do swaps, or we end up with missing content if built on s390x or ppc64le worker -# RUN ./swap_yamlfiles.sh devfiles -# RUN ./swap_images.sh devfiles -RUN ./index.sh > /build/devfiles/index.json && \ - ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && \ - ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && \ - chmod -R g+rwX /build/devfiles - diff --git a/devspaces-devfileregistry/build/dockerfiles/brew.Dockerfile b/devspaces-devfileregistry/build/dockerfiles/brew.Dockerfile new file mode 100644 index 0000000000..93811f980c --- /dev/null +++ b/devspaces-devfileregistry/build/dockerfiles/brew.Dockerfile @@ -0,0 +1,142 @@ +# +# Copyright (c) 2018-2023 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# IBM Corporation - implementation +# + +# Builder: check meta.yamls and create index.json +# https://registry.access.redhat.com/ubi8/python-39 +FROM ubi8/python-39:1-97 as builder + +# hadolint ignore=DL3002 +USER root + +# cachito #1 +COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR + +ENV PYTHON_VERSION=3.9 + +# TODO remove BOOTSTRAP when we replace resources with cachito +ARG BOOTSTRAP=false +ENV BOOTSTRAP=${BOOTSTRAP} + +# if not defined or string is null, allow all registries/tags in list_referenced_images +# otherwise restrict to only those space-separated registries/tags; if others found, build will fail +# useful for failing build if quay images in an RC, or wrong devspaces image tag (3.2 in 3.1 build) +ARG ALLOWED_REGISTRIES="" +ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} +ARG ALLOWED_TAGS="" +ENV ALLOWED_TAGS=${ALLOWED_TAGS} + +# enable content sets to resolve jq as rpm +COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ +# install yq and jq +# hadolint ignore=DL3003,DL4006,SC2086,DL3040,DL3041 +RUN dnf -y -q install python39 python39-devel python39-setuptools python39-pip jq tree && \ + # tree -L 2 "$REMOTE_SOURCES_DIR/*/app/" && \ + # cachito #2: install yq using cachito sources + cd $REMOTE_SOURCES_DIR/python-deps/app/devspaces-devfileregistry/build/python && \ + source $REMOTE_SOURCES_DIR/python-deps/cachito.env && \ + python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pip argcomplete setuptools yq && yq --version + +WORKDIR /build/ +COPY ./build/scripts ./versions.json ./job-config.json /build/ +COPY ./devfiles /build/devfiles + +# build eclipse-che/plugin-registry-generator +# hadolint ignore=DL3003,SC2086 +RUN cd $REMOTE_SOURCES_DIR/plugin-registry-generator/app/tools/build && \ + yarn install + +# TODO use cachito to fetch sample project code (instead of ./resources or resources.tgz +# TODO can we run this inside brew? +# TODO do we need to overrride the version in versions.json? +# hadolint ignore=DL3003,SC2086 +RUN tree -L 2 $REMOTE_SOURCES_DIR/*/app/ && \ + ./generate_devworkspace_templates.sh && chmod -R g+rwX /build/resources + +# validate devfile content +RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" && \ + ./check_mandatory_fields.sh devfiles + +# Cache projects in DS +# TODO remove resources.tgz in favour of cachito solution +COPY ./build/dockerfiles/rhel.cache_projects.sh resources.tgz /tmp/ +RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz && ./swap_yamlfiles.sh devfiles + +RUN ./index.sh > /build/devfiles/index.json && \ + ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && \ + ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && \ + chmod -R g+rwX /build/devfiles /build/resources + +################# +# PHASE TWO: configure registry image +################# + +# Build registry, copying meta.yamls and index.json from builder +# https://registry.access.redhat.com/rhel8/httpd-24 +FROM rhel8/httpd-24:1-240.1675799498 AS registry +# hadolint ignore=DL3002 +USER 0 + +# latest httpd container doesn't include ssl cert, so generate one +# hadolint ignore=DL4006 +RUN chmod +x /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ + /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ + yum -y -q update && \ + yum -y -q clean all && rm -rf /var/cache/yum && \ + echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" + +# hadolint ignore=SC2140 +RUN echo "" >> /etc/httpd/conf/httpd.conf && \ + echo "Require all denied" >> /etc/httpd/conf/httpd.conf && \ + echo "" >> /etc/httpd/conf/httpd.conf + +RUN sed -i /etc/httpd/conf.d/ssl.conf \ + -e "s,SSLProtocol all -SSLv2,SSLProtocol all -SSLv3," \ + -e "s,SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5,SSLCipherSuite HIGH:!aNULL:!MD5," + +RUN sed -i /etc/httpd/conf/httpd.conf \ + -e "s,Listen 80,Listen 8080," \ + -e "s,logs/error_log,/dev/stderr," \ + -e "s,logs/access_log,/dev/stdout," \ + -e "s,AllowOverride None,AllowOverride All," && \ + chmod a+rwX /etc/httpd/conf /run/httpd /etc/httpd/logs/ +STOPSIGNAL SIGWINCH + +ARG DS_BRANCH=devspaces-3-rhel-8 +ENV DS_BRANCH=${DS_BRANCH} + +WORKDIR /var/www/html + +RUN mkdir -m 777 /var/www/html/devfiles +COPY README.md .htaccess /var/www/html/ +COPY --from=builder /build/devfiles /var/www/html/devfiles +COPY --from=builder /build/resources /var/www/html/resources +COPY ./images /var/www/html/images +COPY ./build/dockerfiles/rhel.entrypoint.sh ./build/dockerfiles/entrypoint.sh /usr/local/bin/ +RUN chmod g+rwX /usr/local/bin/entrypoint.sh /usr/local/bin/rhel.entrypoint.sh && \ + chgrp -R 0 /var/www/html && chmod -R g+rw /var/www/html +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["/usr/local/bin/rhel.entrypoint.sh"] + +# Offline build + #TODO can we enable these stages in Brew? +# FROM builder AS offline-builder +# RUN ./cache_projects.sh devfiles resources && \ +# ./cache_images.sh devfiles resources && \ +# chmod -R g+rwX /build + + #TODO can we enable these stages in Brew? +# FROM registry AS offline-registry +# COPY --from=offline-builder /build/devfiles /var/www/html/devfiles +# COPY --from=offline-builder /build/resources /var/www/html/resources + +# append Brew metadata here diff --git a/devspaces-devfileregistry/build/dockerfiles/Dockerfile b/devspaces-devfileregistry/build/dockerfiles/rhel.Dockerfile similarity index 61% rename from devspaces-devfileregistry/build/dockerfiles/Dockerfile rename to devspaces-devfileregistry/build/dockerfiles/rhel.Dockerfile index 38c2c35b4b..2fca0f31c8 100644 --- a/devspaces-devfileregistry/build/dockerfiles/Dockerfile +++ b/devspaces-devfileregistry/build/dockerfiles/rhel.Dockerfile @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2022 Red Hat, Inc. +# Copyright (c) 2018-2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -12,16 +12,22 @@ # # Builder: check meta.yamls and create index.json -# https://registry.access.redhat.com/ubi8/python-38 -FROM registry.access.redhat.com/ubi8/python-38:1-121 as builder -USER 0 +# https://registry.access.redhat.com/ubi8/python-39 +FROM registry.access.redhat.com/ubi8/python-39:1-97 as builder -################# -# PHASE ONE: create ubi8 image with yq -################# +# hadolint ignore=DL3002 +USER root + +# local hack to mock cachito dir +ENV REMOTE_SOURCES=REMOTE_SOURCES_DIR \ + REMOTE_SOURCES_DIR=/remote-source/ +COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR -ARG BOOTSTRAP=false +ENV PYTHON_VERSION=3.9 + +ARG BOOTSTRAP=true ENV BOOTSTRAP=${BOOTSTRAP} + # if not defined or string is null, allow all registries/tags in list_referenced_images # otherwise restrict to only those space-separated registries/tags; if others found, build will fail # useful for failing build if quay images in an RC, or wrong devspaces image tag (3.2 in 3.1 build) @@ -30,47 +36,31 @@ ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} ARG ALLOWED_TAGS="" ENV ALLOWED_TAGS=${ALLOWED_TAGS} -# to get all the python deps pre-fetched so we can build in Brew: -# 1. extract files in the container to your local filesystem -# find v3 -type f -exec dos2unix {} \; - -# NOTE: used to be in /root/.local but now can be found in /opt/app-root/src/.local -# CONTAINERNAME=devfileregistryoffline && \ -# docker build -t ${CONTAINERNAME} . --no-cache --target builder \ -# --build-arg BOOTSTRAP=true -f build/dockerfiles/Dockerfile -# mkdir -p /tmp/root-local/ && docker run --rm -v \ -# /tmp/root-local/:/tmp/root-local/ ${CONTAINERNAME} /bin/bash \ -# -c 'cd /opt/app-root/src/.local/ && cp -r bin/ lib/ /tmp/root-local/' -# pushd /tmp/root-local >/dev/null && sudo tar czf root-local.tgz lib/ bin/ && popd >/dev/null && mv -f /tmp/root-local/root-local.tgz . && sudo rm -fr /tmp/root-local/ +# enable content sets to resolve jq as rpm +COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ +# install yq and jq +# hadolint ignore=DL3003,DL4006,SC2086,DL3040,DL3041 +RUN dnf -y -q install python39 python39-devel python39-setuptools python39-pip jq && \ +# tree -L 2 "$REMOTE_SOURCES_DIR/*/app/" && \ + # cachito #2: install yq using cachito sources + # cd $REMOTE_SOURCES_DIR/python-deps/app/devspaces-devfileregistry/build/python && \ + # source $REMOTE_SOURCES_DIR/python-deps/cachito.env && \ + python${PYTHON_VERSION} -m pip install --no-cache-dir --upgrade pip argcomplete setuptools yq && yq --version -# 2. then add it to dist-git so it's part of this repo -# rhpkg new-sources root-local.tgz - -# built in Brew, use tarball in lookaside cache; built locally, comment this out -# COPY root-local.tgz /tmp/root-local.tgz - -# NOTE: uncomment for local build. Must also set full registry path in FROM to registry.redhat.io or registry.access.redhat.com -# enable rhel 7 or 8 content sets (from Brew) to resolve jq as rpm -COPY ./build/dockerfiles/content_set*.repo /etc/yum.repos.d/ -COPY ./build/dockerfiles/rhel.install.sh /tmp -RUN /tmp/rhel.install.sh && rm -f /tmp/rhel.install.sh - -COPY ./build/scripts /build/ -COPY ./devfiles /build/devfiles -COPY ./resources /build/resources WORKDIR /build/ +COPY ./build/scripts ./versions.json ./job-config.json /build/ +COPY ./devfiles /build/devfiles -# Registry, organization, and tag to use for base images in dockerfiles. Devfiles -# will be rewritten during build to use these values for base images. -ARG PATCHED_IMAGES_REG="quay.io" -ARG PATCHED_IMAGES_ORG="eclipse" -ARG PATCHED_IMAGES_TAG="next" +RUN ls -la $REMOTE_SOURCES_DIR; ./generate_devworkspace_templates.sh && chmod -R g+rwX /build/resources # validate devfile content -RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" -RUN ./check_mandatory_fields.sh devfiles +RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" && \ + ./check_mandatory_fields.sh devfiles + +# Cache projects in DS +COPY ./build/dockerfiles/rhel.cache_projects.sh /tmp/ +RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz && ./swap_yamlfiles.sh devfiles -# Cache projects in DS RUN ./index.sh > /build/devfiles/index.json && \ ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && \ ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && \ @@ -82,17 +72,19 @@ RUN ./index.sh > /build/devfiles/index.json && \ # Build registry, copying meta.yamls and index.json from builder # https://registry.access.redhat.com/ubi8/httpd-24 -FROM registry.access.redhat.com/ubi8/httpd-24:1-248 AS registry +FROM registry.access.redhat.com/ubi8/httpd-24:1-240.1675799498 AS registry +# hadolint ignore=DL3002 USER 0 # latest httpd container doesn't include ssl cert, so generate one +# hadolint ignore=DL4006 RUN chmod +x /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ - /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh -RUN \ + /usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh && \ yum -y -q update && \ yum -y -q clean all && rm -rf /var/cache/yum && \ echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" +# hadolint ignore=SC2140 RUN echo "" >> /etc/httpd/conf/httpd.conf && \ echo "Require all denied" >> /etc/httpd/conf/httpd.conf && \ echo "" >> /etc/httpd/conf/httpd.conf diff --git a/devspaces-devfileregistry/build/dockerfiles/rhel.install.sh b/devspaces-devfileregistry/build/dockerfiles/rhel.install.sh deleted file mode 100755 index e6237b92ac..0000000000 --- a/devspaces-devfileregistry/build/dockerfiles/rhel.install.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-2022 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -set -x - -# set same version in Dockefiles, eg., base image ubi8/python-38 -PYTHON_VERSION="3.8" - -DNF="dnf -q" -if [[ ! -x $(command -v $DNF || true) ]]; then DNF="yum -q" - if [[ ! -x $(command -v $DNF || true) ]]; then DNF=microdnf; fi -fi - -# workaround for performance issues in CRW-1610 -echo "[main] -gpgcheck=0 -installonly_limit=3 -clean_requirements_on_remove=True -best=True -skip_if_unavailable=True -fastestmirror=True -max_parallel_downloads=10 -minrate=1 -retries=20 -timeout=60 -" > /etc/yum.conf -if [[ $DNF != "microdnf" ]]; then $DNF -y module reset python${PYTHON_VERSION/./}; $DNF -y module enable python${PYTHON_VERSION/./}:${PYTHON_VERSION}; fi -${DNF} -y install npm findutils bash wget yum git gzip tar jq skopeo \ - python${PYTHON_VERSION/./} python${PYTHON_VERSION/./}-devel python${PYTHON_VERSION/./}-setuptools python${PYTHON_VERSION/./}-pip --exclude=unbound-libs || exit 1 - -# shellcheck disable=SC2010 -PYTHON_BIN=$(ls -1 /usr/bin | grep -E "^python3.[0-9]$" | sort -V | tail -1 || true) # 3.6, 3.7, 3.8, etc. -if [[ ! ${PYTHON_BIN} ]]; then - PYTHON_BIN=$(/usr/bin/python3 -V | sed -r -e "s#Python ##" -e "s#([0-9])\.([0-9]+)\.([0-9]+)#\1.\2#") - if [[ ! ${PYTHON_BIN} ]]; then - PYTHON_BIN=$(/usr/bin/python -V | sed -r -e "s#Python ##" -e "s#([0-9])\.([0-9]+)\.([0-9]+)#\1.\2#") - fi -fi -if [[ ! -L /usr/bin/python ]]; then - ln -s /usr/bin/"${PYTHON_BIN}" /usr/bin/python -fi - -# install yq (depends on jq and pyyaml - if jq and pyyaml not already installed, this will try to compile it) -if [[ -f /tmp/root-local.tgz ]] || [[ ${BOOTSTRAP} == "true" ]]; then - mkdir -p /opt/app-root/src/.local - if [[ -f /tmp/root-local.tgz ]]; then - tar xf /tmp/root-local.tgz -C /opt/app-root/src/.local - rm -fr /tmp/root-local.tgz - fi - /usr/bin/python -m pip install --user yq argcomplete - # NOTE: used to be in /root/.local but now can be found in /opt/app-root/src/.local - # shellcheck disable=SC2043 - for d in /opt/app-root/src/.local; do - if [[ -d ${d} ]]; then - cp ${d}/bin/yq /usr/local/bin/ - mkdir -p ${d}/lib/"${PYTHON_BIN}"/site-packages/ - # shellcheck disable=SC2164 - pushd ${d}/lib/"${PYTHON_BIN}"/site-packages/ >/dev/null - cp -r PyYAML* xmltodict* yaml* yq* /usr/lib/"${PYTHON_BIN}"/site-packages/ - # shellcheck disable=SC2164 - popd >/dev/null - fi - done - chmod -c +x /usr/local/bin/* -else - /usr/bin/"${PYTHON_BIN}" -m pip install yq -fi -# test install worked -for d in python yq jq; do echo -n "$d: "; $d --version; done - -# for debugging only -# ${DNF} install -y util-linux && whereis python pip jq yq && python --version && jq --version && yq --version diff --git a/devspaces-devfileregistry/build/scripts/cache_projects.sh b/devspaces-devfileregistry/build/scripts/cache_projects.sh index 2f36bb1092..03819ec1a3 100755 --- a/devspaces-devfileregistry/build/scripts/cache_projects.sh +++ b/devspaces-devfileregistry/build/scripts/cache_projects.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018-2021 Red Hat, Inc. +# Copyright (c) 2018-2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -10,10 +10,11 @@ # Arguments # $1 - devfiles directory # $2 - resources directory, where project zips will be stored. +# $3 - optional cachito cache folder where projects are already cloned # # Only supports downloading projecst from GitHub. -set -e +set -ex # shellcheck disable=SC1091 source ./clone_and_zip.sh @@ -106,9 +107,14 @@ for devfile in "${devfiles[@]}"; do destination="${RESOURCES_DIR}/${devfile_name}-${project_name}-${branch}.zip" absolute_destination=$(realpath "$destination") # echo " Caching project to $absolute_destination" - echo " Caching project from $location/blob/${branch} to $destination" - clone_and_zip "$location" "$branch" "$absolute_destination" "$sparse_checkout_dir" - + echo "[cache_projects.sh] Checking $REMOTE_SOURCES_DIR/$project_name/app ... " + if [[ -d "REMOTE_SOURCES_DIR/$project_name/app/" ]]; then + echo " Caching project from REMOTE_SOURCES_DIR/$sparse_checkout_dir $location/blob/${branch} to $destination" + clone_and_zip "$location" "$branch" "$absolute_destination" "$sparse_checkout_dir" "REMOTE_SOURCES_DIR/$project_name/app/" + else + echo " Caching project from $location/blob/${branch} to $destination" + clone_and_zip "$location" "$branch" "$absolute_destination" "$sparse_checkout_dir" + fi echo " Updating devfile $devfile to point at cached project zip $destination" update_devfile "$devfile" "$project_name" "$destination" done diff --git a/devspaces-devfileregistry/build/scripts/clone_and_zip.sh b/devspaces-devfileregistry/build/scripts/clone_and_zip.sh index 3f58a30b4e..2803b84797 100755 --- a/devspaces-devfileregistry/build/scripts/clone_and_zip.sh +++ b/devspaces-devfileregistry/build/scripts/clone_and_zip.sh @@ -1,13 +1,13 @@ #!/bin/bash # -# Copyright (c) 2022 Red Hat, Inc. +# Copyright (c) 2022-2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 -set -e +set -ex TEMP_REPO=$(mktemp -d -u) @@ -17,20 +17,27 @@ TEMP_REPO=$(mktemp -d -u) # $2 - branch to archive # $3 - destination path for the archived project zip file # $4 - sparse checkout directory +# $5 - existing cloned sources dir, eg., REMOTE_SOURCES_DIR//app/ function clone_and_zip() { local repo="$1" local branch="$2" local destination="$3" local sparse_checkout_dir="$4" + # to support cachito mode, where sources are cloned for us aleady + local existing_clone_folder="$5" - git clone "$repo" -b "$branch" --depth 1 "$TEMP_REPO" -q - pushd "$TEMP_REPO" &>/dev/null - if [ -n "$sparse_checkout_dir" ]; then - echo " Using sparse checkout dir '$sparse_checkout_dir'" - git archive -9 "$branch" "$sparse_checkout_dir" -o "$destination" - else - git archive -9 "$branch" -o "$destination" - fi + if [[ -d "${existing_clone_folder}" ]]; then + pushd "${existing_clone_folder}" &>/dev/null + else + git clone "$repo" -b "$branch" --depth 1 "$TEMP_REPO" -q + pushd "$TEMP_REPO" &>/dev/null + fi + if [ -n "$sparse_checkout_dir" ]; then + echo " Using sparse checkout dir '$sparse_checkout_dir'" + git archive -9 "$branch" "$sparse_checkout_dir" -o "$destination" + else + git archive -9 "$branch" -o "$destination" + fi popd &>/dev/null rm -rf "$TEMP_REPO" } diff --git a/devspaces-devfileregistry/build/scripts/generate_devworkspace_templates.sh b/devspaces-devfileregistry/build/scripts/generate_devworkspace_templates.sh index e4761d72d9..6ea87d631e 100755 --- a/devspaces-devfileregistry/build/scripts/generate_devworkspace_templates.sh +++ b/devspaces-devfileregistry/build/scripts/generate_devworkspace_templates.sh @@ -14,18 +14,17 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck disable=SC1091 source "${script_dir}/clone_and_zip.sh" -if [[ -f VERSION ]]; then - VERSION=$(cat VERSION) -elif [[ -f ../VERSION ]]; then - VERSION=$(cat ../VERSION) -elif [[ -f ../../VERSION ]]; then - VERSION=$(cat ../../VERSION) +jobconfigjson=$(find . -name "job-config.json") +if [[ -f ${jobconfigjson} ]]; then + VERSION=$(yq -r '.Version' "$jobconfigjson") else VERSION="$1" fi if [[ -z $VERSION ]]; then - echo "Error: could not find VERSION, ../VERSION, or ../../VERSION file; set version on commandline, eg., $0 3.y" + echo "Error: could not find job-config.json, ../job-config.json, or ../../job-config.json file; set version on commandline, eg., $0 3.y" exit 1 +else + echo "Generating devworkspace templates for DS $VERSION ... " fi arch="$(uname -m)" @@ -70,6 +69,11 @@ do --output-file:"${dir}"/devworkspace-che-idea-latest.yaml \ --project."${project}" - clone_and_zip "${devfile_repo}" "${devfile_url##*/}" "$(pwd)/resources/v2/$name.zip" + echo "[generate_devworkspace-templates.sh] Checking $REMOTE_SOURCES_DIR/$name/app ... " + if [[ -d "$REMOTE_SOURCES_DIR/$name/app/" ]]; then # reuse cachito sources + clone_and_zip "${devfile_repo}" "${devfile_url##*/}" "$(pwd)/resources/v2/$name.zip" "" "$REMOTE_SOURCES_DIR/$name/app/" + else + clone_and_zip "${devfile_repo}" "${devfile_url##*/}" "$(pwd)/resources/v2/$name.zip" "" + fi fi done diff --git a/devspaces-devfileregistry/build/scripts/sync.sh b/devspaces-devfileregistry/build/scripts/sync.sh index 3fb23765ac..b9811f2bd6 100755 --- a/devspaces-devfileregistry/build/scripts/sync.sh +++ b/devspaces-devfileregistry/build/scripts/sync.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2021-22 Red Hat, Inc. +# Copyright (c) 2021-2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -47,6 +47,35 @@ while [[ "$#" -gt 0 ]]; do shift 1 done +# to support cachito for sample project sources, generate updates to container.yaml +updateContainerYaml() { +# 1. trim everything after the insertion point +sed -i '/append devspaces-sample project sources here/q' "${TARGETDIR}"/container.yaml + +# 2. insert a remote_source for each devspaces-samples github project +REPOS=$(cat "${TARGETDIR}"/devfiles/*/meta.yaml | yq -r '.links.v2') +for repo_and_branch in $REPOS; do + # get repo URL + repo=${repo_and_branch%%/tree/*} + # get repo name + repo_name=${repo##*/} + # get branch; convert branch into SHA + branch=${repo_and_branch##*/tree/} + tmp_clone_dir="REMOTE_SOURCES_DIR/$repo_name/app/"; mkdir -p "$tmp_clone_dir" + git clone -q --depth 1 -b "$branch" "$repo" "$tmp_clone_dir" + pushd "$tmp_clone_dir" >/dev/null + ref=$(git rev-parse "origin/$branch") + popd >/dev/null + # rm -fr "$tmp_clone_dir" + echo " remote_source: $repo_name: $repo @ $branch ($ref)" + echo "- name: $repo_name + remote_source: + repo: ${repo}.git + ref: $ref +" >> "${TARGETDIR}"/container.yaml +done +} + if [ "${CSV_VERSION}" == "3.y.0" ]; then usage; fi # try to compute branches from currently checked out branch; else fall back to hard coded value for where to find @@ -110,8 +139,6 @@ sed "${TARGETDIR}/build/dockerfiles/Dockerfile" --regexp-extended \ `# Set arg options: disable BOOTSTRAP; update DS_BRANCH to correct value` \ -e 's|ARG BOOTSTRAP=.*|ARG BOOTSTRAP=false|' \ -e "s|ARG DS_BRANCH=.*|ARG DS_BRANCH=${DS_BRANCH}|" \ - `# Enable offline build - copy in built binaries` \ - -e 's|# (COPY root-local.tgz)|\1|' \ `# only enable rhel8 here -- don't want centos or epel ` \ -e 's|^ *(COPY .*)/content_set.*repo (.+)|\1/content_sets_rhel8.repo \2|' \ `# Comment out PATCHED_* args from build and disable update_devfile_patched_image_tags.sh` \ @@ -148,33 +175,8 @@ LABEL summary="\$SUMMARY" \\ EOT echo "Converted Dockerfile" -# header to reattach to yaml files after yq transform removes it -COPYRIGHT="# -# Copyright (c) 2021 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -" - -replaceField() -{ - theFile="$1" - updateName="$2" - updateVal="$3" - echo "[INFO] ${0##*/} :: * ${updateName}: ${updateVal}" - # shellcheck disable=SC2016 disable=SC2086 - changed=$(yq -Y --arg updateName "${updateName}" --arg updateVal "${updateVal}" ${updateName}' = $updateVal' "${theFile}") - echo "${COPYRIGHT}${changed}" > "${theFile}" -} +# add sample projects into container.yaml +updateContainerYaml pushd "${TARGETDIR}" >/dev/null || exit 1 - -# TODO transform che-theia references to DS theia references, including: -# description, icon, attributes.version, attributes.title, attributes.repository - popd >/dev/null || exit diff --git a/devspaces-devfileregistry/container.yaml b/devspaces-devfileregistry/container.yaml index 9f2c51713d..8ec480e31c 100644 --- a/devspaces-devfileregistry/container.yaml +++ b/devspaces-devfileregistry/container.yaml @@ -1,9 +1,8 @@ --- platforms: # all these keys are optional - see https://osbs.readthedocs.io/en/latest/users.html#image-configuration for more info - only: - - x86_64 # can be a list (as here) or a string (as below) + - x86_64 - s390x - ppc64le @@ -14,3 +13,72 @@ compose: # instead of docker_api, use imagebuilder for multistage builds image_build_method: imagebuilder +remote_sources: + +# include pip requirements (yq) so they can be resolved by Cachito and installed via Dockerfile +- name: python-deps + remote_source: + repo: https://github.com/redhat-developer/devspaces-images.git + ref: 1034d1d5c1cee536528926dbcb99d24025bed02a + pkg_managers: + - pip + packages: {"pip": [{"path": "devspaces-devfileregistry/build/python", "requirements_build_files": ["requirements-build.txt"]}]} + +# build https://www.npmjs.com/package/@eclipse-che/plugin-registry-generator from source +# TODO make sure we get the latest ref for the correct branch +- name: plugin-registry-generator + remote_source: + repo: https://github.com/eclipse-che/che-plugin-registry.git + ref: 10beff025b30da1d97663d0aae155d31ce5902ef + pkg_managers: + - yarn + packages: + yarn: + - path: tools/build + +# append devspaces-sample project sources here +- name: lombok-project-sample + remote_source: + repo: https://github.com/devspaces-samples/lombok-project-sample.git + ref: aeefc0f08394d65d9c2029b82385d8df3fab0a26 + +- name: quarkus-quickstarts + remote_source: + repo: https://github.com/devspaces-samples/quarkus-quickstarts.git + ref: fd0b7dec303f4d44206669a334e1e696d6c8e553 + +- name: nodejs-mongodb-sample + remote_source: + repo: https://github.com/devspaces-samples/nodejs-mongodb-sample.git + ref: 6ac26f24a20892b7923c12f150751df7281ed0ab + +- name: web-nodejs-sample + remote_source: + repo: https://github.com/devspaces-samples/web-nodejs-sample.git + ref: 9af9228bdab7354a73673d43fbe4e4cf8822e785 + +- name: python-hello-world + remote_source: + repo: https://github.com/devspaces-samples/python-hello-world.git + ref: 98ca3f8d9c44c666b915d008a2b87c285d14c4c7 + +- name: c-plus-plus + remote_source: + repo: https://github.com/devspaces-samples/c-plus-plus.git + ref: b514440e60045e347671f35e672f1ec97b1afe69 + +- name: dotnet-web-simple + remote_source: + repo: https://github.com/devspaces-samples/dotnet-web-simple.git + ref: 57104e5757a5301cd552e74058d858c7aeef8dcc + +- name: golang-health-check + remote_source: + repo: https://github.com/devspaces-samples/golang-health-check.git + ref: 52d9ae37fd7ca34caf7cf626ef126d66d9cef407 + +- name: php-hello-world + remote_source: + repo: https://github.com/devspaces-samples/php-hello-world.git + ref: dcad8d690cd86fb7ae057de7b492a75a1131cbb7 + diff --git a/devspaces-devfileregistry/get-sources.sh b/devspaces-devfileregistry/get-sources.sh index cef8ef29d1..336eb207e0 100755 --- a/devspaces-devfileregistry/get-sources.sh +++ b/devspaces-devfileregistry/get-sources.sh @@ -70,34 +70,11 @@ if [[ ${PULL_ASSETS} -eq 1 ]]; then echo "<======= END BOOTSTRAP BUILD =======" rm VERSION # update tarballs - step 2 - check old sources' tarballs - TARGZs="root-local.tgz resources.tgz" + TARGZs="resources.tgz" git rm -f $TARGZs 2>/dev/null || rm -f $TARGZs || true rhpkg sources || true # update tarballs - step 3 - create new tarballs - # NOTE: CRW-1610 used to be in /root/.local but now can be found in /opt/app-root/src/.local - tmpDir="$(mktemp -d)" - ${BUILDER} run --rm -v \ - ${tmpDir}/:/tmp/root-local/ ${tmpContainer} /bin/bash \ - -c 'cd /opt/app-root/src/.local/ && cp -r bin/ lib/ /tmp/root-local/' - MYUID=$(id -u); MYGID=$(id -g); sudo chown -R $MYUID:$MYGID $tmpDir - # check diff - if [[ -f root-local.tgz ]]; then - BEFORE_DIR="$(mktemp -d)" - tar xzf root-local.tgz -C ${BEFORE_DIR} - TAR_DIFF=$(diff --suppress-common-lines -u -r ${BEFORE_DIR} ${tmpDir} -x "*.pyc" -x "installed-files.txt") || true - sudo rm -fr ${BEFORE_DIR} - else - TAR_DIFF="No such file root-local.tgz -- could not fetch from 'rhpkg sources'" - fi - if [[ ${TAR_DIFF} ]]; then - echo "DIFF START *****" - echo "${TAR_DIFF}" - echo "***** END DIFF" - pushd ${tmpDir} >/dev/null && tar czf root-local.tgz lib/ bin/ && popd >/dev/null && mv -f ${tmpDir}/root-local.tgz . - fi - sudo rm -fr ${tmpDir} - # check if existing resources.tgz is different tmpDir=$(mktemp -d) ${BUILDER} run --rm -v ${tmpDir}/:/tmp/resources/ --entrypoint /bin/bash ${tmpContainer} -c \ diff --git a/devspaces-devfileregistry/get-sources.sh.log.txt b/devspaces-devfileregistry/get-sources.sh.log.txt deleted file mode 100644 index f63a4eee8a..0000000000 --- a/devspaces-devfileregistry/get-sources.sh.log.txt +++ /dev/null @@ -1,255 +0,0 @@ -======= BOOTSTRAP DOCKERFILE =======> -# -# Copyright (c) 2018-2023 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# IBM Corporation - implementation -# - -# Builder: check meta.yamls and create index.json -# https://registry.access.redhat.com/ubi8/python-38 -FROM registry.access.redhat.com/ubi8/python-38:1-121 as builder -#FROM registry-proxy.engineering.redhat.com/ubi8/python-38:1 as builder -USER 0 - -ARG BOOTSTRAP=true -ENV BOOTSTRAP=${BOOTSTRAP} -# if not defined or string is null, allow all registries/tags in list_referenced_images -# otherwise restrict to only those space-separated registries/tags; if others found, build will fail -# useful for failing build if quay images in an RC, or wrong devspaces image tag (3.2 in 3.1 build) -ARG ALLOWED_REGISTRIES="" -ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} -ARG ALLOWED_TAGS="" -ENV ALLOWED_TAGS=${ALLOWED_TAGS} - -COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ -COPY ./build/dockerfiles/rhel.install.sh /tmp -RUN /tmp/rhel.install.sh && rm -f /tmp/rhel.install.sh - -COPY ./build/scripts ./versions.json /build/ -COPY ./build/scripts/clone_and_zip.sh /build/build/scripts/ -COPY ./VERSION / -COPY ./devfiles /build/devfiles -WORKDIR /build/ - -RUN ./generate_devworkspace_templates.sh -RUN chmod -R g+rwX /build/resources - -# validate devfile content -RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" -RUN ./check_mandatory_fields.sh devfiles - -# Cache projects in DS -COPY ./build/dockerfiles/rhel.cache_projects.sh /tmp/ -RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz - -# don't do swaps, or we end up with missing content if built on s390x or ppc64le worker -# RUN ./swap_yamlfiles.sh devfiles -# RUN ./swap_images.sh devfiles -RUN ./index.sh > /build/devfiles/index.json && \ - ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && \ - ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && \ - chmod -R g+rwX /build/devfiles - -<======= BOOTSTRAP DOCKERFILE ======= -======= START BOOTSTRAP BUILD =======> -STEP 1/23: FROM registry.access.redhat.com/ubi8/python-38:1-121 AS builder -STEP 2/23: USER 0 ---> d1ca1e00519 -STEP 3/23: ARG BOOTSTRAP=true ---> a39d3989975 -STEP 4/23: ENV BOOTSTRAP=${BOOTSTRAP} ---> f9b1f0e6a89 -STEP 5/23: ARG ALLOWED_REGISTRIES="" ---> f8ced932c71 -STEP 6/23: ENV ALLOWED_REGISTRIES=${ALLOWED_REGISTRIES} ---> d2b4aec2989 -STEP 7/23: ARG ALLOWED_TAGS="" ---> 7e53da0c7eb -STEP 8/23: ENV ALLOWED_TAGS=${ALLOWED_TAGS} ---> 2f8834edd41 -STEP 9/23: COPY ./build/dockerfiles/content_sets_rhel8.repo /etc/yum.repos.d/ ---> a8ce31fc07c -STEP 10/23: COPY ./build/dockerfiles/rhel.install.sh /tmp ---> 48d90bbc262 -STEP 11/23: RUN /tmp/rhel.install.sh && rm -f /tmp/rhel.install.sh - -Installed: - containers-common-2:1-46.module+el8.7.0+17824+66a0202b.ppc64le - criu-3.15-3.module+el8.7.0+17824+66a0202b.ppc64le - fuse-common-3.3.0-16.el8.ppc64le - fuse-overlayfs-1.9-1.module+el8.7.0+17824+66a0202b.ppc64le - fuse3-3.3.0-16.el8.ppc64le - fuse3-libs-3.3.0-16.el8.ppc64le - iptables-libs-1.8.4-23.el8_7.1.ppc64le - jansson-2.14-1.el8.ppc64le - jq-1.6-3.el8.ppc64le - kmod-25-19.el8.ppc64le - libibverbs-41.0-1.el8.ppc64le - libmnl-1.0.4-6.el8.ppc64le - libnet-1.1.6-15.el8.ppc64le - libnftnl-1.1.5-5.el8.ppc64le - libpcap-14:1.9.1-5.el8.ppc64le - libslirp-4.4.0-1.module+el8.7.0+17824+66a0202b.ppc64le - nftables-1:0.9.3-26.el8.ppc64le - oniguruma-6.8.2-2.el8.ppc64le - protobuf-c-1.3.0-6.el8.ppc64le - runc-1:1.1.4-1.module+el8.7.0+17824+66a0202b.ppc64le - skopeo-2:1.9.4-0.1.module+el8.7.0+17824+66a0202b.ppc64le - slirp4netns-1.2.0-2.module+el8.7.0+17824+66a0202b.ppc64le - -Collecting yq - Downloading https://files.pythonhosted.org/packages/aa/09/31d9eb047a46cf5680c4970f42bee931bd78aab4e3ded448406de4730f96/yq-3.1.1-py3-none-any.whl -Collecting argcomplete - Downloading https://files.pythonhosted.org/packages/d3/e5/c5509683462e51b070df9e83e7f72c1ccfe3f733f328b4a0f06804c27278/argcomplete-2.0.0-py2.py3-none-any.whl -Collecting toml>=0.10.0 - Downloading https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl -Collecting xmltodict>=0.11.0 - Downloading https://files.pythonhosted.org/packages/94/db/fd0326e331726f07ff7f40675cd86aa804bfd2e5016c727fa761c934990e/xmltodict-0.13.0-py2.py3-none-any.whl -Collecting PyYAML>=5.3.1 - Downloading https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz (124kB) - Installing build dependencies: started - Installing build dependencies: finished with status 'done' - Getting requirements to build wheel: started - Getting requirements to build wheel: finished with status 'done' - Preparing wheel metadata: started - Preparing wheel metadata: finished with status 'done' -Building wheels for collected packages: PyYAML - Building wheel for PyYAML (PEP 517): started - Building wheel for PyYAML (PEP 517): finished with status 'done' - Created wheel for PyYAML: filename=PyYAML-6.0-cp38-cp38-linux_ppc64le.whl size=45333 sha256=5a88624e31796d882f6668e4ff58c252c4a14a3cfbb787c97d3b1b475dda7239 - Stored in directory: /tmp/pip-ephem-wheel-cache-vgghhg9t/wheels/95/84/67/ebeac632c63797cfbeb90128ca41073117721540dad526d213 -Successfully built PyYAML -Installing collected packages: toml, xmltodict, PyYAML, argcomplete, yq -Successfully installed PyYAML-6.0 argcomplete-2.0.0 toml-0.10.2 xmltodict-0.13.0 yq-3.1.1 -python: Python 3.8.13 -yq: yq 3.1.1 -jq: jq-1.6 ---> e5fe042e1b1 -STEP 12/23: COPY ./build/scripts ./versions.json /build/ ---> c08de978ff0 -STEP 13/23: COPY ./build/scripts/clone_and_zip.sh /build/build/scripts/ ---> 6222141bc1f -STEP 14/23: COPY ./VERSION / ---> 7699615ec7c -STEP 15/23: COPY ./devfiles /build/devfiles ---> 2c7102408dc -STEP 16/23: WORKDIR /build/ ---> c5438ce371d -STEP 17/23: RUN ./generate_devworkspace_templates.sh - -> core-js@2.6.12 postinstall /build/node_modules/core-js -> node -e "try{require('./postinstall')}catch(e){}" - -Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! - -The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:  -> https://opencollective.com/core-js  -> https://www.patreon.com/zloirock  - -Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) - -+ @eclipse-che/che-devworkspace-generator@0.0.1-c8bd5c0 -added 119 packages from 183 contributors and audited 119 packages in 10.366s - -5 packages are looking for funding - run `npm fund` for details - -found 1 high severity vulnerability - run `npm audit fix` to fix them, or `npm audit` for details -DevWorkspace che-theia-java-lombok was generated. -DevWorkspace che-code-java-lombok was generated. -DevWorkspace che-idea-java-lombok was generated. -DevWorkspace che-theia-quarkus-quickstart was generated. -DevWorkspace che-code-quarkus-quickstart was generated. -DevWorkspace che-idea-quarkus-quickstart was generated. -DevWorkspace che-theia-nodejs-mongodb was generated. -DevWorkspace che-code-nodejs-mongodb was generated. -DevWorkspace che-idea-nodejs-mongodb was generated. -DevWorkspace che-theia-nodejs-web-app was generated. -DevWorkspace che-code-nodejs-web-app was generated. -DevWorkspace che-idea-nodejs-web-app was generated. -DevWorkspace che-theia-python-hello-world was generated. -DevWorkspace che-code-python-hello-world was generated. -DevWorkspace che-idea-python-hello-world was generated. -DevWorkspace che-theia-cpp was generated. -DevWorkspace che-code-cpp was generated. -DevWorkspace che-idea-cpp was generated. -DevWorkspace che-theia-dotnet was generated. -DevWorkspace che-code-dotnet was generated. -DevWorkspace che-idea-dotnet was generated. -DevWorkspace che-theia-golang was generated. -DevWorkspace che-code-golang was generated. -DevWorkspace che-idea-golang was generated. -DevWorkspace che-theia-php-hello-world was generated. -DevWorkspace che-code-php-hello-world was generated. -DevWorkspace che-idea-php-hello-world was generated. ---> f96624feb93 -STEP 18/23: RUN chmod -R g+rwX /build/resources ---> 8d973a31970 -STEP 19/23: RUN ./check_referenced_images.sh devfiles --registries "${ALLOWED_REGISTRIES}" --tags "${ALLOWED_TAGS}" - + registry.redhat.io/devspaces/code-rhel8:3.6 PASS - 3.6 allowed - + registry.redhat.io/devspaces/idea-rhel8:3.6 PASS - 3.6 allowed - + registry.redhat.io/devspaces/machineexec-rhel8:3.6 PASS - 3.6 allowed - + registry.redhat.io/devspaces/theia-endpoint-rhel8:3.6 PASS - 3.6 allowed - + registry.redhat.io/devspaces/theia-rhel8:3.6 PASS - 3.6 allowed - + registry.redhat.io/devspaces/udi-rhel8:3.6 PASS - 3.6 allowed - = registry.redhat.io/rhscl/mongodb-36-rhel7:1-50 PASS ---> 4234904b90b -STEP 20/23: RUN ./check_mandatory_fields.sh devfiles -Checking devfile 'devfiles/TP__cpp__c-plus-plus/meta.yaml' -Checking devfile 'devfiles/TP__dotnet__dotnet-web-simple/meta.yaml' -Checking devfile 'devfiles/TP__go__golang-health-check/meta.yaml' -Checking devfile 'devfiles/TP__php__php-hello-world/meta.yaml' -Checking devfile 'devfiles/java11-maven-lombok__lombok-project-sample/meta.yaml' -Checking devfile 'devfiles/java11-maven-quarkus__quarkus-quickstarts/meta.yaml' -Checking devfile 'devfiles/nodejs__nodejs-mongodb-sample/meta.yaml' -Checking devfile 'devfiles/nodejs__web-nodejs-sample/meta.yaml' -Checking devfile 'devfiles/python__python-hello-world/meta.yaml' ---> 9b2807c0086 -STEP 21/23: COPY ./build/dockerfiles/rhel.cache_projects.sh /tmp/ ---> ba780180f44 -STEP 22/23: RUN /tmp/rhel.cache_projects.sh /build/ && rm -rf /tmp/rhel.cache_projects.sh /tmp/resources.tgz ---> 27bdcd66e6d -STEP 23/23: RUN ./index.sh > /build/devfiles/index.json && ./list_referenced_images.sh devfiles > /build/devfiles/external_images.txt && ./list_referenced_images_by_file.sh devfiles > /build/devfiles/external_images_by_devfile.txt && chmod -R g+rwX /build/devfiles -COMMIT devfileregistry:tmp ---> 4132787325d -Successfully tagged localhost/devfileregistry:tmp -4132787325d00a0ce8c1ca9d89eded18c70e79ca416c4c433d528e139321ebe8 -<======= END BOOTSTRAP BUILD ======= -Downloading root-local.tgz -Downloading resources.tgz -Untagged: localhost/devfileregistry:tmp -Deleted: 4132787325d00a0ce8c1ca9d89eded18c70e79ca416c4c433d528e139321ebe8 -Deleted: 27bdcd66e6dd5566f760761855ae0aa27bf95b102afc9dbd0aec2c049a867bb3 -Deleted: ba780180f448b02facb5e2e467d1ff8edf04e07fc07bc21d64f1625d4ab8eec2 -Deleted: 9b2807c0086968f94526541450be6e6eb6a9aa8cd3d5c69d06908848a2b84b14 -Deleted: 4234904b90b542796f9347274f829b44f2321ec971adf1b3aaa4626b319dd073 -Deleted: 8d973a31970d3b72a34ad190a04995431eadd4139ffd6d3249034af82b67b312 -Deleted: f96624feb93dbe6311fccbc768796d289301e750d1048a52b315ef9d8776977a -Deleted: c5438ce371d19074a70dae3ce9134bfd05fc18384f62cdaa78561d0daae060e0 -Deleted: 2c7102408dc735bc8fa7117e6f0fdca24d92e2ac5fe48c03bab79a54ed906b05 -Deleted: 7699615ec7c8b60089ca60627b1f4d41adc48e135501d3d2e444e1f9ec88e0d0 -Deleted: 6222141bc1f234041b8594371519c919be5755cff5f985d968dd98f3272fa832 -Deleted: c08de978ff06d12ce740735f9876af591f9da2c1b999c8bfb36cc745992db64d -Deleted: e5fe042e1b1789cab0b755dece5a0c99cddcf40eb05594c584be6de70959bc2a -Deleted: 48d90bbc262513ee14747fa590628b62d304303c0e5a09873921ab30a2b8eeb5 -Deleted: a8ce31fc07c66b2b1fbed447a27fbd01dfbbf94c438e0a2d6e0d2059b287d6e5 -Deleted: 2f8834edd41db7f951e90d3a32e4022ef5bd8cfec682e1428104771b2ed1aa1c -Deleted: 7e53da0c7eb20c92245a2477bdea9396eb403ef223f3910e11a8295de27e60c2 -Deleted: d2b4aec298907a43e643120a35375e147359e4f8e616b04565e67a835c73f9b4 -Deleted: f8ced932c71b8928a5f697d8f421e1b473b61a3b5f5ea4804cf30d5266c47721 -Deleted: f9b1f0e6a892197e5316d25111cd496fb6abd0aa2fdb3001c80b84a9c3b87e7f -Deleted: a39d3989975ff8524f5ce2e5be53e4e1f7d35c3c01826d469d4afe0b749a6ee2 -Deleted: d1ca1e005194c4173c11ea99f53e8e8471d945e644ad6a12d7dc5f834c4c53bd -File already uploaded: root-local.tgz -File already uploaded: resources.tgz -All sources were already uploaded. -rm 'resources.tgz' -rm 'root-local.tgz' diff --git a/devspaces-devfileregistry/job-config.json b/devspaces-devfileregistry/job-config.json index 6a7dc70af0..ed3a79a9d2 100644 --- a/devspaces-devfileregistry/job-config.json +++ b/devspaces-devfileregistry/job-config.json @@ -809,7 +809,7 @@ }, "3.5": { "CSV_VERSION": "3.5.0", - "CSV_VERSION_PREV": "3.4.0-0.1675914643.p" + "CSV_VERSION_PREV": "3.4.0" }, "3.6": { "CSV_VERSION": "3.6.0", diff --git a/devspaces-devfileregistry/sources b/devspaces-devfileregistry/sources index 3b0610675c..81ff57d1bf 100644 --- a/devspaces-devfileregistry/sources +++ b/devspaces-devfileregistry/sources @@ -1,2 +1 @@ -SHA512 (root-local.tgz) = f49573b7907da383d0389f8932de28cad5b92d8a6dcf7950d08610c6e265733ae1e0baa93bb3f5c28d98613ea648cc8552b016699662e843c88dbd7071a55df5 SHA512 (resources.tgz) = 650b0a03230d74b008d2b9fbc40388f009075af0f5bca8d34bd359863cca859fc2a58dd4c3a8d62c482c1c733c6a980b9c528f2d14d3ace67f457053486303d3