From 4fcb704f4f5dc49ae261fa8184e74d14159da9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 29 Jun 2022 16:37:52 +0200 Subject: [PATCH 1/3] ci-operator/openshift/os: 4.11: Remove unused periodic jobs --- .../os/openshift-os-release-4.11.yaml | 75 ------------------- .../openshift-os-release-4.11-periodics.yaml | 63 ---------------- 2 files changed, 138 deletions(-) delete mode 100644 ci-operator/jobs/openshift/os/openshift-os-release-4.11-periodics.yaml diff --git a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml index d77372dff1dde..d287e9cbc0f18 100644 --- a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml +++ b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml @@ -54,13 +54,6 @@ resources: cpu: 1000m devices.kubevirt.io/kvm: "1" memory: 3Gi - periodic-os-build: - limits: - devices.kubevirt.io/kvm: "1" - requests: - cpu: 1000m - devices.kubevirt.io/kvm: "1" - memory: 3Gi tests: - as: validate commands: ./ci/validate.sh @@ -72,74 +65,6 @@ tests: container: from: build-test-qemu-img skip_if_only_changed: ^docs/|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ -- as: periodic-os-build - cluster: build02 - cron: '@daily' - steps: - test: - - as: oc-login - cli: latest - commands: | - #!/bin/bash - set -euo pipefail - # To inject the oc CLI, ci-operator builds a new container from the - # provided container dependency (from:) and pushes it to the namespace - # Imagestream before creating a new pod to run the commands in. Because - # of the size of the coreos-assembler image, this adds quite some time - # to the process. So lets use a much smaller Fedora base image. - oc login https://api.ci.l2s4.p1.openshiftapps.com:6443 --token="$(cat /service-account-token/image-pusher-service-account-token)" - oc registry login --registry=registry.ci.openshift.org --to="$SHARED_DIR/dockercfg.json" - credentials: - - mount_path: /service-account-token - name: rhcos-devel-image-pusher-service-account-token - namespace: test-credentials - from: fedora - resources: - limits: - devices.kubevirt.io/kvm: "1" - requests: - cpu: 1000m - devices.kubevirt.io/kvm: "1" - memory: 3Gi - - as: build-test-and-push-img - commands: | - #!/bin/bash - set -xeuo pipefail - - # We can't use PULL_BASE_REF or OPENSHIFT_BUILD_REFERENCE to get the - # branch since this is a periodic job which originates from - # openshift/release, not the openshift/os repository. We then strip - # release- from the branch name so we're left with the number (e.g., - # release-4.11 -> 4.11). - BRANCH="$(echo "$JOB_SPEC" | jq -r '.extra_refs[0].base_ref | sub("release-"; "")')" - - # Ensure we have a known directory for cosa to build in - export COSA_DIR="/tmp/cosa" - mkdir -p "$COSA_DIR" - - # Run the cosa build / test - /src/ci/build-test-qemu.sh - - export REGISTRY_AUTH_FILE="$SHARED_DIR/dockercfg.json" - # Ensure we're in the designated cosa directory so the push-container commands work - cd "$COSA_DIR" - # Tags with the cosa build ID / arch - cosa push-container registry.ci.openshift.org/rhcos-devel/rhel-coreos - cosa push-container "registry.ci.openshift.org/rhcos-devel/rhel-coreos:${BRANCH}" - - # Only push latest tag on master branch - if [[ "$BRANCH" == "master" ]]; then - cosa push-container registry.ci.openshift.org/rhcos-devel/rhel-coreos:latest - fi - from: build-test-qemu-img - resources: - limits: - devices.kubevirt.io/kvm: "1" - requests: - cpu: 1000m - devices.kubevirt.io/kvm: "1" - memory: 3Gi - timeout: 3h0m0s zz_generated_metadata: branch: release-4.11 org: openshift diff --git a/ci-operator/jobs/openshift/os/openshift-os-release-4.11-periodics.yaml b/ci-operator/jobs/openshift/os/openshift-os-release-4.11-periodics.yaml deleted file mode 100644 index 3c58429969f87..0000000000000 --- a/ci-operator/jobs/openshift/os/openshift-os-release-4.11-periodics.yaml +++ /dev/null @@ -1,63 +0,0 @@ -periodics: -- agent: kubernetes - cluster: build02 - cron: 22 2 * * * - decorate: true - decoration_config: - skip_cloning: true - extra_refs: - - base_ref: release-4.11 - org: openshift - repo: os - labels: - ci-operator.openshift.io/cluster: build02 - ci.openshift.io/generator: prowgen - pj-rehearse.openshift.io/can-be-rehearsed: "true" - name: periodic-ci-openshift-os-release-4.11-periodic-os-build - reporter_config: - slack: - channel: '#jenkins-coreos' - job_states_to_report: - - failure - report_template: ':warning: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. - <{{.Status.URL}}|View logs> :warning:' - spec: - containers: - - args: - - --gcs-upload-secret=/secrets/gcs/service-account.json - - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson - - --report-credentials-file=/etc/report/credentials - - --secret-dir=/secrets/ci-pull-credentials - - --target=periodic-os-build - command: - - ci-operator - image: ci-operator:latest - imagePullPolicy: Always - name: "" - resources: - requests: - cpu: 10m - volumeMounts: - - mountPath: /secrets/ci-pull-credentials - name: ci-pull-credentials - readOnly: true - - mountPath: /secrets/gcs - name: gcs-credentials - readOnly: true - - mountPath: /etc/pull-secret - name: pull-secret - readOnly: true - - mountPath: /etc/report - name: result-aggregator - readOnly: true - serviceAccountName: ci-operator - volumes: - - name: ci-pull-credentials - secret: - secretName: ci-pull-credentials - - name: pull-secret - secret: - secretName: registry-pull-credentials - - name: result-aggregator - secret: - secretName: result-aggregator From 6ce8b801b893814fb5ad765dcc69e42dd6c5069f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 29 Jun 2022 16:36:04 +0200 Subject: [PATCH 2/3] ci-operator/openshift/os: 4.11: Use 4.11 COSA & inline Dockerfile --- .../os/openshift-os-release-4.11.yaml | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml index d287e9cbc0f18..97cd426de5e4f 100644 --- a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml +++ b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml @@ -1,8 +1,8 @@ base_images: - coreos_coreos-assembler_latest: + coreos_coreos-assembler_4.11: name: coreos-assembler namespace: coreos - tag: latest + tag: "4.11" fedora: name: fedora namespace: coreos @@ -17,11 +17,30 @@ build_root: namespace: coreos tag: testing-devel images: -- dockerfile_path: ci/Dockerfile +- dockerfile_literal: | + # COSA + source code + FROM registry.svc.ci.openshift.org/coreos/coreos-assembler:4.11 + WORKDIR /src + # Tell the build scripts that we have setup a directory for unprivileged build + ENV COSA_DIR=/tmp/cosa + RUN mkdir -p "${COSA_DIR}" + # Prow doesn't support emptydir for jobs today + ENV COSA_SKIP_OVERLAY=1 + # Copy the source code + COPY . . + # We need to make sure that root can read / write to the COSA_DIR so that + # when this container is actually run, we have permissions to read and + # write to the COSA_DIR to allow the Kola tests to run. + USER root + RUN chgrp -Rf root "${COSA_DIR}" && \ + chmod -Rf g+w "${COSA_DIR}" + # Go back to unprivileged user for COSA + USER builder + WORKDIR /tmp/cosa inputs: - coreos_coreos-assembler_latest: + coreos_coreos-assembler_4.11: as: - - registry.svc.ci.openshift.org/coreos/coreos-assembler:latest + - registry.svc.ci.openshift.org/coreos/coreos-assembler:4.11 ocp_builder_rhel-8-golang-1.17-openshift-4.10: as: - registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.17-openshift-4.10 From ede4c656e3ab3db5dbc324837a9507176ee38fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 29 Jun 2022 16:36:51 +0200 Subject: [PATCH 3/3] ci-operator/openshift/os: 4.11: Remove unused images --- .../openshift/os/openshift-os-release-4.11.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml index 97cd426de5e4f..dc66b126516df 100644 --- a/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml +++ b/ci-operator/config/openshift/os/openshift-os-release-4.11.yaml @@ -3,14 +3,6 @@ base_images: name: coreos-assembler namespace: coreos tag: "4.11" - fedora: - name: fedora - namespace: coreos - tag: "35" - ocp_builder_rhel-8-golang-1.17-openshift-4.10: - name: builder - namespace: ocp - tag: rhel-8-golang-1.17-openshift-4.10 build_root: image_stream_tag: name: fcos-buildroot @@ -41,9 +33,6 @@ images: coreos_coreos-assembler_4.11: as: - registry.svc.ci.openshift.org/coreos/coreos-assembler:4.11 - ocp_builder_rhel-8-golang-1.17-openshift-4.10: - as: - - registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.17-openshift-4.10 to: build-test-qemu-img promotion: disabled: true