From 3435fe3ddbb646d9459f24ae3f4320a4b91ff7e6 Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Mon, 28 Oct 2024 17:55:50 +0800 Subject: [PATCH] add zuul jobs for rocky and ubuntu --- .github/workflows/molecule.yml | 19 ---------------- .python-version | 1 + roles/kubelet/tasks/main.yml | 10 +++++++++ roles/kubelet/vars/redhat.yml | 5 +---- tox.ini | 8 +++++++ zuul.d/jobs-focal.yaml | 35 +++++++++++++++++++++++++++++ zuul.d/jobs-jammy.yaml | 32 ++++++++++++++++++++++++++ zuul.d/jobs-rockylinux9.yaml | 36 ++++++++++++++++++++++++++++++ zuul.d/jobs.yaml | 1 + zuul.d/playbooks/molecule/post.yml | 6 +++++ zuul.d/project.yaml | 4 ++++ 11 files changed, 134 insertions(+), 23 deletions(-) create mode 100644 .python-version create mode 100644 zuul.d/jobs-focal.yaml create mode 100644 zuul.d/jobs-jammy.yaml create mode 100644 zuul.d/jobs-rockylinux9.yaml create mode 100644 zuul.d/playbooks/molecule/post.yml diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index f2ea06cb..8aca14de 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -28,13 +28,6 @@ jobs: fail-fast: false matrix: version: - - 1.19.16 - - 1.20.15 - - 1.21.14 - - 1.22.17 - - 1.23.17 - - 1.24.17 - - 1.25.16 - 1.26.15 - 1.27.16 - 1.28.13 @@ -74,18 +67,6 @@ jobs: fail-fast: false matrix: include: - - old_version: 1.19.16 - version: 1.20.15 - - old_version: 1.20.15 - version: 1.21.14 - - old_version: 1.21.14 - version: 1.22.17 - - old_version: 1.22.17 - version: 1.23.17 - - old_version: 1.23.17 - version: 1.24.17 - - old_version: 1.24.17 - version: 1.25.16 - old_version: 1.25.16 version: 1.26.15 - old_version: 1.26.15 diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..c8cfe395 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/roles/kubelet/tasks/main.yml b/roles/kubelet/tasks/main.yml index cc883414..213eeeca 100644 --- a/roles/kubelet/tasks/main.yml +++ b/roles/kubelet/tasks/main.yml @@ -21,6 +21,16 @@ - "{{ ansible_facts['distribution'] | lower }}.yml" - "{{ ansible_facts['os_family'] | lower }}.yml" +# NOTE(mnaser): Sometimes EL ships with coreutils, sometimes it ships +# with coreutils-single. We need to ensure that we have +# coreutils installed. +- name: Install coreutils + ansible.builtin.dnf: + name: coreutils + allowerasing: true + when: + - ansible_facts['os_family'] == 'RedHat' + # NOTE(mnaser): This is a list of packages that are needed for `kubeadm` # validation. # diff --git a/roles/kubelet/vars/redhat.yml b/roles/kubelet/vars/redhat.yml index 9ab67587..6047ed46 100644 --- a/roles/kubelet/vars/redhat.yml +++ b/roles/kubelet/vars/redhat.yml @@ -1,9 +1,6 @@ kubelet_package_dependencies: - conntrack - # NOTE(fitbeard): This is to allow our tests to run on Docker containers since - # Rocky Linux images comes with pre-installed thiner versions - # of some packages. - - "{{ 'coreutils-single' if ansible_connection == 'community.docker.docker' else 'coreutils' }}" + - coreutils - ebtables - ethtool - iproute diff --git a/tox.ini b/tox.ini index de51e591..a910f1ed 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,14 @@ deps = commands = molecule {posargs} +[testenv:molecule-aio] +deps = + {[testenv:molecule-venv]deps} +passenv = + KUBERNETES_VERSION +commands = + molecule test -s aio + [testenv:molecule-cluster-api] deps = {[testenv:molecule-venv]deps} diff --git a/zuul.d/jobs-focal.yaml b/zuul.d/jobs-focal.yaml new file mode 100644 index 00000000..a850a7b1 --- /dev/null +++ b/zuul.d/jobs-focal.yaml @@ -0,0 +1,35 @@ +# Copyright (c) 2024 VEXXHOST, Inc. +# SPDX-License-Identifier: Apache-2.0 + +- job: + name: ansible-collection-kubernetes-molecule-focal + parent: ansible-collection-kubernetes-molecule + vars: + # NOTE(mnaser): Ubuntu Focal ships with an old Python + python_use_pyenv: true + nodeset: + nodes: + - name: ubuntu-focal + label: focal-2c-8g + +- job: + name: ansible-collection-kubernetes-molecule-focal-aio + parent: ansible-collection-kubernetes-molecule-focal + vars: + tox_envlist: molecule-aio + +- job: + name: ansible-collection-kubernetes-molecule-focal-aio-1-28 + parent: ansible-collection-kubernetes-molecule-focal-aio + vars: + tox_environment: + KUBERNETES_VERSION: 1.28.4 + +- project-template: + name: ansible-collection-kubernetes-molecule-focal + check: + jobs: + - ansible-collection-kubernetes-molecule-focal-aio-1-28 + gate: + jobs: + - ansible-collection-kubernetes-molecule-focal-aio-1-28 diff --git a/zuul.d/jobs-jammy.yaml b/zuul.d/jobs-jammy.yaml new file mode 100644 index 00000000..593bf20e --- /dev/null +++ b/zuul.d/jobs-jammy.yaml @@ -0,0 +1,32 @@ +# Copyright (c) 2024 VEXXHOST, Inc. +# SPDX-License-Identifier: Apache-2.0 + +- job: + name: ansible-collection-kubernetes-molecule-jammy + parent: ansible-collection-kubernetes-molecule + nodeset: + nodes: + - name: ubuntu-jammy + label: jammy-2c-8g + +- job: + name: ansible-collection-kubernetes-molecule-jammy-aio + parent: ansible-collection-kubernetes-molecule-jammy + vars: + tox_envlist: molecule-aio + +- job: + name: ansible-collection-kubernetes-molecule-jammy-aio-1-28 + parent: ansible-collection-kubernetes-molecule-jammy-aio + vars: + tox_environment: + KUBERNETES_VERSION: 1.28.4 + +- project-template: + name: ansible-collection-kubernetes-molecule-jammy + check: + jobs: + - ansible-collection-kubernetes-molecule-jammy-aio-1-28 + gate: + jobs: + - ansible-collection-kubernetes-molecule-jammy-aio-1-28 diff --git a/zuul.d/jobs-rockylinux9.yaml b/zuul.d/jobs-rockylinux9.yaml new file mode 100644 index 00000000..46ba5c75 --- /dev/null +++ b/zuul.d/jobs-rockylinux9.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2024 VEXXHOST, Inc. +# SPDX-License-Identifier: Apache-2.0 + +- job: + name: ansible-collection-kubernetes-molecule-rockylinux9 + parent: ansible-collection-kubernetes-molecule + vars: + # NOTE(mnaser): `python3-wheel` is not available on Rocky 9. + ensure_pip_from_packages: false + ensure_pip_from_upstream: true + nodeset: + nodes: + - name: rockylinux9 + label: rockylinux9-2c-8g + +- job: + name: ansible-collection-kubernetes-molecule-rockylinux9-aio + parent: ansible-collection-kubernetes-molecule-rockylinux9 + vars: + tox_envlist: molecule-aio + +- job: + name: ansible-collection-kubernetes-molecule-rockylinux9-aio-1-28 + parent: ansible-collection-kubernetes-molecule-rockylinux9-aio + vars: + tox_environment: + KUBERNETES_VERSION: 1.28.4 + +- project-template: + name: ansible-collection-kubernetes-molecule-rockylinux9 + check: + jobs: + - ansible-collection-kubernetes-molecule-rockylinux9-aio-1-28 + gate: + jobs: + - ansible-collection-kubernetes-molecule-rockylinux9-aio-1-28 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 977c0835..b89b30ed 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -17,6 +17,7 @@ abstract: true pre-run: zuul.d/playbooks/molecule/pre.yml run: zuul.d/playbooks/molecule/run.yml + post-run: zuul.d/playbooks/molecule/post.yml - job: name: ansible-collection-kubernetes-molecule-cluster-api diff --git a/zuul.d/playbooks/molecule/post.yml b/zuul.d/playbooks/molecule/post.yml new file mode 100644 index 00000000..fca092ac --- /dev/null +++ b/zuul.d/playbooks/molecule/post.yml @@ -0,0 +1,6 @@ +# Copyright (c) 2024 VEXXHOST, Inc. +# SPDX-License-Identifier: Apache-2.0 + +- hosts: all + roles: + - role: collect-kubernetes-logs diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 70360c11..8a97ac2f 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -35,3 +35,7 @@ release: jobs: - publish-ansible-collection-vexxhost + templates: + - ansible-collection-kubernetes-molecule-focal + - ansible-collection-kubernetes-molecule-jammy + - ansible-collection-kubernetes-molecule-rockylinux9