From 1d267b00b9b1a46e0afb51e9a1f62382158aa7e0 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Fri, 10 Jan 2025 15:37:59 +0200 Subject: [PATCH] Unblock CI (#219) * Bump CI os and Python versions The integration tests use Python 3.8 / ubuntu 20.04. The problem is that k8s-snap tests use type specifiers that require Python 3.10. For this reason, we'll switch to Python 3.10 / ubuntu 22.04. * Install lxd using k8s-snap composite action This simplifies the gh workflows and also applies the Docker iptables workaround. * Use self-hosted runners k8s-snap switched to self-hosted CI runners as the default Github ones didn't have enough resources. We'll update the k8s-dqlite CI job to use self-hosted runners as well when running k8s-snap integration tests. * Fix r install * Remove "get" checks The e2e tests are currently failing because of this k8s-dqlite error: k8s.k8s-dqlite[1947]: time="2025-01-09T15:00:22Z" level=error msg="error while range on /registry/clusterroles/system:aggregate-to-view : unexpected limit: want 0, got 1" A separate PR is removing this check: https://github.com/canonical/k8s-dqlite/pull/212 That being considered, we'll apply this change here to unblock the CI. * fix self-hosted runner tag --- .github/workflows/k8s-snap-integration.yaml | 10 +++------- .github/workflows/performance.yaml | 16 +++------------- pkg/kine/server/get.go | 7 ------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/.github/workflows/k8s-snap-integration.yaml b/.github/workflows/k8s-snap-integration.yaml index c23b0cbf..02a9f764 100644 --- a/.github/workflows/k8s-snap-integration.yaml +++ b/.github/workflows/k8s-snap-integration.yaml @@ -15,7 +15,7 @@ concurrency: jobs: build: name: K8s-snap Integration Test - runs-on: ubuntu-20.04 + runs-on: self-hosted-linux-amd64-jammy-large steps: - name: Checking out repo @@ -23,7 +23,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install tox run: pip install tox - name: Install Go @@ -34,11 +34,7 @@ jobs: run: | sudo snap download k8s --channel=latest/edge --basename k8s - name: Install lxd - run: | - sudo snap refresh lxd --channel 5.21/stable - sudo lxd init --auto - sudo usermod --append --groups lxd $USER - sg lxd -c 'lxc version' + uses: canonical/k8s-snap/.github/actions/install-lxd@main - name: Build k8s-dqlite run: | make static diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index 5fc5f600..ecafc1ab 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -21,7 +21,7 @@ env: jobs: build: name: K8s-snap Performance Test - runs-on: ubuntu-20.04 + runs-on: self-hosted-linux-amd64-jammy-large steps: - name: Harden Runner uses: step-security/harden-runner@v2 @@ -42,20 +42,10 @@ jobs: go-version: "1.22" - name: Set-up R run: | - sudo apt install r-base + sudo apt-get install -y r-base sudo Rscript -e 'install.packages(c("ggplot2", "dplyr", "optparse"), repos="https://cloud.r-project.org")' - name: Install lxd - run: | - sudo snap refresh lxd --channel 5.21/stable - sudo lxd init --auto - sudo usermod --append --groups lxd $USER - sg lxd -c 'lxc version' - - name: Ensure lxd network traffic flows by removing docker if installed - run: | - if command -v docker >/dev/null 2>&1; then - echo "Docker is installed, purging it" - sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli containerd runc - fi + uses: canonical/k8s-snap/.github/actions/install-lxd@main - name: Download latest k8s-snap run: | sudo snap download k8s --channel=latest/edge --basename k8s diff --git a/pkg/kine/server/get.go b/pkg/kine/server/get.go index 03daeb4a..7990237a 100644 --- a/pkg/kine/server/get.go +++ b/pkg/kine/server/get.go @@ -23,13 +23,6 @@ func (l *LimitedServer) get(ctx context.Context, r *etcdserverpb.RangeRequest) ( attribute.Int64("revision", r.Revision), ) - if len(r.RangeEnd) != 0 { - return nil, fmt.Errorf("unexpected rangeEnd: want empty, got %s", r.RangeEnd) - } - if r.Limit != 0 { - return nil, fmt.Errorf("unexpected limit: want 0, got %d", r.Limit) - } - rev, kv, err := l.backend.List(ctx, string(r.Key), "", 1, r.Revision) if err != nil { return nil, err