From 197cb868ed80f8eb5dc35c3ffc29ac65194e46a1 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Mon, 8 Apr 2024 13:22:51 +0800 Subject: [PATCH] Add yaml formatter --- .github/ISSUE_TEMPLATE/bug-report.yaml | 140 +++---- .github/ISSUE_TEMPLATE/config.yml | 6 +- .github/ISSUE_TEMPLATE/enhancement.yaml | 32 +- .github/ISSUE_TEMPLATE/failing-test.yaml | 56 +-- .github/dependabot.yml | 32 +- .github/workflows/bump_releases.yaml | 22 +- .github/workflows/golangci-lint.yaml | 20 +- .github/workflows/releases.yaml | 92 ++--- .github/workflows/test-site.yaml | 10 +- .github/workflows/test.yaml | 496 +++++++++++------------ .golangci.yaml | 282 ++++++------- .yamlfmt.yaml | 4 + cloudbuild.yaml | 38 +- hack/update-all.sh | 5 + hack/update-yaml-format.sh | 40 ++ hack/verify-all.sh | 5 + hack/verify-yaml-format.sh | 30 ++ kustomize/kwok/deployment.yaml | 120 +++--- site/assets/adopters/clusterpedia.yaml | 6 +- site/assets/adopters/daocloud.yaml | 14 +- site/assets/adopters/headlamp.yaml | 6 +- site/assets/adopters/multi-nic-cni.yaml | 10 +- site/config.yaml | 338 +++++++-------- site/content/en/docs/adopters/_index.md | 6 +- test/kwok-with-cni/fake-deployment.yaml | 20 +- test/kwok-with-cni/fake-node.yaml | 6 +- test/kwok/fake-deployment.yaml | 20 +- test/kwok/fake-node.yaml | 6 +- test/kwokctl/fake-deployment.yaml | 4 +- test/kwokctl/kustomization.yaml | 4 +- test/kwokctl/testdata/extra.yaml | 144 +++---- test/lifecycle/fake-pod-stages.yaml | 46 +-- 32 files changed, 1072 insertions(+), 988 deletions(-) create mode 100644 .yamlfmt.yaml create mode 100755 hack/update-yaml-format.sh create mode 100755 hack/verify-yaml-format.sh diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 148a777f2..f7176f264 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -2,84 +2,84 @@ name: Bug Report description: Report a bug encountered while operating Kwok labels: kind/bug body: - - type: checkboxes - id: usage - attributes: - label: How to use it? - options: - - label: kwok - - label: kwokctl --runtime=docker (default runtime) - - label: kwokctl --runtime=binary - - label: kwokctl --runtime=nerdctl - - label: kwokctl --runtime=kind +- type: checkboxes + id: usage + attributes: + label: How to use it? + options: + - label: kwok + - label: kwokctl --runtime=docker (default runtime) + - label: kwokctl --runtime=binary + - label: kwokctl --runtime=nerdctl + - label: kwokctl --runtime=kind - - type: textarea - id: problem - attributes: - label: What happened? - description: | - Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. - If this matter is security related, please disclose it privately via https://kubernetes.io/security - validations: - required: true +- type: textarea + id: problem + attributes: + label: What happened? + description: | + Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. + If this matter is security related, please disclose it privately via https://kubernetes.io/security + validations: + required: true - - type: textarea - id: expected - attributes: - label: What did you expect to happen? - validations: - required: true +- type: textarea + id: expected + attributes: + label: What did you expect to happen? + validations: + required: true - - type: textarea - id: repro - attributes: - label: How can we reproduce it (as minimally and precisely as possible)? - validations: - required: true +- type: textarea + id: repro + attributes: + label: How can we reproduce it (as minimally and precisely as possible)? + validations: + required: true - - type: textarea - id: additional - attributes: - label: Anything else we need to know? +- type: textarea + id: additional + attributes: + label: Anything else we need to know? - - type: textarea - id: kwokVersion - attributes: - label: Kwok version - value: | -
+- type: textarea + id: kwokVersion + attributes: + label: Kwok version + value: | +
- ```console - $ kwok --version - # paste output here + ```console + $ kwok --version + # paste output here - $ kwokctl --version - # paste output here - ``` + $ kwokctl --version + # paste output here + ``` -
- validations: - required: true +
+ validations: + required: true - - type: textarea - id: osVersion - attributes: - label: OS version - value: | -
- ```console - # On Linux: - $ cat /etc/os-release - # paste output here - $ uname -a - # paste output here +- type: textarea + id: osVersion + attributes: + label: OS version + value: | +
+ ```console + # On Linux: + $ cat /etc/os-release + # paste output here + $ uname -a + # paste output here - # On Darwin: - $ uname -a - # paste output here + # On Darwin: + $ uname -a + # paste output here - # On Windows: - C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture - # paste output here - ``` -
+ # On Windows: + C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture + # paste output here + ``` +
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f932a369c..bc623d09e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ contact_links: - - name: Support Request - url: https://github.com/kubernetes-sigs/kwok/discussions - about: Support request or question relating to Kwok +- name: Support Request + url: https://github.com/kubernetes-sigs/kwok/discussions + about: Support request or question relating to Kwok diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml index c7b92496f..c5133a3e6 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yaml +++ b/.github/ISSUE_TEMPLATE/enhancement.yaml @@ -2,20 +2,20 @@ name: Enhancement Tracking Issue description: Provide supporting details for a feature in development labels: kind/feature body: - - type: textarea - id: feature - attributes: - label: What would you like to be added? - description: | - Feature requests are unlikely to make progress as issues. Please consider engaging with SIGs on slack and mailing lists, instead. - A proposal that works through the design along with the implications of the change can be opened as a KEP. - See https://git.k8s.io/enhancements/keps#kubernetes-enhancement-proposals-keps - validations: - required: true +- type: textarea + id: feature + attributes: + label: What would you like to be added? + description: | + Feature requests are unlikely to make progress as issues. Please consider engaging with SIGs on slack and mailing lists, instead. + A proposal that works through the design along with the implications of the change can be opened as a KEP. + See https://git.k8s.io/enhancements/keps#kubernetes-enhancement-proposals-keps + validations: + required: true - - type: textarea - id: rationale - attributes: - label: Why is this needed? - validations: - required: true +- type: textarea + id: rationale + attributes: + label: Why is this needed? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/failing-test.yaml b/.github/ISSUE_TEMPLATE/failing-test.yaml index 12a32643b..354003133 100644 --- a/.github/ISSUE_TEMPLATE/failing-test.yaml +++ b/.github/ISSUE_TEMPLATE/failing-test.yaml @@ -2,35 +2,35 @@ name: Failing Test description: Report continuously failing tests or jobs in Kwok CI labels: kind/failing-test body: - - type: textarea - id: jobs - attributes: - label: Which jobs are failing? - placeholder: | - Please only use this template for submitting reports about continuously failing tests or jobs in Kwok CI. - validations: - required: true +- type: textarea + id: jobs + attributes: + label: Which jobs are failing? + placeholder: | + Please only use this template for submitting reports about continuously failing tests or jobs in Kwok CI. + validations: + required: true - - type: textarea - id: tests - attributes: - label: Which tests are failing? - validations: - required: true +- type: textarea + id: tests + attributes: + label: Which tests are failing? + validations: + required: true - - type: textarea - id: since - attributes: - label: Since when has it been failing? - validations: - required: true +- type: textarea + id: since + attributes: + label: Since when has it been failing? + validations: + required: true - - type: textarea - id: reason - attributes: - label: Reason for failure (if possible) +- type: textarea + id: reason + attributes: + label: Reason for failure (if possible) - - type: textarea - id: additional - attributes: - label: Anything else we need to know? +- type: textarea + id: additional + attributes: + label: Anything else we need to know? diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 753b935cf..38f24f65d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,18 +1,18 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: weekly - labels: - - "area/dependency" - - "release-note-none" - - "ok-to-test" - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: weekly - labels: - - "area/dependency" - - "release-note-none" - - "ok-to-test" +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + labels: + - "area/dependency" + - "release-note-none" + - "ok-to-test" +- package-ecosystem: "gomod" + directory: "/" + schedule: + interval: weekly + labels: + - "area/dependency" + - "release-note-none" + - "ok-to-test" diff --git a/.github/workflows/bump_releases.yaml b/.github/workflows/bump_releases.yaml index 946365841..9a73f778e 100644 --- a/.github/workflows/bump_releases.yaml +++ b/.github/workflows/bump_releases.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -14,13 +14,13 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'kubernetes-sigs/kwok' }} steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Update - env: - SEND_PR: 'true' - run: | - ./hack/supported_releases.sh + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Update + env: + SEND_PR: 'true' + run: | + ./hack/supported_releases.sh diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index e9f48fc43..eda03b190 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -3,18 +3,18 @@ on: pull_request: types: [opened, edited, synchronize, reopened] branches: - - main + - main jobs: golangci: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - uses: actions/checkout@v4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.55.2 - args: --timeout=30m --config=.golangci.yaml + - uses: actions/setup-go@v5 + with: + go-version: "1.21" + - uses: actions/checkout@v4 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55.2 + args: --timeout=30m --config=.golangci.yaml diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index 8cc1c65c0..8c0188839 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -2,7 +2,7 @@ name: Releases on: push: tags: - - v* + - v* env: PUSH: 'true' @@ -14,48 +14,48 @@ jobs: runs-on: ubuntu-latest if: github.event_name != 'pull_request' steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Log into registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build binary for registry.k8s.io - if: ${{ github.repository == 'kubernetes-sigs/kwok' }} - env: - GH_RELEASE: ${{ github.repository }} - IMAGE_PREFIX: registry.k8s.io/kwok - BINARY_PREFIX: https://github.com/${{ github.repository }}/releases/download - run: | - REF=${{ github.ref }} - GIT_TAG="${REF##*/}" make manifests cross-build - - name: Build binary for ghcr.io - if: ${{ github.repository != 'kubernetes-sigs/kwok' }} - env: - GH_RELEASE: ${{ github.repository }} - IMAGE_PREFIX: ghcr.io/${{ github.repository }} - BINARY_PREFIX: https://github.com/${{ github.repository }}/releases/download - run: | - REF=${{ github.ref }} - GIT_TAG="${REF##*/}" make manifests cross-build - - name: Build kwok image - env: - IMAGE_PREFIX: ghcr.io/${{ github.repository }} - run: | - REF=${{ github.ref }} - GIT_TAG="${REF##*/}" make cross-image - - name: Build cluster image - env: - IMAGE_PREFIX: ghcr.io/${{ github.repository }} - run: | - REF=${{ github.ref }} - GIT_TAG="${REF##*/}" make cross-cluster-image + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build binary for registry.k8s.io + if: ${{ github.repository == 'kubernetes-sigs/kwok' }} + env: + GH_RELEASE: ${{ github.repository }} + IMAGE_PREFIX: registry.k8s.io/kwok + BINARY_PREFIX: https://github.com/${{ github.repository }}/releases/download + run: | + REF=${{ github.ref }} + GIT_TAG="${REF##*/}" make manifests cross-build + - name: Build binary for ghcr.io + if: ${{ github.repository != 'kubernetes-sigs/kwok' }} + env: + GH_RELEASE: ${{ github.repository }} + IMAGE_PREFIX: ghcr.io/${{ github.repository }} + BINARY_PREFIX: https://github.com/${{ github.repository }}/releases/download + run: | + REF=${{ github.ref }} + GIT_TAG="${REF##*/}" make manifests cross-build + - name: Build kwok image + env: + IMAGE_PREFIX: ghcr.io/${{ github.repository }} + run: | + REF=${{ github.ref }} + GIT_TAG="${REF##*/}" make cross-image + - name: Build cluster image + env: + IMAGE_PREFIX: ghcr.io/${{ github.repository }} + run: | + REF=${{ github.ref }} + GIT_TAG="${REF##*/}" make cross-cluster-image diff --git a/.github/workflows/test-site.yaml b/.github/workflows/test-site.yaml index fd935750b..a2c8af8b9 100644 --- a/.github/workflows/test-site.yaml +++ b/.github/workflows/test-site.yaml @@ -21,8 +21,8 @@ jobs: check-site: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Check site - shell: bash - run: | - make -C site check + - uses: actions/checkout@v4 + - name: Check site + shell: bash + run: | + make -C site check diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bc888fd27..5bef3b863 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,45 +35,45 @@ jobs: strategy: matrix: builder: - - docker - - nerdctl - - podman + - docker + - nerdctl + - podman steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - name: Test - shell: bash - run: | - ./hack/e2e-test.sh release/build - - - name: Build - shell: bash - run: | - make build - - - name: Install Nerdctl and Start Containerd - if: ${{ matrix.builder == 'nerdctl' }} - shell: bash - run: | - curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local - sudo systemctl daemon-reload - sudo systemctl enable --now containerd - containerd-rootless-setuptool.sh install - containerd-rootless-setuptool.sh install-buildkit-containerd - - - name: Build Image - shell: bash - run: | - BUILDER=${{ matrix.builder }} make build-image - - - name: Build Cluster Image - shell: bash - run: | - BUILDER=${{ matrix.builder }} make build-cluster-image + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - name: Test + shell: bash + run: | + ./hack/e2e-test.sh release/build + + - name: Build + shell: bash + run: | + make build + + - name: Install Nerdctl and Start Containerd + if: ${{ matrix.builder == 'nerdctl' }} + shell: bash + run: | + curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local + sudo systemctl daemon-reload + sudo systemctl enable --now containerd + containerd-rootless-setuptool.sh install + containerd-rootless-setuptool.sh install-buildkit-containerd + + - name: Build Image + shell: bash + run: | + BUILDER=${{ matrix.builder }} make build-image + + - name: Build Cluster Image + shell: bash + run: | + BUILDER=${{ matrix.builder }} make build-cluster-image test-kwok-e2e: runs-on: ubuntu-latest @@ -99,33 +99,33 @@ jobs: fail-fast: false matrix: case: - - kwok - - kwok-with-cni + - kwok + - kwok-with-cni continue-on-error: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - name: Install Kind - shell: bash - run: | - ./hack/requirements.sh kind - kind version - - - name: Install kubectl - shell: bash - run: | - ./hack/requirements.sh kubectl - kubectl version || : - - - name: Test Workable - shell: bash - run: | - ./hack/e2e-test.sh ${{ matrix.case }}/${{ matrix.case }} + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - name: Install Kind + shell: bash + run: | + ./hack/requirements.sh kind + kind version + + - name: Install kubectl + shell: bash + run: | + ./hack/requirements.sh kubectl + kubectl version || : + + - name: Test Workable + shell: bash + run: | + ./hack/e2e-test.sh ${{ matrix.case }}/${{ matrix.case }} test-kwokctl: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs @@ -134,193 +134,193 @@ jobs: matrix: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources include: - # Windows - # Linux containers are not supported on Windows Runner - # https://github.com/orgs/community/discussions/25491#discussioncomment-3248089 - - os: windows-latest - kwokctl-runtime: binary - - # MacOS amd64 - - os: macos-13 - kwokctl-runtime: binary - # MacOS arm64 - - os: macos-14 - kwokctl-runtime: binary - - # Linux - - os: ubuntu-latest - kwokctl-runtime: binary - - os: ubuntu-latest - kwokctl-runtime: docker - - os: ubuntu-latest - kwokctl-runtime: podman - - os: ubuntu-latest - kwokctl-runtime: kind - - os: ubuntu-latest - kwokctl-runtime: kind-podman - - os: ubuntu-latest - kwokctl-runtime: nerdctl + # Windows + # Linux containers are not supported on Windows Runner + # https://github.com/orgs/community/discussions/25491#discussioncomment-3248089 + - os: windows-latest + kwokctl-runtime: binary + + # MacOS amd64 + - os: macos-13 + kwokctl-runtime: binary + # MacOS arm64 + - os: macos-14 + kwokctl-runtime: binary + + # Linux + - os: ubuntu-latest + kwokctl-runtime: binary + - os: ubuntu-latest + kwokctl-runtime: docker + - os: ubuntu-latest + kwokctl-runtime: podman + - os: ubuntu-latest + kwokctl-runtime: kind + - os: ubuntu-latest + kwokctl-runtime: kind-podman + - os: ubuntu-latest + kwokctl-runtime: nerdctl continue-on-error: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - name: Install CoreUtils for MacOS - if: ${{ startsWith(matrix.os, 'macos-') }} - shell: bash - run: | - brew install coreutils bash - - # No binary is provided by default for control plane components outside of Linux - # https://kwok.sigs.k8s.io/docs/user/kwokctl-platform-specific-binaries/ - - name: Setup Kubernetes Binary - if: ${{ matrix.kwokctl-runtime == 'binary' && matrix.os != 'ubuntu-latest' }} - shell: bash - env: - KUBE_VERSION: v1.29.0 - run: | - mkdir -p "${GITHUB_WORKSPACE//\\//}/workdir" - cat << EOF >"${GITHUB_WORKSPACE//\\//}/workdir/kwok.yaml" - kind: KwokctlConfiguration - apiVersion: config.kwok.x-k8s.io/v1alpha1 - options: - kubeBinaryPrefix: "https://github.com/kwok-ci/k8s/releases/download/${KUBE_VERSION}-kwok.0-$(go env GOOS)-$(go env GOARCH)" - EOF - - # TODO: workaround for https://github.com/actions/runner-images/issues/7753 (caused by https://bugs.launchpad.net/ubuntu/+source/libpod/+bug/2024394). - # Remove this when this issue is fixed and available in the ubuntu runner image - - name: Setup Podman for Ubuntu - if: ${{ matrix.os == 'ubuntu-latest' && (matrix.kwokctl-runtime == 'podman' || matrix.kwokctl-runtime == 'kind-podman') }} - shell: bash - run: | - sudo apt install podman=3.4.4+ds1-1ubuntu1 --allow-downgrades - - - name: Setup Crun on Kind Podman - if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'kind-podman' }} - shell: bash - run: | - # crun >= 1.9.1 is required on Ubuntu 20.04.6 - # https://github.com/kubernetes-sigs/kind/issues/3526 - curl -Lo ./crun https://github.com/containers/crun/releases/download/1.14.3/crun-1.14.3-linux-amd64 - chmod +x ./crun - sudo mv ./crun /usr/bin/crun - - - name: Install Docker for MacOS - if: ${{ startsWith(matrix.os, 'macos-') && ( matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' ) }} - shell: bash - run: | - brew install colima docker || : - colima start --mount $HOME/.kwok/:w --mount $(pwd):w --cpu 4 --memory 8 - - - name: Install Buildx - if: ${{ matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' }} - shell: bash - run: | - ./hack/requirements.sh buildx - docker buildx version - - - name: Docker Info - if: ${{ matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' }} - shell: bash - run: | - docker info - - - name: Install Nerdctl and Start Containerd - if: ${{ matrix.kwokctl-runtime == 'nerdctl' }} - shell: bash - run: | - sudo mkdir -p /etc/cni/net.d - sudo chmod 777 /etc/cni/net.d - curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local - sudo systemctl daemon-reload - sudo systemctl enable --now containerd - containerd-rootless-setuptool.sh install - containerd-rootless-setuptool.sh install-buildkit-containerd - - - name: Setup Podman for Kind - if: ${{ matrix.kwokctl-runtime == 'kind-podman' }} - shell: bash - run: | - sudo mkdir -p /etc/systemd/system/user@.service.d - sudo tee <"${GITHUB_WORKSPACE//\\//}/workdir/kwok.yaml" + kind: KwokctlConfiguration + apiVersion: config.kwok.x-k8s.io/v1alpha1 + options: + kubeBinaryPrefix: "https://github.com/kwok-ci/k8s/releases/download/${KUBE_VERSION}-kwok.0-$(go env GOOS)-$(go env GOARCH)" + EOF + + # TODO: workaround for https://github.com/actions/runner-images/issues/7753 (caused by https://bugs.launchpad.net/ubuntu/+source/libpod/+bug/2024394). + # Remove this when this issue is fixed and available in the ubuntu runner image + - name: Setup Podman for Ubuntu + if: ${{ matrix.os == 'ubuntu-latest' && (matrix.kwokctl-runtime == 'podman' || matrix.kwokctl-runtime == 'kind-podman') }} + shell: bash + run: | + sudo apt install podman=3.4.4+ds1-1ubuntu1 --allow-downgrades + + - name: Setup Crun on Kind Podman + if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'kind-podman' }} + shell: bash + run: | + # crun >= 1.9.1 is required on Ubuntu 20.04.6 + # https://github.com/kubernetes-sigs/kind/issues/3526 + curl -Lo ./crun https://github.com/containers/crun/releases/download/1.14.3/crun-1.14.3-linux-amd64 + chmod +x ./crun + sudo mv ./crun /usr/bin/crun + + - name: Install Docker for MacOS + if: ${{ startsWith(matrix.os, 'macos-') && ( matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' ) }} + shell: bash + run: | + brew install colima docker || : + colima start --mount $HOME/.kwok/:w --mount $(pwd):w --cpu 4 --memory 8 + + - name: Install Buildx + if: ${{ matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' }} + shell: bash + run: | + ./hack/requirements.sh buildx + docker buildx version + + - name: Docker Info + if: ${{ matrix.kwokctl-runtime == 'docker' || matrix.kwokctl-runtime == 'kind' }} + shell: bash + run: | + docker info + + - name: Install Nerdctl and Start Containerd + if: ${{ matrix.kwokctl-runtime == 'nerdctl' }} + shell: bash + run: | + sudo mkdir -p /etc/cni/net.d + sudo chmod 777 /etc/cni/net.d + curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.3/nerdctl-full-1.7.3-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local + sudo systemctl daemon-reload + sudo systemctl enable --now containerd + containerd-rootless-setuptool.sh install + containerd-rootless-setuptool.sh install-buildkit-containerd + + - name: Setup Podman for Kind + if: ${{ matrix.kwokctl-runtime == 'kind-podman' }} + shell: bash + run: | + sudo mkdir -p /etc/systemd/system/user@.service.d + sudo tee <