diff --git a/.github/workflows/test-conformance-hcp.yaml b/.github/workflows/test-conformance-hcp.yaml index c7e61c59..bf97b09a 100644 --- a/.github/workflows/test-conformance-hcp.yaml +++ b/.github/workflows/test-conformance-hcp.yaml @@ -94,12 +94,15 @@ jobs: - name: Setup K3k (from source) if: inputs.k3k_version == '' run: | - export REPO=ttl.sh/$(uuidgen) - export VERSION=1h + export REPO=k3k.local make build make package - make push + make save + + # Import straight into the node's containerd + sudo k3s ctr images import k3k-images.tar + make install # add k3kcli to $PATH diff --git a/.github/workflows/test-conformance-virtual.yaml b/.github/workflows/test-conformance-virtual.yaml index ed9814db..6b998ae1 100644 --- a/.github/workflows/test-conformance-virtual.yaml +++ b/.github/workflows/test-conformance-virtual.yaml @@ -94,12 +94,15 @@ jobs: env: KUBECONFIG: /etc/rancher/k3s/k3s.yaml run: | - export REPO=ttl.sh/$(uuidgen) - export VERSION=1h + export REPO=k3k.local make build make package - make push + make save + + # Import straight into the node's containerd + sudo k3s ctr images import k3k-images.tar + make install # add k3kcli to $PATH diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index 9db4355e..b0b56859 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -61,8 +61,7 @@ jobs: echo "COVERAGE=true" >> $GITHUB_ENV echo "GOCOVERDIR=${{ github.workspace }}/covdata" >> $GITHUB_ENV - echo "REPO=ttl.sh/$(uuidgen)" >> $GITHUB_ENV - echo "VERSION=1h" >> $GITHUB_ENV + echo "REPO=k3k.local" >> $GITHUB_ENV echo "K3S_HOST_VERSION=${{ env.KUBERNETES_VERSION }}+k3s1" >> $GITHUB_ENV - name: Install k3s @@ -100,22 +99,30 @@ jobs: done ' - - name: Build and package and push dev images + - name: Build and package and import dev images env: KUBECONFIG: /etc/rancher/k3s/k3s.yaml - REPO: ${{ env.REPO }} - VERSION: ${{ env.VERSION }} run: | make build make package - make push + make save + + # Import straight into each node's containerd + sudo k3s ctr images import k3k-images.tar + + # The worker VMs have no checkout, so import there directly + for i in 1 2; do + IP="192.168.100.1${i}" + scp -i ./id_rsa -o StrictHostKeyChecking=no k3k-images.tar ubuntu@${IP}:/tmp/ + ssh -i ./id_rsa -o StrictHostKeyChecking=no ubuntu@${IP} \ + "sudo k3s ctr images import /tmp/k3k-images.tar && rm -f /tmp/k3k-images.tar" + done + make install - name: Run e2e tests env: KUBECONFIG: /etc/rancher/k3s/k3s.yaml - REPO: ${{ env.REPO }} - VERSION: ${{ env.VERSION }} run: make E2E_LABEL_FILTER="${{ matrix.label-filter }}" test-e2e - name: Convert coverage data diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6aaae0a5..535b0290 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,8 +61,7 @@ jobs: echo "COVERAGE=true" >> $GITHUB_ENV echo "GOCOVERDIR=${{ github.workspace }}/covdata" >> $GITHUB_ENV - echo "REPO=ttl.sh/$(uuidgen)" >> $GITHUB_ENV - echo "VERSION=1h" >> $GITHUB_ENV + echo "REPO=k3k.local" >> $GITHUB_ENV echo "K3S_HOST_VERSION=${{ env.KUBERNETES_VERSION }}+k3s1" >> $GITHUB_ENV - name: Install k3s @@ -71,11 +70,15 @@ jobs: echo "KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> $GITHUB_ENV - - name: Build and package and push dev images + - name: Build and package and import dev images run: | make build make package - make push + make save + + # Import straight into the node's containerd + sudo k3s ctr images import k3k-images.tar + make install # add k3kcli to $PATH @@ -88,8 +91,6 @@ jobs: env: K3S_HOST_VERSION: "${{ env.K3S_HOST_VERSION }}" KUBECONFIG: /etc/rancher/k3s/k3s.yaml - REPO: ${{ env.REPO }} - VERSION: ${{ env.VERSION }} run: make test-cli - name: Convert coverage data diff --git a/Makefile b/Makefile index c1b06b67..c41133b6 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ REPO ?= rancher COVERAGE ?= false VERSION ?= $(shell git describe --tags --always --dirty --match="v[0-9]*") +IMAGE_ARCHIVE ?= k3k-images.tar + ## Dependencies GOLANGCI_LINT_VERSION := v2.12.2 @@ -60,6 +62,10 @@ push-%: docker push $(REPO)/$*:latest docker push $(REPO)/$*:dev +.PHONY: save +save: ## Save the k3k and k3k-kubelet images to a tar archive, to import them without a registry + docker save -o $(IMAGE_ARCHIVE) $(REPO)/k3k:$(VERSION) $(REPO)/k3k-kubelet:$(VERSION) + .PHONY: test test: ## Run all the tests $(GINKGO) $(GINKGO_FLAGS) --label-filter=$(label-filter)