From 8d7683cc04a60ce3540062454e4c3e601eab0cf8 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Oct 2024 15:09:24 +0000 Subject: [PATCH 1/2] platform windows --- .github/workflows/pr.yml | 44 +++++++-------------------- Makefile | 4 +-- scripts/publish-image-runtime-windows | 2 +- 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dc63d41378..82f9866129 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,41 +10,19 @@ name: PR Build permissions: contents: read jobs: - build-amd64: + test-amd64: runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64 steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Dapper + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: test build image run: | - curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper - chmod +x /usr/local/bin/dapper - - name: Build - run: dapper -f Dockerfile --target dapper make dapper-ci - - name: Test - run: dapper -f Dockerfile --target dapper make test - - name: Prepare Test Logs on Failure - if: ${{ failure() }} - run: | - sudo cp -r /tmp/rke2-logs ~/rke2-logs - sudo chown -R $USER:$USER ~/rke2-logs - ls -la ~/rke2-logs - - name: Upload Logs on Failure - if: ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - name: rke2-test-logs - path: ~/rke2-logs/ - build-arm64: - runs-on: runs-on,runner=8cpu-linux-arm64,run-id=${{ github.run_id }},image=ubuntu22-full-arm64,hdd=64 - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Dapper - run: | - curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper - chmod +x /usr/local/bin/dapper - - name: Build - run: | - dapper -f Dockerfile --target dapper make dapper-ci - \ No newline at end of file + export GOARCH=amd64 + export GOOS=linux + export IID_FILE=$(mktemp) + export IID_FILE_FLAG="--iidfile ${IID_FILE}" + make test-publish-image-runtime-windows diff --git a/Makefile b/Makefile index 50ad2fbeed..2f631a43a0 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,8 @@ build-image-runtime: ## Build the runtime image publish-image-runtime: ./scripts/publish-image-runtime -.PHONY: publish-image-runtime-windows -publish-image-runtime-windows: +.PHONY: test-publish-image-runtime-windows +test-publish-image-runtime-windows: ./scripts/publish-image-runtime-windows .PHONY: validate diff --git a/scripts/publish-image-runtime-windows b/scripts/publish-image-runtime-windows index e435ad6f81..d61a912d8b 100755 --- a/scripts/publish-image-runtime-windows +++ b/scripts/publish-image-runtime-windows @@ -16,5 +16,5 @@ docker buildx build ${IID_FILE_FLAG} \ --tag ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 \ --target windows-runtime \ --file Dockerfile.windows \ - --push \ + --platform windows/amd64 \ . From ad8573efeee6ecf6e362ff9179570a67caf82569 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Oct 2024 16:58:38 +0000 Subject: [PATCH 2/2] update buildplatform --- Dockerfile.windows | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index f2c65dfc73..e8730541ee 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,4 +1,4 @@ -FROM alpine:3.20 AS build +FROM --platform=$BUILDPLATFORM alpine:3.20 AS build RUN apk --no-cache add \ curl \ @@ -38,7 +38,7 @@ RUN curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/ins WORKDIR /source # End Dapper stuff -FROM rancher/hardened-containerd:v1.7.22-k3s1-build20241010-amd64-windows AS containerd +FROM --platform=$BUILDPLATFORM rancher/hardened-containerd:v1.7.22-k3s1-build20241010-amd64-windows AS containerd FROM build as windows-runtime-collect ARG KUBERNETES_VERSION=dev