k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/jobs/image-pushing/k8s-staging-e2e-test-images.sh (about)

     1  #!/usr/bin/env bash
     2  # Copyright 2020 The Kubernetes Authors.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  set -o errexit
    17  
    18  readonly OUTPUT="$(dirname $0)/k8s-staging-e2e-test-images.yaml"
    19  readonly IMAGES=(
    20      agnhost
    21      apparmor-loader
    22      busybox
    23      cuda-vector-add
    24      cuda-vector-add-old
    25      echoserver
    26      glusterdynamic-provisioner
    27      httpd
    28      httpd-new
    29      ipc-utils
    30      jessie-dnsutils
    31      kitten
    32      metadata-concealment
    33      nautilus
    34      nginx
    35      nginx-new
    36      node-perf/tf-wide-deep
    37      node-perf/npb-ep
    38      node-perf/npb-is
    39      nonewprivs
    40      nonroot
    41      perl
    42      pets/redis-installer
    43      pets/peer-finder
    44      pets/zookeeper-installer
    45      redis
    46      regression-issue-74839
    47      resource-consumer
    48      sample-apiserver
    49      sample-device-plugin
    50      volume/iscsi
    51      volume/rbd
    52      volume/nfs
    53      volume/gluster
    54      windows-servercore-cache
    55  )
    56  
    57  cat >"${OUTPUT}" <<EOF
    58  # Automatically generated by k8s-staging-e2e-test-images.sh.
    59  
    60  postsubmits:
    61    kubernetes/kubernetes:
    62  EOF
    63  
    64  for image in "${IMAGES[@]}"; do
    65      cat >>"${OUTPUT}" <<EOF
    66      - name: post-kubernetes-push-e2e-${image//\//-}-test-images
    67        rerun_auth_config:
    68          github_team_slugs:
    69            - org: kubernetes
    70              slug: release-managers
    71            - org: kubernetes
    72              slug: test-infra-admins
    73          github_users:
    74            - aojea
    75            - chewong
    76            - claudiubelu
    77            - mkumatag
    78        cluster: k8s-infra-prow-build-trusted
    79        annotations:
    80          testgrid-dashboards: sig-testing-images, sig-k8s-infra-gcb
    81        decorate: true
    82        # we only need to run if the test images have been changed.
    83        run_if_changed: '^test\/images\/${image//\//\\/}\/'
    84        branches:
    85          # TODO(releng): Remove once repo default branch has been renamed
    86          - ^master$
    87          - ^main$
    88        spec:
    89          serviceAccountName: gcb-builder
    90          containers:
    91            - image: gcr.io/k8s-staging-test-infra/image-builder:v20230711-e33377c2b4
    92              command:
    93                - /run.sh
    94              args:
    95                # this is the project GCB will run in, which is the same as the GCR
    96                # images are pushed to.
    97                - --project=k8s-staging-e2e-test-images
    98                # This is the same as above, but with -gcb appended.
    99                - --scratch-bucket=gs://k8s-staging-e2e-test-images-gcb
   100                - --env-passthrough=PULL_BASE_REF,PULL_BASE_SHA,WHAT
   101                - --build-dir=.
   102                - test/images
   103              env:
   104                # By default, the E2E test image's WHAT is all-conformance.
   105                # We override that with the ${image} image.
   106                - name: WHAT
   107                  value: "${image}"
   108  EOF
   109  done
   110  
   111  cat >>"${OUTPUT}" <<EOF
   112  
   113  periodics:
   114    # NOTE(claudiub): The base image for the Windows E2E test images is nanoserver.
   115    # In most cases, that is sufficient. But in some cases, we are missing some DLLs.
   116    # We can fetch those DLLs from Windows servercore images, but they are very large
   117    # (2GB compressed), while the DLLs are only a few megabytes in size. We can build
   118    # a monthly DLL cache image and use the cache instead.
   119    # For more info: https://github.com/kubernetes/kubernetes/pull/93889
   120    - name: kubernetes-e2e-windows-servercore-cache
   121      rerun_auth_config:
   122        github_team_slugs:
   123          - org: kubernetes
   124            slug: test-infra-admins
   125          - org: kubernetes
   126            slug: release-managers
   127        github_users:
   128          - aojea
   129          - chewong
   130          - claudiubelu
   131          - mkumatag
   132      # Since the servercore image is updated once per month, we only need to build this
   133      # cache once per month.
   134      interval: 744h
   135      cluster: k8s-infra-prow-build-trusted
   136      annotations:
   137        testgrid-dashboards: sig-testing-images, sig-k8s-infra-gcb
   138      decorate: true
   139      extra_refs:
   140        # This also becomes the current directory for run.sh and thus
   141        # the cloud image build.
   142        - org: kubernetes
   143          repo: kubernetes
   144          base_ref: master
   145      spec:
   146        serviceAccountName: gcb-builder
   147        containers:
   148          - image: gcr.io/k8s-staging-test-infra/image-builder:v20230711-e33377c2b4
   149            command:
   150              - /run.sh
   151            args:
   152              - --project=k8s-staging-e2e-test-images
   153              - --scratch-bucket=gs://k8s-staging-e2e-test-images-gcb
   154              - --env-passthrough=PULL_BASE_REF,PULL_BASE_SHA,WHAT
   155              - --build-dir=.
   156              - test/images
   157            env:
   158              # We need to emulate a pull job for the cloud build to work the same
   159              # way as it usually does.
   160              - name: PULL_BASE_REF
   161                value: master
   162              # By default, the E2E test image's WHAT is all-conformance. We override that with
   163              # the windows-servercore-cache image.
   164              - name: WHAT
   165                value: "windows-servercore-cache"
   166  EOF