-
Notifications
You must be signed in to change notification settings - Fork 0
set tag to main #16
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
base: main
Are you sure you want to change the base?
set tag to main #16
Changes from all commits
310247f
cd3fff1
291a07d
0bcb789
0e02e7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: Build Azure CAPI VM image | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Kuberentes version | ||
| required: true | ||
| type: string | ||
| tag: | ||
| description: ck8s-capi tag | ||
| required: true | ||
| type: string | ||
| builder_image: | ||
| description: image builder image | ||
| required: true | ||
| type: string | ||
| default: "ghcr.io/elastisys/image-builder-amd64:main" | ||
|
|
||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: Kubernetes version | ||
| required: true | ||
| type: string | ||
| tag: | ||
| description: ck8s-capi tag | ||
| required: true | ||
| type: string | ||
| builder_image: | ||
| description: image builder image | ||
| required: true | ||
| type: string | ||
| default: "ghcr.io/elastisys/image-builder-amd64:main" | ||
|
|
||
| env: | ||
| version: ${{ inputs.version }} | ||
| tag: ${{ inputs.tag }} | ||
| docker_image: ${{ inputs.builder_image }} | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: ./images/capi | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| build-image: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: replace variables | ||
| run: | | ||
| package="${version}-1.1" | ||
| series="${version%.*}" | ||
|
|
||
| sed -r \ | ||
| -e "s/\\\$KUBERNETES_SERIES/${series}/" \ | ||
| -e "s/\\\$KUBERNETES_VERSION/${version}/" \ | ||
| -e "s/\\\$KUBERNETES_DEB_VERSION/${package}/" \ | ||
| -e "s/\\\$IMAGE_TAG/${tag}/" \ | ||
| <"template.json" >"kubernetes.json" | ||
|
|
||
| - name: build azure image | ||
| run: | | ||
| image_name="ubuntu-2404-kube-${version%%-*}-ck8s-capi-${tag}" | ||
|
|
||
| export SIG_IMAGE_DEFINITION="${image_name}" | ||
| export SIG_PUBLISHER="elastisys" | ||
| export SIG_OFFER="ck8s-capi" | ||
| export SIG_SKU="${image_name}" | ||
|
|
||
| docker run -i --rm \ | ||
| -e PACKER_VAR_FILES -e PACKER_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | ||
| -e SIG_IMAGE_DEFINITION -e SIG_PUBLISHER -e SIG_OFFER -e SIG_SKU \ | ||
| -e AZURE_SUBSCRIPTION_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e AZURE_TENANT_ID -e AZURE_LOCATION \ | ||
| -e RESOURCE_GROUP_NAME -e GALLERY_NAME -e BUILD_RESOURCE_GROUP_NAME \ | ||
| -v ${{ github.workspace }}/images/capi:/tmp/host \ | ||
| ${{ env.docker_image }} build-azure-sig-ubuntu-2404-gen2 | ||
|
|
||
| env: | ||
| PACKER_VAR_FILES: /tmp/host/kubernetes.json | ||
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID}} | ||
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
| AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} | ||
| RESOURCE_GROUP_NAME: ${{ secrets.RESOURCE_GROUP_NAME }} | ||
| GALLERY_NAME: ${{ secrets.GALLERY_NAME }} | ||
| BUILD_RESOURCE_GROUP_NAME: ${{ secrets.RESOURCE_GROUP_NAME }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Build CAPI VM image with manual input | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: k8s version | ||
| required: true | ||
| type: string | ||
| default: "1.33.1" | ||
| tag: | ||
| description: ck8s capi version | ||
| required: true | ||
| type: string | ||
| default: "0.8" | ||
| builder_image: | ||
| description: image builder image | ||
| required: true | ||
| type: string | ||
| default: "ghcr.io/elastisys/image-builder-amd64:main" | ||
|
|
||
| env: | ||
| PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| jobs: | ||
| build-azure-image: | ||
| uses: ./.github/workflows/build-azure-capi-image.yml | ||
| with: | ||
| version: ${{ inputs.version }} | ||
| tag: ${{ inputs.tag }} | ||
| docker_image: ${{ inputs.docker_image }} | ||
| secrets: inherit | ||
| build-openstack-image: | ||
| uses: ./.github/workflows/build-openstack-capi-image.yml | ||
| with: | ||
| version: ${{ inputs.version }} | ||
| tag: ${{ inputs.tag }} | ||
| docker_image: ${{ inputs.docker_image }} |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||
| name: Build CAPI image builder | ||||||||
|
|
||||||||
| on: | ||||||||
| push: | ||||||||
| branches: | ||||||||
| - main | ||||||||
|
|
||||||||
| env: | ||||||||
| IMAGE_NAME: image-builder | ||||||||
| REGISTRY: ghcr.io/elastisys | ||||||||
|
|
||||||||
| jobs: | ||||||||
| build-image-builder: | ||||||||
| runs-on: ubuntu-24.04 | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v5 | ||||||||
|
|
||||||||
| - name: "Login to GitHub Container Registry" | ||||||||
| uses: docker/login-action@v1 | ||||||||
| with: | ||||||||
| registry: ghcr.io | ||||||||
| username: ${{ github.actor }} | ||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||
|
|
||||||||
| - name: run make docker-build | ||||||||
| run: make docker-build | ||||||||
| env: | ||||||||
| TAG: main | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Can't find this target in the root Makefile. I assume this is this target. If so wouldn't we need to add this?
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might have unintentionally removed the |
||||||||
|
|
||||||||
| - name: run make docker-push | ||||||||
| run: make docker-push | ||||||||
| env: | ||||||||
| TAG: main | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: Build OpenStack VM CAPI image | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Kubernetes version | ||
| required: true | ||
| type: string | ||
| tag: | ||
| description: ck8s-capi tag | ||
| required: true | ||
| type: string | ||
| builder_image: | ||
| description: image builder image | ||
| required: true | ||
| type: string | ||
| default: "ghcr.io/elastisys/image-builder-amd64:main" | ||
|
|
||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: Kubernetes version | ||
| required: true | ||
| type: string | ||
| tag: | ||
| description: ck8s-capi tag | ||
| required: true | ||
| type: string | ||
| builder_image: | ||
| description: image builder image | ||
| required: true | ||
| type: string | ||
| default: "ghcr.io/elastisys/image-builder-amd64:main" | ||
|
|
||
|
|
||
| env: | ||
| version: ${{ inputs.version }} | ||
| tag: ${{ inputs.tag }} | ||
| docker_image: ${{ inputs.builder_image }} | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: ./images/capi | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| build-image: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: run patchs | ||
| run: | | ||
| git apply patches/dockerfile.patch | ||
|
|
||
| - name: Enable KVM | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| - name: replace variables | ||
| run: | | ||
| package="${version}-1.1" | ||
| series="${version%.*}" | ||
|
|
||
| sed -r \ | ||
| -e "s/\\\$KUBERNETES_SERIES/${series}/" \ | ||
| -e "s/\\\$KUBERNETES_VERSION/${version}/" \ | ||
| -e "s/\\\$KUBERNETES_DEB_VERSION/${package}/" \ | ||
| -e "s/\\\$IMAGE_TAG/${tag}/" \ | ||
| <"template.json" >"kubernetes.json" | ||
|
|
||
| - name: add user | ||
| run: | | ||
| mkdir -p ${{ github.workspace }}/output | ||
| sudo useradd -ms /bin/bash imagebuilder | ||
| sudo chmod -R 777 ${{ github.workspace }}/output | ||
|
|
||
| - name: build openstack image | ||
| run: | | ||
| docker run --device=/dev/kvm -i --rm \ | ||
| -e PACKER_VAR_FILES=/tmp/host/kubernetes.json -e PACKER_LOG -e PACKER_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | ||
| -v ${{ github.workspace }}/images/capi:/tmp/host -v ${{ github.workspace }}/output:/home/imagebuilder/output:rw \ | ||
| ${{ env.docker_image }} build-qemu-ubuntu-2404-efi | ||
|
|
||
| - name: store openstack image | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ubuntu-2404-efi-kube-${{ env.version }}-ck8s-capi-${{ env.tag }} | ||
| path: ${{ github.workspace }}/output/ubuntu-2404-efi-kube-${{ env.version }}-ck8s-capi-${{ env.tag }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ | |
| !packer | ||
| !Makefile | ||
| !azure_targets.sh | ||
| !template.json | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: This would overwrite the
maintag each time? Wouldn't we also want the commit hash to be able to use older builds if needed?Maybe both, so you can reference the latest build with
mainbut also have a copy of each commit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create an issue for that as a CI task