-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arm64 support for KOTS images (#4394)
* Arm64 support for KOTS images
- Loading branch information
Showing
83 changed files
with
1,029 additions
and
10,721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
62 changes: 0 additions & 62 deletions
62
.github/actions/build-push-kotsadm-migrations-image/action.yml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.