Skip to content

Commit

Permalink
fix: go mod tidy (#171)
Browse files Browse the repository at this point in the history
* fix: go mod tidy

Signed-off-by: Nianyu Shen <[email protected]>

* ci: split arm64/amd64 jobs

Signed-off-by: Nianyu Shen <[email protected]>

* use arm runner

Signed-off-by: Nianyu Shen <[email protected]>

---------

Signed-off-by: Nianyu Shen <[email protected]>
  • Loading branch information
nianyush authored Jan 31, 2025
1 parent cf1a3af commit c8faae2
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/provider-packaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,27 @@ jobs:
with:
version: "latest"
- run: earthly --ci +lint
build-provider-package:
runs-on: ubuntu-latest
permissions:
packages: write
build:
strategy:
matrix:
include:
- runner: ubuntu-latest
platform: linux/amd64
fips: false
image_repository: us-docker.pkg.dev/palette-images/edge/kairos-io
- runner: ubuntu-latest
platform: linux/amd64
fips: true
image_repository: us-docker.pkg.dev/palette-images-fips/edge/kairos-io
- runner: github-arm64-2c-8gb
platform: linux/arm64
fips: false
image_repository: us-docker.pkg.dev/palette-images/edge/kairos-io
- runner: github-arm64-2c-8gb
platform: linux/arm64
fips: true
image_repository: us-docker.pkg.dev/palette-images-fips/edge/kairos-io
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand All @@ -42,11 +59,17 @@ jobs:
with:
version: "latest"
- run: echo "${{ secrets.ARTIFACT_IMG_PUSH_EDGE }}" | base64 -d | docker login -u _json_key --password-stdin us-docker.pkg.dev
- run: earthly --ci --push --output +provider-package-all-platforms --IMAGE_REPOSITORY=us-docker.pkg.dev/palette-images/edge/kairos-io
build-fips-provider-package:
- run: earthly --ci --push --output --platform=${{ matrix.platform }} +build-provider-package --IMAGE_REPOSITORY=${{ matrix.image_repository }} --FIPS_ENABLED=${{ matrix.fips }}
push:
needs: build
strategy:
matrix:
include:
- fips: false
image_repository: us-docker.pkg.dev/palette-images/edge/kairos-io
- fips: true
image_repository: us-docker.pkg.dev/palette-images-fips/edge/kairos-io
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand All @@ -60,4 +83,4 @@ jobs:
with:
version: "latest"
- run: echo "${{ secrets.ARTIFACT_IMG_PUSH_EDGE }}" | base64 -d | docker login -u _json_key --password-stdin us-docker.pkg.dev
- run: earthly --ci --push --output +provider-package-all-platforms --IMAGE_REPOSITORY=us-docker.pkg.dev/palette-images-fips/edge/kairos-io --FIPS_ENABLED=true
- run: earthly --ci --push --output +provider-package-merge --IMAGE_REPOSITORY=${{ matrix.image_repository }} --FIPS_ENABLED=${{ matrix.fips }}
6 changes: 1 addition & 5 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,4 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: earthly --ci --output +provider-package-all-platforms --IMAGE_REPOSITORY=ghcr.io/kairos-io
- name: Push to testing
run: |
docker tag ghcr.io/kairos-io/provider-kubeadm:latest ttl.sh/kairos-io/provider-kubeadm-${{ github.sha }}:24h
docker push ttl.sh/kairos-io/provider-kubeadm-${{ github.sha }}:24h
- run: earthly --ci --output +build-provider-package
17 changes: 11 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ build-provider:

build-provider-package:
DO +VERSION
ARG TARGETARCH
ARG VERSION=$(cat VERSION)
FROM scratch
COPY +build-provider/agent-provider-kubeadm /system/providers/agent-provider-kubeadm
COPY scripts/ /opt/kubeadm/scripts/
SAVE IMAGE --push $IMAGE_REPOSITORY/provider-kubeadm:latest
SAVE IMAGE --push $IMAGE_REPOSITORY/provider-kubeadm:${VERSION}
SAVE IMAGE --push $IMAGE_REPOSITORY/provider-kubeadm:${VERSION}-${TARGETARCH}

lint:
FROM golang:$GOLANG_VERSION
Expand Down Expand Up @@ -211,11 +211,16 @@ cosign:
DO +SAVE_IMAGE --VERSION=$VERSION

docker-all-platforms:
BUILD --platform=linux/amd64 +docker
BUILD --platform=linux/amd64 +docker

provider-package-merge:
BUILD --platform=linux/amd64 --platform=linux/arm64 +provider-package-pull

provider-package-pull:
ARG TARGETARCH
FROM ${IMAGE_REPOSITORY}/provider-kubeadm:${VERSION}-${TARGETARCH}
SAVE IMAGE --push ${IMAGE_REPOSITORY}/provider-kubeadm:${VERSION}

provider-package-all-platforms:
BUILD --platform=linux/amd64 +build-provider-package
BUILD --platform=linux/arm64 +build-provider-package

cosign-all-platforms:
BUILD --platform=linux/amd64 +cosign
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/kairos-io/kairos/provider-kubeadm
go 1.23.1

require (
github.com/coreos/go-systemd/v22 v22.5.0
github.com/kairos-io/kairos-sdk v0.5.0
github.com/mudler/go-pluggable v0.0.0-20230126220627-7710299a0ae5
github.com/mudler/yip v1.10.0
Expand Down Expand Up @@ -33,7 +32,6 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down Expand Up @@ -137,8 +135,6 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down

0 comments on commit c8faae2

Please sign in to comment.