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

Try to avoid complicated logic to select k3s version #3154

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

jimmykarily
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

role-duration-seconds: 1200
role-session-name: AWSCIPush
- name: Build and push AWS image
if: matrix.flavor == 'ubuntu' && matrix.flavorRelease == '24.04' && matrix.variant == 'standard' && matrix.model == 'generic' && matrix.arch == 'amd64'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will match all 3 k3s versions. I don't see any way to upload only one without hardcoding it (or doing the things I deleted in this PR).

The other option is to upload the code image but if the user tries to "reset" to a standard one using userdata (which is a very possible thing), the partitions won't be big enough for the standard image. They can specify sizes for the partitions I think but the recovery one can't be resized cause it's what is booted that point.

Any ideas?

Copy link
Contributor Author

@jimmykarily jimmykarily Jan 29, 2025

Choose a reason for hiding this comment

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

We discussed this in Slack and decided to just push a core image. We will then implement a flag in auroraboot to set the "minimum image size" which will override the calculated one when building the cloud image. This way we can set this to a hardcoded value that can fit all our image (standard or core).

#3155

Comment on lines -376 to -389
k3s_version=$(echo '${{ needs.get-standard-matrix.outputs.matrix }}' | \
jq -r '.include | map(.k3s_version | split("+")[0]) | unique |
map(
capture("^(?<major>[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)(-(?<pre>.*))?$") |
{
major: (.major | tonumber),
minor: (.minor | tonumber),
patch: (.patch | tonumber),
is_stable: (if .pre == null then 1 else 0 end),
pre: (.pre // "")
}
) | max_by(.major, .minor, .patch, .is_stable, .pre) |
"\(.major).\(.minor).\(.patch)\(.pre | if . == "" then "" else "-"+. end)"' | \
sed -E 's/^/v/; s/$/-k3s1/')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This "worked" kind of, but the artifacts we push are named:

 quay.io/kairos/ubuntu:24.10-standard-amd64-generic-v3.3.1-rc2-k3sv1.32.1-rc2-k3sk3s1

and this script was looking for:

quay.io/kairos/ubuntu:24.04-standard-amd64-generic-v3.3.1-rc2-k3sv1.32.1-rc2-k3s1

I think the first one is wrong which is a different issue to look at but in any case, I thought it would be better if we didn't try to construct the image name again so this PR tries to push the AWS at a point where the image name is still available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proper fix will follow:

#3155

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily requested a review from a team January 30, 2025 12:26
@jimmykarily jimmykarily merged commit 0628bcb into master Jan 30, 2025
55 of 56 checks passed
@jimmykarily jimmykarily deleted the simplify-aws-uploading branch January 30, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants