From 2f75bbd214de9eb0d6b58d829ee2dc3af8d933d7 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Thu, 19 Dec 2024 15:29:22 +0200 Subject: [PATCH] generate job config from Jinja templates --- config/jobs/kubernetes/sig-node/Makefile | 17 ++ .../dynamic-resource-allocation-canary.ini | 52 ++++ .../dynamic-resource-allocation-canary.yaml | 255 ++++++++++++++++++ ...amic-resource-allocation-canary.yaml.jinja | 79 ++++++ 4 files changed, 403 insertions(+) create mode 100644 config/jobs/kubernetes/sig-node/Makefile create mode 100644 config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.ini create mode 100644 config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml create mode 100644 config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml.jinja diff --git a/config/jobs/kubernetes/sig-node/Makefile b/config/jobs/kubernetes/sig-node/Makefile new file mode 100644 index 0000000000000..42e86cb7442f4 --- /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-jobs: + ./gen.py diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.ini b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.ini new file mode 100644 index 0000000000000..868f08495452d --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.ini @@ -0,0 +1,52 @@ +[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 + +# 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. +[ci-kind-dra] +job_type = ci +description = Runs E2E tests for Dynamic Resource Allocation beta features against a Kubernetes master cluster created with sigs.k8s.io/kind +cluster = eks-prow-build-cluster +testgrid_alert_email = patrick.ohly@intel.com +timeout = 3h +use_dind = true + +# 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. +[ci-kind-dra-all] +job_type = ci +description = Runs E2E tests for Dynamic Resource Allocation alpha and beta features against a Kubernetes master cluster created with sigs.k8s.io/kind +cluster = eks-prow-build-cluster +testgrid_alert_email = patrick.ohly@intel.com +timeout = 3h +use_dind = true + +# This job runs e2e_node.test with a focus on tests for the Dynamic Resource Allocation feature (currently beta) +[ci-node-e2e-cgrpv1-crio-dra] +job_type = pr +description = Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v1 +cluster = k8s-infra-prow-build +testgrid_dashboards = sig-node-cri-o, sig-node-dynamic-resource-allocation +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv1-serial.yaml + +# This job is the same as ci-node-e2e-cgrpv1-crio-dra, but for cgroup v2 +[ci-node-e2e-cgrpv2-crio-dra] +job_type = pr +description = Runs E2E node tests for Dynamic Resource Allocation beta features with CRI-O using cgroup v2 +cluster = k8s-infra-prow-build +testgrid_dashboards = sig-node-cri-o, sig-node-dynamic-resource-allocation +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/crio/latest/image-config-cgroupv2-serial.yaml + +# This job runs the same tests as ci-node-e2e-crio-dra with Containerd 1.7 runtime +[ci-node-e2e-containerd-1-7-dra] +job_type = pr +description = Runs E2E node tests for Dynamic Resource Allocation beta features with containerd +cluster = k8s-infra-prow-build +image_config_file = /home/prow/go/src/k8s.io/test-infra/jobs/e2e_node/dra/image-config-containerd-1.7.yaml 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..c775c97d499f4 --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml @@ -0,0 +1,255 @@ +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: 3h + 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: 3h + 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: k8s-infra-prow-build + interval: 6h + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation + 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: "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/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: k8s-infra-prow-build + interval: 6h + annotations: + testgrid-dashboards: sig-node-cri-o, sig-node-dynamic-resource-allocation + 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: "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/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: k8s-infra-prow-build + interval: 6h + annotations: + testgrid-dashboards: sig-node-dynamic-resource-allocation + 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: "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 + 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 diff --git a/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml.jinja b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml.jinja new file mode 100644 index 0000000000000..16c9204e44c7c --- /dev/null +++ b/config/jobs/kubernetes/sig-node/dynamic-resource-allocation-canary.yaml.jinja @@ -0,0 +1,79 @@ +{%- if beginning %}periodics:{%- endif %} + - name: {{job_name}} + cluster: {{cluster}} + interval: {{interval}} + annotations: + testgrid-dashboards: {{testgrid_dashboards}} + testgrid-tab-name: {{job_name}} + description: {{description}} + testgrid-alert-email: {{testgrid_alert_email}} + fork-per-release: "true" + 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 == "pr" %} + preset-k8s-ssh: "true" + {%- endif %} + extra_refs: + - org: kubernetes + repo: kubernetes + base_ref: master + path_alias: k8s.io/kubernetes + {%- if job_type == "pr" %} + 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 == "pr" %} + - /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="{{label_filter}}"' + - --timeout=65m + - --node-args=--image-config-file={{image_config_file}} + env: + - name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE + value: "1" + - name: GOPATH + value: /go + {%- 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 +