diff --git a/test/extended/node/zstd_chunked.go b/test/extended/node/zstd_chunked.go index b6445a10a8f8..c632777b1a29 100644 --- a/test/extended/node/zstd_chunked.go +++ b/test/extended/node/zstd_chunked.go @@ -2,7 +2,6 @@ package node import ( "context" - "fmt" "time" g "github.com/onsi/ginkgo/v2" @@ -13,35 +12,19 @@ import ( e2epod "k8s.io/kubernetes/test/e2e/framework/pod" exutil "github.com/openshift/origin/test/extended/util" + "github.com/openshift/origin/test/extended/util/image" ) -var _ = g.Describe("[sig-builds][sig-node][Feature:Builds][apigroup:build.openshift.io] zstd:chunked Image", func() { +var _ = g.Describe("[sig-node] zstd:chunked Image", func() { defer g.GinkgoRecover() var ( - oc = exutil.NewCLI("zstd-chunked-image") - customBuildAdd = exutil.FixturePath("testdata", "node", "zstd-chunked") - customBuildFixture = exutil.FixturePath("testdata", "node", "zstd-chunked", "test-custom-build.yaml") + oc = exutil.NewCLI("zstd-chunked-image") ) g.It("should successfully run date command", func(ctx context.Context) { namespace := oc.Namespace() - g.By("creating custom builder image") - // Build with buildah with --compression-format zstd:chunked to ensure the image is compressed with zstd:chunked. - // https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/builds_using_buildconfig/custom-builds-buildah#builds-build-custom-builder-image_custom-builds-buildah - err := oc.Run("new-build").Args("--binary", "--strategy=docker", "--name=custom-builder-image").Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - br, _ := exutil.StartBuildAndWait(oc, "custom-builder-image", fmt.Sprintf("--from-dir=%s", customBuildAdd)) - br.AssertSuccess() - g.By("start custom build and build should complete") - err = oc.AsAdmin().Run("create").Args("-f", customBuildFixture).Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - err = oc.AsAdmin().Run("start-build").Args("sample-custom-build").Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), "sample-custom-build-1", nil, nil, nil) - o.Expect(err).NotTo(o.HaveOccurred()) - - // Define a pod that runs the date command using the zstd-chunked image + // Define a pod that runs the date command using a prebuilt zstd:chunked image pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "zstd-chunked-pod", @@ -52,14 +35,15 @@ var _ = g.Describe("[sig-builds][sig-node][Feature:Builds][apigroup:build.opensh Containers: []corev1.Container{ { Name: "zstd-chunked-container", - Image: fmt.Sprintf("image-registry.openshift-image-registry.svc:5000/%s/sample-custom:latest", namespace), + Image: image.LocationFor("quay.io/crio/zstd-chunked:1"), Command: []string{"date"}, }, }, }, } - g.By("Creating a pod") + g.By("Creating a pod with prebuilt zstd:chunked image") + var err error pod, err = oc.KubeClient().CoreV1().Pods(namespace).Create(context.Background(), pod, metav1.CreateOptions{}) o.Expect(err).NotTo(o.HaveOccurred()) diff --git a/test/extended/testdata/bindata.go b/test/extended/testdata/bindata.go index e022d3643a33..51d970e93c4f 100644 --- a/test/extended/testdata/bindata.go +++ b/test/extended/testdata/bindata.go @@ -455,10 +455,6 @@ // test/extended/testdata/node/nested_container/containers.conf // test/extended/testdata/node/nested_container/run_tests.sh // test/extended/testdata/node/nested_container/skip_tests.sh -// test/extended/testdata/node/zstd-chunked/Dockerfile -// test/extended/testdata/node/zstd-chunked/Dockerfile.sample -// test/extended/testdata/node/zstd-chunked/build.sh -// test/extended/testdata/node/zstd-chunked/test-custom-build.yaml // test/extended/testdata/node_tuning/nto-stalld.yaml // test/extended/testdata/oauthserver/cabundle-cm.yaml // test/extended/testdata/oauthserver/oauth-network.yaml @@ -50567,137 +50563,6 @@ func testExtendedTestdataNodeNested_containerSkip_testsSh() (*asset, error) { return a, nil } -var _testExtendedTestdataNodeZstdChunkedDockerfile = []byte(`FROM registry.redhat.io/rhel8/buildah:latest -# For simplicity, /tmp/build contains the inputs we’ll be building when we -# run this custom builder image. Normally the custom builder image would -# fetch this content from some location at build time. (e.g. via git clone). -ADD Dockerfile.sample /tmp/input/Dockerfile -ADD build.sh /usr/bin -RUN chmod a+x /usr/bin/build.sh -# /usr/build/build.sh contains the actual custom build logic that will be executed when -# this custom builder image is executed. -ENTRYPOINT ["/usr/bin/build.sh"] -`) - -func testExtendedTestdataNodeZstdChunkedDockerfileBytes() ([]byte, error) { - return _testExtendedTestdataNodeZstdChunkedDockerfile, nil -} - -func testExtendedTestdataNodeZstdChunkedDockerfile() (*asset, error) { - bytes, err := testExtendedTestdataNodeZstdChunkedDockerfileBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "test/extended/testdata/node/zstd-chunked/Dockerfile", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testExtendedTestdataNodeZstdChunkedDockerfileSample = []byte(`FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest -CMD ["date"] -`) - -func testExtendedTestdataNodeZstdChunkedDockerfileSampleBytes() ([]byte, error) { - return _testExtendedTestdataNodeZstdChunkedDockerfileSample, nil -} - -func testExtendedTestdataNodeZstdChunkedDockerfileSample() (*asset, error) { - bytes, err := testExtendedTestdataNodeZstdChunkedDockerfileSampleBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "test/extended/testdata/node/zstd-chunked/Dockerfile.sample", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testExtendedTestdataNodeZstdChunkedBuildSh = []byte(`#!/bin/sh - -set -euo pipefail - -# Note that in this case the build inputs are part of the custom builder image, but normally this -# would be retrieved from an external source. -cd /tmp/input -# OUTPUT_REGISTRY and OUTPUT_IMAGE are env variables provided by the custom -# build framework -TAG="${OUTPUT_REGISTRY}/${OUTPUT_IMAGE}" - -cp -R /var/run/configs/openshift.io/certs/certs.d/* /etc/containers/certs.d/ - -# buildah requires a slight modification to the push secret provided by the service account in order to use it for pushing the image -echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/pull/.dockercfg)}" > /tmp/.pull -echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/push/.dockercfg)}" > /tmp/.push - -# performs the build of the new image defined by Dockerfile.sample -buildah --authfile /tmp/.pull --storage-driver vfs bud --isolation chroot -t ${TAG} . -# push the new image to the target for the build -buildah --authfile /tmp/.push --storage-driver vfs push --compression-format zstd:chunked ${TAG} -`) - -func testExtendedTestdataNodeZstdChunkedBuildShBytes() ([]byte, error) { - return _testExtendedTestdataNodeZstdChunkedBuildSh, nil -} - -func testExtendedTestdataNodeZstdChunkedBuildSh() (*asset, error) { - bytes, err := testExtendedTestdataNodeZstdChunkedBuildShBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "test/extended/testdata/node/zstd-chunked/build.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testExtendedTestdataNodeZstdChunkedTestCustomBuildYaml = []byte(`kind: List -apiVersion: v1 -items: -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: sample-custom -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: sample-custom-build - labels: - name: sample-custom-build - annotations: - template.alpha.openshift.io/wait-for-ready: 'true' - spec: - strategy: - type: Custom - customStrategy: - env: - - name: "BUILD_LOGLEVEL" - value: "2" - forcePull: true - from: - kind: ImageStreamTag - name: custom-builder-image:latest - output: - to: - kind: ImageStreamTag - name: sample-custom:latest -`) - -func testExtendedTestdataNodeZstdChunkedTestCustomBuildYamlBytes() ([]byte, error) { - return _testExtendedTestdataNodeZstdChunkedTestCustomBuildYaml, nil -} - -func testExtendedTestdataNodeZstdChunkedTestCustomBuildYaml() (*asset, error) { - bytes, err := testExtendedTestdataNodeZstdChunkedTestCustomBuildYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "test/extended/testdata/node/zstd-chunked/test-custom-build.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - var _testExtendedTestdataNode_tuningNtoStalldYaml = []byte(`apiVersion: tuned.openshift.io/v1 kind: Tuned metadata: @@ -56829,10 +56694,6 @@ var _bindata = map[string]func() (*asset, error){ "test/extended/testdata/node/nested_container/containers.conf": testExtendedTestdataNodeNested_containerContainersConf, "test/extended/testdata/node/nested_container/run_tests.sh": testExtendedTestdataNodeNested_containerRun_testsSh, "test/extended/testdata/node/nested_container/skip_tests.sh": testExtendedTestdataNodeNested_containerSkip_testsSh, - "test/extended/testdata/node/zstd-chunked/Dockerfile": testExtendedTestdataNodeZstdChunkedDockerfile, - "test/extended/testdata/node/zstd-chunked/Dockerfile.sample": testExtendedTestdataNodeZstdChunkedDockerfileSample, - "test/extended/testdata/node/zstd-chunked/build.sh": testExtendedTestdataNodeZstdChunkedBuildSh, - "test/extended/testdata/node/zstd-chunked/test-custom-build.yaml": testExtendedTestdataNodeZstdChunkedTestCustomBuildYaml, "test/extended/testdata/node_tuning/nto-stalld.yaml": testExtendedTestdataNode_tuningNtoStalldYaml, "test/extended/testdata/oauthserver/cabundle-cm.yaml": testExtendedTestdataOauthserverCabundleCmYaml, "test/extended/testdata/oauthserver/oauth-network.yaml": testExtendedTestdataOauthserverOauthNetworkYaml, @@ -57629,12 +57490,6 @@ var _bintree = &bintree{nil, map[string]*bintree{ "run_tests.sh": {testExtendedTestdataNodeNested_containerRun_testsSh, map[string]*bintree{}}, "skip_tests.sh": {testExtendedTestdataNodeNested_containerSkip_testsSh, map[string]*bintree{}}, }}, - "zstd-chunked": {nil, map[string]*bintree{ - "Dockerfile": {testExtendedTestdataNodeZstdChunkedDockerfile, map[string]*bintree{}}, - "Dockerfile.sample": {testExtendedTestdataNodeZstdChunkedDockerfileSample, map[string]*bintree{}}, - "build.sh": {testExtendedTestdataNodeZstdChunkedBuildSh, map[string]*bintree{}}, - "test-custom-build.yaml": {testExtendedTestdataNodeZstdChunkedTestCustomBuildYaml, map[string]*bintree{}}, - }}, }}, "node_tuning": {nil, map[string]*bintree{ "nto-stalld.yaml": {testExtendedTestdataNode_tuningNtoStalldYaml, map[string]*bintree{}}, diff --git a/test/extended/testdata/node/zstd-chunked/Dockerfile b/test/extended/testdata/node/zstd-chunked/Dockerfile deleted file mode 100644 index 2042ff7c406f..000000000000 --- a/test/extended/testdata/node/zstd-chunked/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM registry.redhat.io/rhel8/buildah:latest -# For simplicity, /tmp/build contains the inputs we’ll be building when we -# run this custom builder image. Normally the custom builder image would -# fetch this content from some location at build time. (e.g. via git clone). -ADD Dockerfile.sample /tmp/input/Dockerfile -ADD build.sh /usr/bin -RUN chmod a+x /usr/bin/build.sh -# /usr/build/build.sh contains the actual custom build logic that will be executed when -# this custom builder image is executed. -ENTRYPOINT ["/usr/bin/build.sh"] diff --git a/test/extended/testdata/node/zstd-chunked/Dockerfile.sample b/test/extended/testdata/node/zstd-chunked/Dockerfile.sample deleted file mode 100644 index f306db10ad14..000000000000 --- a/test/extended/testdata/node/zstd-chunked/Dockerfile.sample +++ /dev/null @@ -1,2 +0,0 @@ -FROM image-registry.openshift-image-registry.svc:5000/openshift/tools:latest -CMD ["date"] diff --git a/test/extended/testdata/node/zstd-chunked/build.sh b/test/extended/testdata/node/zstd-chunked/build.sh deleted file mode 100644 index 9e54ecd9f9e1..000000000000 --- a/test/extended/testdata/node/zstd-chunked/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -set -euo pipefail - -# Note that in this case the build inputs are part of the custom builder image, but normally this -# would be retrieved from an external source. -cd /tmp/input -# OUTPUT_REGISTRY and OUTPUT_IMAGE are env variables provided by the custom -# build framework -TAG="${OUTPUT_REGISTRY}/${OUTPUT_IMAGE}" - -cp -R /var/run/configs/openshift.io/certs/certs.d/* /etc/containers/certs.d/ - -# buildah requires a slight modification to the push secret provided by the service account in order to use it for pushing the image -echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/pull/.dockercfg)}" > /tmp/.pull -echo "{ \"auths\": $(cat /var/run/secrets/openshift.io/push/.dockercfg)}" > /tmp/.push - -# performs the build of the new image defined by Dockerfile.sample -buildah --authfile /tmp/.pull --storage-driver vfs bud --isolation chroot -t ${TAG} . -# push the new image to the target for the build -buildah --authfile /tmp/.push --storage-driver vfs push --compression-format zstd:chunked ${TAG} diff --git a/test/extended/testdata/node/zstd-chunked/test-custom-build.yaml b/test/extended/testdata/node/zstd-chunked/test-custom-build.yaml deleted file mode 100644 index 344172ce9f70..000000000000 --- a/test/extended/testdata/node/zstd-chunked/test-custom-build.yaml +++ /dev/null @@ -1,30 +0,0 @@ -kind: List -apiVersion: v1 -items: -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: sample-custom -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: sample-custom-build - labels: - name: sample-custom-build - annotations: - template.alpha.openshift.io/wait-for-ready: 'true' - spec: - strategy: - type: Custom - customStrategy: - env: - - name: "BUILD_LOGLEVEL" - value: "2" - forcePull: true - from: - kind: ImageStreamTag - name: custom-builder-image:latest - output: - to: - kind: ImageStreamTag - name: sample-custom:latest diff --git a/test/extended/util/image/image.go b/test/extended/util/image/image.go index 8daca7b6ba2e..fe4f6de81750 100644 --- a/test/extended/util/image/image.go +++ b/test/extended/util/image/image.go @@ -62,6 +62,9 @@ var ( // image required for OLMv1 tests in https://github.com/openshift/operator-framework-operator-controller/tree/main/openshift/tests-extension "quay.io/olmtest/webhook-operator:v0.0.5": -1, + + // used by zstd:chunked image tests + "quay.io/crio/zstd-chunked:1": -1, } ) diff --git a/test/extended/util/image/zz_generated.txt b/test/extended/util/image/zz_generated.txt index bccd4489a062..b1961579e13e 100644 --- a/test/extended/util/image/zz_generated.txt +++ b/test/extended/util/image/zz_generated.txt @@ -1,5 +1,6 @@ # This file is generated by hack/update-generated.sh docker.io/library/registry:2.8.0-beta.1 quay.io/openshift/community-e2e-images:e2e-docker-io-library-registry-2-8-0-beta-1-8x_YFKSuz9Xw6lZD +quay.io/crio/zstd-chunked:1 quay.io/openshift/community-e2e-images:e2e-quay-io-crio-zstd-chunked-1-0WG37FZRdxgvrbPZ quay.io/keycloak/keycloak:25.0 quay.io/openshift/community-e2e-images:e2e-quay-io-keycloak-keycloak-25-0-rEIw9B2Zcc3L1M6k quay.io/kubevirt/fedora-with-test-tooling-container-disk:20241024_891122a6fc quay.io/openshift/community-e2e-images:e2e-quay-io-kubevirt-fedora-with-test-tooling-container-disk-20241024_891122a6fc-IycYTh-87XrXse4E quay.io/olmtest/webhook-operator:v0.0.5 quay.io/openshift/community-e2e-images:e2e-quay-io-olmtest-webhook-operator-v0-0-5--2OhUsk-Xv-pLaTI