Skip to content
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

Arm64 support for KOTS images #4394

Merged
merged 7 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
57 changes: 57 additions & 0 deletions .github/actions/build-custom-image-with-apko/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Build and push a custom image with apko'
description: 'Composite action for building and pushing a custom image with apko'
inputs:
context:
description: 'Path to the context directory'
required: true

component:
description: 'Name of the component (e.g. kotsadm, kurl-proxy, etc...)'
required: true

git-tag:
description: 'Git tag'
required: true

image-name:
description: 'Full destination image name'
required: true

registry-username:
description: 'Username to login to registry'
default: ''
required: false

registry-password:
description: 'Password to login to registry'
default: ''
required: false

runs:
using: "composite"
steps:
- uses: actions/download-artifact@v4
with:
pattern: ${{ inputs.component }}-melange-packages-*
path: ./packages/
merge-multiple: true

- uses: actions/download-artifact@v4
with:
pattern: ${{ inputs.component }}-melange-rsa-pub-*
merge-multiple: true

- name: template apko config
shell: bash
run: |
export GIT_TAG=${{ inputs.git-tag }}
envsubst '${GIT_TAG}' < ${{ inputs.context }}/apko.yaml.tmpl > ${{ inputs.context }}/apko.yaml

- uses: chainguard-images/actions/apko-publish@main
with:
config: ${{ inputs.context }}/apko.yaml
archs: amd64,arm64
tag: ${{ inputs.image-name }}
vcs-url: true
generic-user: ${{ inputs.registry-username }}
generic-pass: ${{ inputs.registry-password }}
75 changes: 75 additions & 0 deletions .github/actions/build-custom-melange-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Build a custom melange package'
description: 'Composite action for building a custom melange package'
inputs:
context:
description: 'Path to the context directory'
required: true

component:
description: 'Name of the component (e.g. kotsadm, kurl-proxy, etc...)'
required: true

git-tag:
description: 'Git tag'
required: true

arch:
description: 'Architecture to build for'
required: true

runs:
using: "composite"
steps:
- name: configure packages for arm64
if: inputs.arch == 'arm64'
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y curl jq gettext-base pkg-config

# download schemahero binary for kotsadm-migrations for the specified arch

- if: inputs.component == 'kotsadm-migrations'
uses: falti/dotenv-action@v1
id: dotenv
with:
path: .image.env

- if: inputs.component == 'kotsadm-migrations'
uses: imjasonh/[email protected]

- if: inputs.component == 'kotsadm-migrations'
shell: bash
run: |
crane export schemahero/schemahero:${{ steps.dotenv.outputs.SCHEMAHERO_TAG }} --platform linux/${{ inputs.arch }} - | tar -Oxf - schemahero > migrations/schemahero
chmod +x migrations/schemahero

# build the melange package

- name: template melange config
shell: bash
run: |
export GIT_TAG=${{ inputs.git-tag }}
envsubst '${GIT_TAG}' < ${{ inputs.context }}/melange.yaml.tmpl > ${{ inputs.context }}/melange.yaml

- uses: chainguard-dev/actions/melange-build@main
with:
config: ${{ inputs.context }}/melange.yaml
archs: ${{ inputs.arch }}
sign-with-temporary-key: true

# upload artifacts generated by the melange build so they can later be used by apko

- name: rename melange.rsa.pub
shell: bash
run: mv melange.rsa.pub melange-${{ inputs.arch }}.rsa.pub

- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.component }}-melange-packages-${{ inputs.arch }}
path: ./packages

- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.component }}-melange-rsa-pub-${{ inputs.arch }}
path: ./melange-${{ inputs.arch }}.rsa.pub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Build and push images with apko'
description: 'Composite action for building and pushing images with apko'
name: 'Build and push a dep image with apko'
description: 'Composite action for building and pushing a dep image with apko'
inputs:
apko-config:
description: 'Path to apko config'
Expand Down Expand Up @@ -44,7 +44,7 @@ runs:
if: ${{ inputs.overwrite == 'true' || steps.check-image-exists.outputs.image-exists == 'false' }}
with:
config: ${{ inputs.apko-config }}
archs: x86_64
archs: amd64,arm64
tag: ${{ inputs.image-name }}
vcs-url: true
generic-user: ${{ inputs.registry-username }}
Expand Down
80 changes: 0 additions & 80 deletions .github/actions/build-push-kotsadm-image/action.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/actions/build-push-kotsadm-migrations-image/action.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/actions/build-push-kurl-proxy-image/action.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/actions/cmx-versions/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ inputs:
replicated-api-token:
description: 'Replicated API token for CMX'
required: true
distros:
description: 'A comma-separated list of distros to test against. If not provided, all distros will be tested.'
required: false
default: ''

outputs:
versions-to-test:
Expand Down
Loading
Loading