ci: bump CAPI and CAPO #346
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: depot-ubuntu-24.04 | |
| concurrency: | |
| group: build-${{ github.ref }}-${{ matrix.os }}-${{ matrix.version }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - debian/13/debian-minimal/trixie | |
| - ubuntu/22.04/ubuntu-minimal/jammy | |
| - rockylinux/9/rocky-container/9 | |
| version: | |
| - 1.32.10 | |
| - 1.33.7 | |
| - 1.34.3 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - run: uv sync | |
| - run: sudo apt-get install -y $(uv run bindep -b) | |
| - uses: winterjung/split@7f51d99e7cc1f147f6f99be75acf5e641930af88 # v2.1.0 | |
| id: split | |
| with: | |
| msg: ${{ matrix.os }} | |
| separator: "/" | |
| - run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar | |
| if: ${{ steps.split.outputs._2 == 'ubuntu-minimal' }} | |
| - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| with: | |
| path: /home/runner/.cache/image-create | |
| key: ${{ steps.split.outputs._2 }}-${{ steps.split.outputs._3 }}-${{ matrix.version }}-${{ github.head_ref || github.ref_name }} | |
| restore-keys: | | |
| ${{ steps.split.outputs._2 }}-${{ steps.split.outputs._3 }}-${{ matrix.version }}-${{ github.head_ref || github.ref_name }} | |
| ${{ steps.split.outputs._2 }}-${{ steps.split.outputs._3 }}-${{ matrix.version }} | |
| ${{ steps.split.outputs._2 }}-${{ steps.split.outputs._3 }} | |
| - run: uv run disk-image-create -o ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-v${{ matrix.version }}.qcow2 vm ${{ steps.split.outputs._2 }} block-device-kubernetes kubernetes | |
| env: | |
| ELEMENTS_PATH: ${{ github.workspace }}/elements | |
| DIB_RELEASE: ${{ steps.split.outputs._3 }} | |
| DIB_KUBERNETES_VERSION: ${{ matrix.version }} | |
| DIB_MIN_TMPFS: "4" | |
| DIB_CLOUD_INIT_GROWPART_DEVICES: '["/"]' | |
| DIB_SKIP_BASE_PACKAGE_INSTALL: "1" | |
| DIB_IMAGE_SIZE: "3" # Debian 2.5, Rocky 2.8, Ubuntu 2.8-3.0 | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-v${{ matrix.version }}-${{ github.run_id }} | |
| path: ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-v${{ matrix.version }}.qcow2 | |
| if-no-files-found: error | |
| retention-days: 7 | |
| devstack: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| concurrency: | |
| group: build-${{ github.ref }}-${{ matrix.os }}-${{ matrix.version }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - debian/13/debian-minimal/trixie | |
| - ubuntu/22.04/ubuntu-minimal/jammy | |
| - rockylinux/9/rocky-container/9 | |
| version: | |
| - 1.32.10 | |
| - 1.33.7 | |
| - 1.34.3 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: winterjung/split@7f51d99e7cc1f147f6f99be75acf5e641930af88 # v2.1.0 | |
| id: split | |
| with: | |
| msg: ${{ matrix.os }} | |
| separator: "/" | |
| - name: Deploy OpenStack cloud | |
| uses: gophercloud/devstack-action@60ca1042045c0c9e3e001c64575d381654ffcba1 # v0.19 | |
| with: | |
| enable_workaround_docker_io: false | |
| - name: Allow Docker traffic | |
| run: sudo iptables -I DOCKER-USER -j ACCEPT | |
| - name: Create KinD cluster | |
| run: | | |
| kind create cluster | |
| kubectl version | |
| - name: Install "clusterctl" | |
| run: | | |
| curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.4/clusterctl-linux-amd64 -o clusterctl | |
| sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl | |
| clusterctl version | |
| - name: Install Cluster API provider for OpenStack | |
| run: clusterctl init --infrastructure openstack | |
| env: | |
| CLUSTER_TOPOLOGY: "true" | |
| EXP_CLUSTER_RESOURCE_SET: "true" | |
| - name: Wait for Cluster API provider for OpenStack to initialize | |
| run: kubectl wait --for=condition=available --timeout=120s deployment/capo-controller-manager -n capo-system | |
| - name: Install OpenStack Resource Controller | |
| run: kubectl apply --server-side -f https://github.com/k-orc/openstack-resource-controller/releases/latest/download/install.yaml | |
| - name: Download image artifact | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-v${{ matrix.version }}-${{ github.run_id }} | |
| - name: Load image under test | |
| run: | | |
| openstack image create --disk-format qcow2 --file ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-v${{ matrix.version }}.qcow2 image-under-test | |
| rm -rfv ${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-* | |
| env: | |
| OS_CLOUD: devstack | |
| - name: Create SSH keypair | |
| run: | | |
| openstack keypair create --private-key id_ed25519 runner | |
| env: | |
| OS_CLOUD: devstack | |
| - name: Deploy Kubernetes cluster | |
| run: | | |
| export OPENSTACK_CLOUD_YAML_B64=$(cat /etc/openstack/clouds.yaml | base64 -w0) | |
| export OPENSTACK_EXTERNAL_NETWORK_ID=$(openstack network show public -c ID -f value) | |
| export KUBERNETES_VERSION=${{ matrix.version }} | |
| echo "Using KUBERNETES_VERSION=${KUBERNETES_VERSION}" | |
| clusterctl generate cluster --from https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/v0.12.4/cluster-template-without-lb.yaml --worker-machine-count 1 test | kubectl apply -f - | |
| env: | |
| OS_CLOUD: "devstack" | |
| OPENSTACK_CLOUD_CACERT_B64: "" | |
| OPENSTACK_CLOUD: "devstack" | |
| OPENSTACK_DNS_NAMESERVERS: "1.1.1.1" | |
| OPENSTACK_FAILURE_DOMAIN: "nova" | |
| OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR: "ds2G" | |
| OPENSTACK_NODE_MACHINE_FLAVOR: "ds2G" | |
| OPENSTACK_IMAGE_NAME: "image-under-test" | |
| OPENSTACK_SSH_KEY_NAME: "runner" | |
| - name: Wait for control plane to initialize | |
| run: kubectl wait --for=condition=ControlPlaneInitialized --timeout=120s cluster/test | |
| - name: Get workload cluster KUBECONFIG | |
| run: clusterctl get kubeconfig test > /tmp/kubeconfig | |
| - name: Install OpenStack cloud controller manager | |
| run: | | |
| helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack | |
| helm repo update | |
| cat <<EOF | helm upgrade --install --namespace kube-system openstack-ccm cpo/openstack-cloud-controller-manager --values /dev/stdin | |
| tolerations: | |
| - key: node.cloudprovider.kubernetes.io/uninitialized | |
| value: "true" | |
| effect: NoSchedule | |
| - key: node-role.kubernetes.io/control-plane | |
| effect: NoSchedule | |
| - key: node.kubernetes.io/not-ready | |
| effect: NoSchedule | |
| enabledControllers: | |
| - cloud-node | |
| - cloud-node-lifecycle | |
| cloudConfig: | |
| global: | |
| auth-url: $(yq '.clouds.devstack.auth.auth_url' /etc/openstack/clouds.yaml)/v3 | |
| username: demo | |
| password: secret | |
| region: RegionOne | |
| tenant-name: demo | |
| domain-name: default | |
| EOF | |
| env: | |
| KUBECONFIG: /tmp/kubeconfig | |
| - name: Install Cilium | |
| run: | | |
| CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt) | |
| CLI_ARCH=amd64 | |
| if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi | |
| curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} | |
| sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum | |
| sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin | |
| rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} | |
| cilium install | |
| env: | |
| KUBECONFIG: /tmp/kubeconfig | |
| - name: Wait for all nodes to be ready | |
| run: kubectl wait --for=condition=Ready nodes --all --timeout=5m | |
| env: | |
| KUBECONFIG: /tmp/kubeconfig | |
| - name: Start CI debugging on failures | |
| uses: owenthereal/action-upterm@a639d5441986141cf7c7c8b64c02b6997b5bb638 # v1.11.0 | |
| if: ${{ failure() }} | |
| with: | |
| wait-timeout-minutes: 5 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: devstack | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download image artifact | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| - name: Prepare qcow2 files list | |
| id: prepare_files | |
| shell: bash | |
| run: | | |
| files=$(find . -mindepth 2 -maxdepth 2 -name "*.qcow2" -type f) | |
| if [ -n "$files" ]; then | |
| echo "Found qcow2 files:" | |
| echo "$files" | |
| { | |
| echo "files<<EOF" | |
| echo "$files" | |
| echo "EOF" | |
| } >> $GITHUB_OUTPUT | |
| else | |
| echo "No qcow2 files found" | |
| echo "files=" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Generate release version | |
| uses: alepee/calendar-version-action@288fc1fd1e6d3e892dd1f95a1e72e06348dd44b3 # v1 | |
| id: version | |
| with: | |
| dateFormat: "YYYY.0M" | |
| format: "%NOW%-%MICRO%" | |
| - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 | |
| if: steps.prepare_files.outputs.files != '' | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| name: ${{ steps.version.outputs.version }} | |
| files: ${{ steps.prepare_files.outputs.files }} | |
| prerelease: false | |
| make_latest: true | |
| generate_release_notes: true |