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

Bump and adapt to new kairos-init #3214

Merged
merged 7 commits into from
Feb 22, 2025
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
9 changes: 5 additions & 4 deletions .github/workflows/reusable-build-flavor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:

echo "flavor=$distro" >> $GITHUB_OUTPUT
echo "flavor_release=$tag" >> $GITHUB_OUTPUT
- run: |
echo ${{ inputs.event_type }}
- uses: actions/checkout@v4
- run: |
git fetch --prune --unshallow
with:
fetch-depth: '0'
- name: Set Version
run: echo "VERSION=$(git describe --tags --dirty )" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
Expand Down Expand Up @@ -102,6 +102,7 @@ jobs:
VARIANT=${{ inputs.variant }}
KUBERNETES_DISTRO=${{ inputs.kubernetes_distro }}
KUBERNETES_VERSION=${{ inputs.kubernetes_version }}
VERSION=${{ env.VERSION }}
- name: Build raw image
if: ${{ inputs.model != 'rpi3' && inputs.model != 'generic' }}
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
VARIANT=${{ inputs.variant }}
KUBERNETES_VERSION=${{ env.FIXED_KUBERNETES_VERSION }}
TRUSTED_BOOT=${{ inputs.trusted_boot }}
VERSION=${{ github.ref_name }}
- name: Grype table
uses: anchore/scan-action@v6.1.0
with:
Expand Down Expand Up @@ -148,6 +149,7 @@ jobs:
VARIANT=${{ inputs.variant }}
KUBERNETES_VERSION=${{ env.FIXED_KUBERNETES_VERSION }}
TRUSTED_BOOT=${{ inputs.trusted_boot }}
VERSION=${{ github.ref_name }}
- name: Sign image
env:
COSIGN_YES: true
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/reusable-uki-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
echo "flavor=$distro" >> $GITHUB_OUTPUT
echo "flavor_release=$tag" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set Version
run: echo "VERSION=$(git describe --tags --dirty )" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v5
timeout-minutes: 5
Expand Down Expand Up @@ -108,6 +112,7 @@ jobs:
MODEL=${{ inputs.model }}
VARIANT=${{ inputs.variant }}
TRUSTED_BOOT=true
VERSION=${{ env.VERSION }}
- name: Build uki ISO 🔧
run: |
mkdir build
Expand Down
26 changes: 7 additions & 19 deletions images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
ARG BASE_IMAGE=ubuntu:20.04
ARG VARIANT
ARG TARGETARCH
ARG FRAMEWORK_VERSION=v2.15.14

FROM quay.io/kairos/kairos-init:v0.2.4 AS kairos-init
FROM --platform="linux/${TARGETARCH}" quay.io/kairos/framework:${FRAMEWORK_VERSION} AS framework
FROM quay.io/kairos/kairos-init:v0.2.6 AS kairos-init

FROM ${BASE_IMAGE} AS base-kairos
ARG VARIANT=core
ARG MODEL=generic
ARG TRUSTED_BOOT=false
ARG KUBERNETES_DISTRO=k3s
ARG KUBERNETES_VERSION=latest
ARG FRAMEWORK_VERSION
ARG FRAMEWORK_VERSION=v2.16.1
ARG VERSION

COPY --from=kairos-init /kairos-init /kairos-init
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s install -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s init -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug --validate -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}"
RUN rm /kairos-init

FROM base-kairos AS kairos-core

FROM base-kairos AS kairos-standard
COPY --from=framework /usr/bin/luet /usr/bin/luet
COPY --from=framework /etc/luet/luet.yaml /etc/luet/luet.yaml
RUN luet install -y utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this happening on kairos-init now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


FROM kairos-${VARIANT} AS kairos-final
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s install -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}" --version "${VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s init -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}" --version "${VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug --validate -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}" --version "${VERSION}"
RUN rm /kairos-init
7 changes: 0 additions & 7 deletions tests/upgrade_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var _ = Describe("k3s upgrade manual test", Label("upgrade-with-cli"), func() {
currentVersion, err := vm.Sudo(getVersionCmd)
Expect(err).ToNot(HaveOccurred())
By(fmt.Sprintf("Checking current version: %s", currentVersion))
Expect(currentVersion).To(ContainSubstring("v"))

By(fmt.Sprintf("Upgrading to: %s", containerImage))
out, err := vm.Sudo("kairos-agent --debug upgrade --force --source oci://" + containerImage)
Expand All @@ -71,12 +70,6 @@ var _ = Describe("k3s upgrade manual test", Label("upgrade-with-cli"), func() {
return err
}, 10*time.Minute, 10*time.Second).ShouldNot(HaveOccurred())

var v string
Eventually(func() string {
v, _ = vm.Sudo(getVersionCmd)
return v
// TODO: Add regex semver check here
}, 10*time.Minute, 10*time.Second).Should(ContainSubstring("v"), v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check seemed intentional. What changed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

freeform semver for now.

Still this check is useless. Checking that the version just contains a v its absurd? Even if the upgrade didnt pass, this check would pass so I dont see how this is a useful check at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we added that because we had a bug with a missing v . This covers it enough :D.

})
})
})
Loading