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

[UKI] Measure #2028

Merged
merged 23 commits into from
Dec 20, 2023
Merged

[UKI] Measure #2028

merged 23 commits into from
Dec 20, 2023

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Nov 27, 2023

Part of #1152

Earthfile Outdated
@@ -456,7 +456,7 @@ uki-tools-image:
# This is for easy testing SecureBoot locally for development purposes
# Installing this keys in other place than a VM for testing SecureBoot is irresponsible
uki:
FROM ubuntu
FROM +uki-tools-image
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the only mention of uki-tools-image target, should we get rid of the target?

Copy link
Member Author

Choose a reason for hiding this comment

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

For now, but other targets will probably reuse it, the one that creates the upgrade artifacts probably

This used to be consumed by at least 3 targets, not sure what have I done to screw that up

build_uki.sh Outdated
@@ -0,0 +1,144 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

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

i miss where this file is being consumed

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently a manual process to generate the images as I'm still working on it, order, retouches and also needs an extra path to generate the artifacts

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

lgtm

Earthfile Outdated
ARG KAIROS_VERSION=$(cat VERSION)
FROM scratch
COPY +uki-image-artifacts/efi /
SAVE IMAGE --push $IMAGE_REPOSITORY_ORG/${FAMILY}:${KAIROS_VERSION}-uki
Copy link
Member

Choose a reason for hiding this comment

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

yup as discussed you should be able to compose the new name with naming.sh

    ARG OS_NAME=kairos-${VARIANT}-${FLAVOR}-${FLAVOR_RELEASE}
    RUN KAIROS_VERSION=$(cat ./VERSION) \
        OS_VERSION=$(cat ./VERSION) \
        OS_LABEL=$(cat ./VERSION) \
        OS_LABEL=$(naming.sh container_artifact_label) \
        OS_REPO=$(naming.sh container_artifact_repo) \
        ARTIFACT=$(naming.sh bootable_artifact_name) \
        envsubst >>/etc/os-release </usr/lib/os-release.tmpl
    RUN KAIROS_VERSION=$(cat ./VERSION) naming.sh container_artifact_name > /IMAGE

    ARG _CIMG=$(cat ./IMAGE)

Copy link
Member

Choose a reason for hiding this comment

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

we used to have a command for this, but since for a little while it was done in the dockerfile, I removed it, maybe I should bring it back, but we can do that after this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

We will soon replace the naming.sh script with versioneer (though the standalone cli or kairos-agent). If you find naming.sh needing any changes, let's coordinate first.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes indeed, we could have the uki as part of the name maybe in the versioneer? no idea where, if as the model or something (so generic and uki) ?

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

just the issue with the naming which you already brought up, other than that lgtm

 - dont save unsigned artifact as its not used
 - use the same base image for uki target instead of 2 different ones
 - save local artifacts on uki-artifacts target

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Also add agent dev branch to uki build script
Add also init stanza to uki cmdline

Signed-off-by: Itxaka <itxaka@kairos.io>
Also add the version to config and efi files

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we signing with a publicly available private key? We are not pushing the uki artifact when we release right?

Copy link
Member Author

Choose a reason for hiding this comment

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

We currently are not pushing anything anywhere.

This is for testing mainly and done with public private keys and certs, all of them used in the uki test pipeline.

Final releases would need a specific workflow to sign and measure them with our private keys.

But that is like a whole other conversation on how to sign them, where, who has the key, how we cycle them, etc..

Not willing to open that discussion right now as it's a big one 🤣

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, I'm just making sure I got this right.

Itxaka and others added 4 commits December 16, 2023 08:59
Move to ubuntu 23.04 to test TPM encryption on uki
Use immmucore from master brnahc until we have a new release
Expand uki tests to check that we are encrypting partitions

Signed-off-by: Itxaka <itxaka@kairos.io>
Itsd known to work with the encryption as it has a high enough systemd
version

Adds cracklib-dicts as those are used when validating the luks password

Uses agent from main branch as that one has support for uki and newer
kcrypt libs

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka
Copy link
Member Author

Itxaka commented Dec 16, 2023

tested and it seems to work on fedora >=38 and ubuntu >= 23.10
tumbleweed supposedly should work but I was not able to make it work somehow and had very weird issues.

Signed-off-by: Itxaka <itxaka@kairos.io>
so its compatible with fedora 38 and 39

Signed-off-by: Itxaka <itxaka@kairos.io>
They are already in the kairos folder, so only the version is needed in
the file name.

Same thing with conf file, we keep the name and thats it

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka
Copy link
Member Author

Itxaka commented Dec 18, 2023

cancelled everything but the uki job

@@ -367,79 +348,158 @@ uki-tools-image:
# NOTE: NEVER EVER EVER use this keys for signing anything that its going outside your computer
# This is for easy testing SecureBoot locally for development purposes
# Installing this keys in other place than a VM for testing SecureBoot is irresponsible
uki:
Copy link
Contributor

Choose a reason for hiding this comment

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

New versions are now in the latest framework so we should be able to use
those directly

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka
Copy link
Member Author

Itxaka commented Dec 19, 2023

This should be finished.

A big change here is that we are moving to use the "main" framework image. That ok for you @mauromorales @jimmykarily @mudler ? I could also cut a new version once @jimmykarily has merged the versioneer stuff, but currently the main framework version has a kairos-agent RC version, so it feels bad to cut a release with RC versions.

@jimmykarily
Copy link
Contributor

This should be finished.

A big change here is that we are moving to use the "main" framework image. That ok for you @mauromorales @jimmykarily @mudler ? I could also cut a new version once @jimmykarily has merged the versioneer stuff, but currently the main framework version has a kairos-agent RC version, so it feels bad to cut a release with RC versions.

Oh I forgot we now need to build a new framework image in order to get a new kairos-agent tested. My changes on the kairos-agent should be done. I tagged another rc this morning but it's still building the arm package: https://github.com/kairos-io/packages/actions/runs/7260525990/job/19779962604

If you can to tag kairos-agent as stable and release a framework image with that, I'm fine with it. It will help me test my PR too.

Earthfile Outdated
@@ -9,7 +9,7 @@ ARG LUET_VERSION=0.35.0
# renovate: datasource=docker depName=aquasec/trivy
ARG TRIVY_VERSION=0.47.0
# renovate: datasource=github-releases depName=kairos-io/kairos-framework
ARG KAIROS_FRAMEWORK_VERSION="v2.4.4"
ARG KAIROS_FRAMEWORK_VERSION="main"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we override this in release pipelines. This means we will be releasing from "main" images. Is it needed only because of the kairos-agent rc? Let's cut a stable one then.

@mauromorales
Copy link
Member

This should be finished.

A big change here is that we are moving to use the "main" framework image. That ok for you @mauromorales @jimmykarily @mudler ? I could also cut a new version once @jimmykarily has merged the versioneer stuff, but currently the main framework version has a kairos-agent RC version, so it feels bad to cut a release with RC versions.

For me it's ok to move to main but in that case I don't see the value of producing versions for the framework images. I think relying on main can be tricky because what do we release against? It means that either we always have a moving target or that master tests nightly while release build a version. What I mean is that if we consider these issues not to cause many problems then it's a go for me. But for a different component that moves faster I would say it's better not to.

@mudler
Copy link
Member

mudler commented Dec 19, 2023

what maybe makes sense is having releases using tagged framework images, while main can just consume main (so can be used for development)

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
@Itxaka
Copy link
Member Author

Itxaka commented Dec 19, 2023

bumped to use latest framework released version.

We changed the messages and exit values if the kcrypt failed so we need
to adapt the tests

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka merged commit d62455d into kairos-io:master Dec 20, 2023
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants