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

test: Update Trustee deployment to match the simplifed deployment overlays #2099

Merged

Conversation

stevenhorsman
Copy link
Member

In confidential-containers/trustee#521 I did some work to enable Trustee to work on s390x (without SE) and generally simplify deployments, such that overlays are only needed for ibm-se, not for x86/s390x in general.

This PR adapts us to use this approach.

@stevenhorsman stevenhorsman requested a review from a team as a code owner October 8, 2024 15:51
@stevenhorsman stevenhorsman added the test_e2e_libvirt Run Libvirt e2e tests label Oct 8, 2024
@stevenhorsman stevenhorsman marked this pull request as draft October 9, 2024 15:08
@stevenhorsman stevenhorsman force-pushed the non-se-kbs-deployment branch 2 times, most recently from e6a9176 to 46ae2c7 Compare October 9, 2024 16:48
@stevenhorsman stevenhorsman marked this pull request as ready for review October 9, 2024 16:48
@stevenhorsman stevenhorsman force-pushed the non-se-kbs-deployment branch 4 times, most recently from 3a6c506 to 5964eef Compare October 10, 2024 18:13
if err != nil {
return err
}
keyFilePath := "../../kbs/config/kubernetes/overlays/" + platform + "/key.bin"
keyFilePath := "../../kbs/config/kubernetes/" + overlaysPath + "/key.bin"
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to use absolute path for privateKey and keyFilePath based on the TRUSTEE_REPO_PATH?

Copy link
Member Author

Choose a reason for hiding this comment

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

I started writing this code, but then noticed const TRUSTEE_REPO_PATH = "../trustee", so the TRUSTEE_PATH isn't absolute. I'm happy to continue the refactor to reduce the number of relative paths we have though?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created 4281c1e - I'm not sure how happy I am with it, so feel free to give critical feedback and suggestions!

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like the refactor might have broken the tests too, so I'll look into this locally

Copy link
Member

Choose a reason for hiding this comment

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

Based on your comment, it looks like a general refactor is needed to use absolute path. How about you merge this and handle the refactor as a separate PR ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think this commit does help reduce relative paths of relatives paths (in the old code we'd have something like ../../trustee/../../<file>) so we just have the single relative path here now to ../trustee from test/e2e, but there is room for improvement later. I think I already have 1/2 refactors in this area already, so we can steadily get it better.

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to just take on the battle here, so have re-work the commit to remove the relative trustee path too. It relies on NewKeyBrokerService to set it up initially, but as all the references to the trustee path are in that func, or methods of KeyBrokerService I think we'll be okay.

Bump to pick up the commit with the s390x changes
supported

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
- Update deployments and add support for non-SE s390x
KBS deployment based on the updated trustee deployment
overlays
- Make uname command compatible: `uname -i` doesn't seem
to work on all platforms, so switch to `uname -m`
which seems to be portable and gives the same result on
ubuntu x86 & s390x

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Refactor to reduce usage of relative paths

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
@stevenhorsman
Copy link
Member Author

FYI the linting failure is (I believe) caused by github updating their default runner, so I have try to address this in #2120

Copy link
Member

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

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

/lgtm

@stevenhorsman stevenhorsman merged commit d12859d into confidential-containers:main Oct 16, 2024
28 checks passed
@stevenhorsman stevenhorsman deleted the non-se-kbs-deployment branch October 17, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_e2e_libvirt Run Libvirt e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants