diff --git a/config/jobs/kubernetes/sig-node/Makefile b/config/jobs/kubernetes/sig-node/Makefile new file mode 100644 index 0000000000000..7af4c4871c47a --- /dev/null +++ b/config/jobs/kubernetes/sig-node/Makefile @@ -0,0 +1,17 @@ +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +.PHONY: generate +generate: + ./gen.py diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml new file mode 100644 index 0000000000000..c9848b2f127a0 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml @@ -0,0 +1,285 @@ + +presubmits: + kubernetes/kubernetes: + - name: canary-kind-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation, sig-node-presubmits + testgrid-tab-name: canary-kind-dra + description: Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: canary-kind-dra-all + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation + testgrid-tab-name: canary-kind-dra-all + description: Runs E2E tests for Dynamic Resource Allocation alpha and beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: canary-node-e2e-cgrpv1-crio-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: (/dra/|/dynamicresources/|/resourceclaim/|/deviceclass/|/resourceslice/|/resourceclaimtemplate/|/dynamic-resource-allocation/|/pkg/apis/resource/|/api/resource/|/test/e2e_node/dra_).*\.(go|yaml) + skip_report: false + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: canary-node-e2e-cgrpv1-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v1 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv1-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: canary-node-e2e-cgrpv2-crio-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + skip_report: false + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: canary-node-e2e-cgrpv2-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v2 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv2-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: canary-node-e2e-containerd-1-7-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + skip_report: false + annotations: + testgrid-dashboards: sig-node-containerd, sig-node-dynamic-resource-allocation, sig-node-containerd + testgrid-tab-name: canary-node-e2e-containerd-1-7-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with containerd + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --container-runtime-process-name=/usr/local/bin/containerd --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/containerd.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"containerd.log\", \"journalctl\": [\"-u\", \"containerd\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/dra/image-config-containerd-1.7.yaml + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-ci.yaml b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-ci.yaml new file mode 100644 index 0000000000000..3517daa202b67 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-ci.yaml @@ -0,0 +1,253 @@ + +periodics: + - name: ci-kind-dra + cluster: eks-prow-build-cluster + interval: 6h + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation + testgrid-tab-name: ci-kind-dra + description: Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: ci-kind-dra-all + cluster: eks-prow-build-cluster + interval: 6h + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation + testgrid-tab-name: ci-kind-dra-all + description: Runs E2E tests for Dynamic Resource Allocation alpha and beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: ci-node-e2e-cgrpv1-crio-dra + cluster: eks-prow-build-cluster + interval: 6h + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: ci-node-e2e-cgrpv1-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v1 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv1-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: ci-node-e2e-cgrpv2-crio-dra + cluster: eks-prow-build-cluster + interval: 6h + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: ci-node-e2e-cgrpv2-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v2 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv2-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: ci-node-e2e-containerd-1-7-dra + cluster: eks-prow-build-cluster + interval: 6h + annotations: + testgrid-dashboards: sig-node-containerd, sig-node-dynamic-resource-allocation, sig-node-containerd + testgrid-tab-name: ci-node-e2e-containerd-1-7-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with containerd + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --container-runtime-process-name=/usr/local/bin/containerd --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/containerd.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"containerd.log\", \"journalctl\": [\"-u\", \"containerd\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/dra/image-config-containerd-1.7.yaml + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-pull.yaml b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-pull.yaml new file mode 100644 index 0000000000000..aae9f4073ad01 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-pull.yaml @@ -0,0 +1,285 @@ + +presubmits: + kubernetes/kubernetes: + - name: pull-kind-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation, sig-node-presubmits + testgrid-tab-name: pull-kind-dra + description: Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: pull-kind-dra-all + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation + testgrid-tab-name: pull-kind-dra-all + description: Runs E2E tests for Dynamic Resource Allocation alpha and beta features against a Kubernetes master cluster created with sigs.k8s.io/kind + testgrid-alert-email: patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: pull-node-e2e-cgrpv1-crio-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + run_if_changed: (/dra/|/dynamicresources/|/resourceclaim/|/deviceclass/|/resourceslice/|/resourceclaimtemplate/|/dynamic-resource-allocation/|/pkg/apis/resource/|/api/resource/|/test/e2e_node/dra_).*\.(go|yaml) + skip_report: false + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: pull-node-e2e-cgrpv1-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v1 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv1-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: pull-node-e2e-cgrpv2-crio-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + skip_report: false + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation, sig-node-cri-o + testgrid-tab-name: pull-node-e2e-cgrpv2-crio-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v2 + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --env=KUBE_SSH_USER=core + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv2-serial.yaml + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + + - name: pull-node-e2e-containerd-1-7-dra + cluster: eks-prow-build-cluster + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: true + skip_report: false + annotations: + testgrid-dashboards: sig-node-containerd, sig-node-dynamic-resource-allocation, sig-node-containerd + testgrid-tab-name: pull-node-e2e-containerd-1-7-dra + description: Runs E2E node tests for Dynamic Resource Allocation beta features with containerd + testgrid-alert-email: eduard.bartosh@intel.com,patrick.ohly@intel.com + fork-per-release: "true" + decorate: true + decoration_config: + timeout: 90m + labels: + preset-service-account: "true" + preset-k8s-ssh: "{preset-k8s-ssh}" + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --container-runtime-process-name=/usr/local/bin/containerd --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/containerd.service --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{\"name\": \"containerd.log\", \"journalctl\": [\"-u\", \"containerd\"]}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky"' + - --timeout=65m + - --node-args=--image-config-file=/home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/dra/image-config-containerd-1.7.yaml + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.conf b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.conf new file mode 100644 index 0000000000000..c188da118bcd7 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.conf @@ -0,0 +1,65 @@ +[DEFAULT] +interval = 6h +testgrid_dashboards = sig-node-dynamic-resource-allocation +testgrid_alert_email = eduard.bartosh@intel.com,patrick.ohly@intel.com +timeout = 90m +use-dind = false +label_filter = Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky +optional = true + +# This jobs runs e2e.test with a focus on tests for the Dynamic Resource Allocation feature (currently beta) +# on a kind cluster with containerd updated to a version with CDI support. +[kind-dra] +description = Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind +testgrid_alert_email = patrick.ohly@intel.com +use_dind = true +run_if_changed = /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + +# This jobs runs e2e.test with a focus on tests for the Dynamic Resource Allocation feature (currently alpha, soon beta) +# on a kind cluster with containerd updated to a version with CDI support. +# +# Compared to ci-kind-dra, this one enables all DRA-related features. +[kind-dra-all] +description = Runs E2E tests for Dynamic Resource Allocation alpha and beta features against a Kubernetes master cluster created with sigs.k8s.io/kind +testgrid_alert_email = patrick.ohly@intel.com +use_dind = true +run_if_changed = /(dra|dynamicresources|resourceclaim|deviceclass|resourceslice|resourceclaimtemplate|dynamic-resource-allocation|pkg/apis/resource|api/resource)/.*.go + +# This job runs e2e_node.test with a focus on tests for the Dynamic Resource Allocation feature (currently beta) +[node-e2e-cgrpv1-crio-dra] +job_type = node +description = Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v1 +testgrid_dashboards = sig-node-cri-o, sig-node-dynamic-resource-allocation +skip_report = false +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv1-serial.yaml +inject_ssh_public_key = true +container_runtime_endpoint = unix:///var/run/crio/crio.sock +container_runtime_process_name = /usr/local/bin/crio +runtime_cgroups = /system.slice/crio.service +extra_log = {\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]} +run_if_changed = (/dra/|/dynamicresources/|/resourceclaim/|/deviceclass/|/resourceslice/|/resourceclaimtemplate/|/dynamic-resource-allocation/|/pkg/apis/resource/|/api/resource/|/test/e2e_node/dra_).*\.(go|yaml) + +# This job is the same as ci-node-e2e-cgrpv1-crio-dra, but for cgroup v2 +[node-e2e-cgrpv2-crio-dra] +job_type = node +description = Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v2 +testgrid_dashboards = sig-node-cri-o, sig-node-dynamic-resource-allocation +skip_report = false +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv2-serial.yaml +inject_ssh_public_key = true +container_runtime_endpoint = unix:///var/run/crio/crio.sock +container_runtime_process_name = /usr/local/bin/crio +runtime_cgroups = /system.slice/crio.service +extra_log = {\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]} + +# This job runs the same tests as ci-node-e2e-crio-dra with Containerd 1.7 runtime +[node-e2e-containerd-1-7-dra] +job_type = node +description = Runs E2E node tests for Dynamic Resource Allocation beta features with containerd +testgrid_dashboards = sig-node-containerd, sig-node-dynamic-resource-allocation +skip_report = false +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/dra/image-config-containerd-1.7.yaml +container_runtime_endpoint = unix:///var/run/containerd/containerd.sock +container_runtime_process_name = /usr/local/bin/containerd +runtime_cgroups = /system.slice/containerd.service +extra_log = {\"name\": \"containerd.log\", \"journalctl\": [\"-u\", \"containerd\"]} diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.jinja b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.jinja new file mode 100644 index 0000000000000..8f7bade788da2 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.jinja @@ -0,0 +1,117 @@ +{%- if beginning %} +{%- if kind == "ci" %} +periodics: +{%- else %} +presubmits: + kubernetes/kubernetes: +{%- set testgrid_dashboards = testgrid_dashboards + ", sig-node-presubmits" %} +{%- endif %} +{%- endif %} +{%- if "crio" in job_name %} +{%- set testgrid_dashboards = testgrid_dashboards + ", sig-node-cri-o" %} +{%- endif %} +{%- if "containerd" in job_name %} +{%- set testgrid_dashboards = testgrid_dashboards + ", sig-node-containerd" %} +{%- endif %} + - name: {{job_name}} + cluster: eks-prow-build-cluster + {%- if kind == "ci" %} + interval: {{interval}} + {%- else %} + skip_branches: + - release-\d+\.\d+ # per-release image + always_run: false + optional: {{optional}} + {%- if run_if_changed %} + run_if_changed: {{run_if_changed}} + {%- endif %} + {%- if skip_report %} + skip_report: {{skip_report}} + {%- endif %} + {%- endif %} + annotations: + testgrid-dashboards: {{testgrid_dashboards}} + testgrid-tab-name: {{job_name}} + description: {{description}} + testgrid-alert-email: {{testgrid_alert_email}} + {%- if kind != "canary" %} + fork-per-release: "true" + {%- endif %} + decorate: true + decoration_config: + timeout: {{timeout}} + labels: + preset-service-account: "true" + {%- if use_dind == "true" %} + preset-dind-enabled: "true" + preset-kind-volume-mounts: "true" + {%- endif %} + {%- if job_type == "node" %} + preset-k8s-ssh: "{preset-k8s-ssh}" + {%- endif %} + {%- if kind != "ci" %} + preset-pull-kubernetes-e2e: "true" + preset-pull-kubernetes-e2e-gce: "true" + {%- endif %} + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + {%- if job_type == "node" %} + workdir: true + - org: kubernetes + repo: test-infra + base_ref: master + path_alias: k8s.io/test-infra + {%- endif %} + spec: + containers: + - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20241218-d4b51bc3e8-master + command: + - runner.sh + {%- if job_type == "node" %} + - /workspace/scenarios/kubernetes_e2e.py + args: + - --deployment=node + {%- if inject_ssh_public_key == "true" %} + - --env=KUBE_SSH_USER=core + {%- endif %} + - --gcp-zone=us-west1-b + - '--node-test-args=--feature-gates=DynamicResourceAllocation=true --service-feature-gates=DynamicResourceAllocation=true --runtime-config=api/beta=true --container-runtime-endpoint={{container_runtime_endpoint}} --container-runtime-process-name={{container_runtime_process_name}} --container-runtime-pid-file= --kubelet-flags="--cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups={{runtime_cgroups}} --kubelet-cgroups=/system.slice/kubelet.service" --extra-log="{{extra_log}}"' + - --node-tests=true + - --provider=gce + - '--test_args=--timeout=1h --label-filter="{{label_filter}}"' + - --timeout=65m + - --node-args=--image-config-file={{image_config_file}} + {%- if inject_ssh_public_key == "true" %} + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + {%- endif %} + {%- else %} + args: + - /bin/sh + - -xc + - > + make WHAT="github.com/onsi/ginkgo/v2/ginkgo k8s.io/kubernetes/test/e2e/e2e.test" && + curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" kind && + kind build node-image --image=dra/node:latest . && + trap 'kind export logs "${ARTIFACTS}/kind"; kind delete cluster' EXIT && + kind create cluster --retain --config test/e2e/dra/kind.yaml --image dra/node:latest && + KUBERNETES_PROVIDER=local KUBECONFIG=${HOME}/.kube/config GINKGO_PARALLEL_NODES=8 E2E_REPORT_DIR=${ARTIFACTS} GINKGO_TIMEOUT=2h30m hack/ginkgo-e2e.sh -ginkgo.label-filter='{{label_filter}}' + + # docker-in-docker needs privileged mode + securityContext: + privileged: true + {%- endif %} + resources: + limits: + cpu: 2 + memory: 9Gi + requests: + cpu: 2 + memory: 9Gi + diff --git a/config/jobs/kubernetes/sig-node/gen.py b/config/jobs/kubernetes/sig-node/gen.py new file mode 100755 index 0000000000000..55bc872143518 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/gen.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Generate job configuration files.""" + +import configparser +import glob +import sys + +import jinja2 + + +def gen() -> int: + """Generate job configuration files.""" + for fname in glob.glob("*.conf"): + config = configparser.ConfigParser() + config.read(fname) + + name = fname.split(".")[0] + with open(f"{name}.jinja", encoding="utf-8") as inp: + template = jinja2.Template(inp.read()) + for kind in ("ci", "pull", "canary"): + with open(f"{name}-{kind}.yaml", "w", encoding="utf-8") as out: + beginning = True + for section in config.sections(): + out.write( + template.render( + config[section], kind=kind, job_name=f"{kind}-{section}", beginning=beginning + ) + ) + beginning = False + + +if __name__ == "__main__": + sys.exit(gen())