Skip to content

build: Make CAREN mindthegap reg multiarch #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ jobs:
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- if: steps.list-changed.outputs.changed == 'true'
uses: docker/setup-qemu-action@v3

- if: steps.list-changed.outputs.changed == 'true'
uses: docker/setup-buildx-action@v3

- if: steps.list-changed.outputs.changed == 'true'
name: Run chart-testing (lint)
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
echo "After removing files:"
df -h

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- name: Run e2e tests
run: devbox run -- make e2e-test E2E_LABEL='provider:${{ inputs.provider }}' E2E_SKIP='${{ inputs.skip }}' E2E_FOCUS='${{ inputs.focus }}'
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: 0

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- name: Install devbox
uses: jetify-com/[email protected]
with:
Expand Down
47 changes: 44 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,54 @@ archives:
- cluster-api-runtime-extensions-nutanix

dockers:
- id: helm-registry-container
- image_templates:
# Specify the image tag including `-amd64` suffix if the build is not a snapshot build or is not being built on
# amd64 machine. This allows for using the snapshot image build without the architecture specific suffix
# consistently on local machines, i.e. can always use `ghcr.io/nutanix-cloud-native/caren-helm-reg:v<VERSION>` on the machine the snapshot
# is built on.
#
# For a release build the `-amd64` suffix will always be included and the `docker_manifests` specification below
# will create the final multiplatform manifest to be pushed to the registry.
- 'ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "amd64")) }}-amd64{{ end }}'
use: buildx
dockerfile: ./hack/addons/mindthegap-helm-registry/Dockerfile
extra_files:
- hack/addons/mindthegap-helm-registry/repos.yaml
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.CommitDate}}"
- "--label=org.opencontainers.image.title=caren-helm-reg"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- '--label=org.opencontainers.image.version=v{{ trimprefix .Version "v" }}'
- "--label=org.opencontainers.image.source={{.GitURL}}"
- image_templates:
# Specify the image tag including `-arm64` suffix if the build is not a snapshot build or is not being built on
# arm64 machine. This allows for using the snapshot image build without the architecture specific suffix
# consistently on local machines, i.e. can always use `ghcr.io/nutanix-cloud-native/caren-helm-reg:v<VERSION>` on the machine the snapshot
# is built on.
#
# For a release build the `-arm64` suffix will always be included and the `docker_manifests` specification below
# will create the final multiplatform manifest to be pushed to the registry.
- 'ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "arm64")) }}-arm64{{ end }}'
use: buildx
dockerfile: ./hack/addons/mindthegap-helm-registry/Dockerfile
extra_files:
- hack/addons/mindthegap-helm-registry/repos.yaml
build_flag_templates:
- "--platform=linux/arm64"
- "--pull"
- "--label=org.opencontainers.image.created={{.CommitDate}}"
- "--label=org.opencontainers.image.title=caren-helm-reg"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- '--label=org.opencontainers.image.version=v{{ trimprefix .Version "v" }}'
- "--label=org.opencontainers.image.source={{.GitURL}}"

docker_manifests:
- name_template: ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}
image_templates:
- 'ghcr.io/nutanix-cloud-native/caren-helm-reg:{{ .Version }}'
- ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}-amd64
- ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}-arm64

kos:
- id: cluster-api-runtime-extensions-nutanix
Expand All @@ -121,7 +162,7 @@ kos:
org.opencontainers.image.created: "{{ .CommitDate }}"
org.opencontainers.image.title: "{{ .ProjectName }}"
org.opencontainers.image.revision: "{{ .FullCommit }}"
org.opencontainers.image.version: v{{ .Version }}
org.opencontainers.image.version: v{{ trimprefix .Version "v" }}
org.opencontainers.image.source: "{{ .GitURL }}"
platforms:
- linux/amd64
Expand Down
4 changes: 2 additions & 2 deletions hack/addons/mindthegap-helm-registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ghcr.io/mesosphere/mindthegap:v1.13.4
FROM ghcr.io/mesosphere/mindthegap:v1.14.3
# this gets called by goreleaser so the copy source has to be the path relative to the repo root.
RUN --mount=source=./hack/addons/mindthegap-helm-registry/repos.yaml,target=/repos.yaml ["/ko-app/mindthegap", "create", "helm-bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts.tar"]
RUN --mount=source=./hack/addons/mindthegap-helm-registry/repos.yaml,target=/repos.yaml ["/ko-app/mindthegap", "create", "bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts.tar"]
VOLUME /certs
CMD ["serve", "bundle", "--bundle=/tmp/helm-charts.tar", "--listen-port=5000", "--listen-address=0.0.0.0", "--tls-private-key-file=/certs/tls.key", "--tls-cert-file=/certs/tls.crt"]
Loading