-
Notifications
You must be signed in to change notification settings - Fork 88
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
e2e-test: enable real TEE on self-hosted runners #284
e2e-test: enable real TEE on self-hosted runners #284
Conversation
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.
LGTM
ok we can't merge this yet, since the e2e test is scheduled on the PR's fork (
see this: #223 (comment) let's do those changes to the workflow in the scope of this PR. sample e2e can still run anywhere |
8208cbd
to
887379a
Compare
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.
Thanks for the PR. We are excited to see the CI on real TEE.
@@ -0,0 +1,43 @@ | |||
#!/usr/bin/env bash | |||
# | |||
# Copyright (c) 2023 Intel Corporation |
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.
Is this Intel
mark intended?
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.
it's copied from CAA, which copied it from kata afaik, so I left the header in
We want to be able to test PRs in a real TEE on self-hosted runners. By default the tests are executed in the fork from which the PR is crated. The fork does not have the self-hosted runners which provide the TEE. We need to run them in the scope of the target repository in a safe fashion that prevents untrusted PRs from running arbitrary code on self-hosted runners. This change is modelled after simular workflows in kata and CAA repos. The matrix-based kbs-e2e workflow has been turned into a reusable workflow that is being called by specific TEE workflows. In this PR that would be the "sample" and "az-snp-vtpm" TEE. For a real TEE we follow the following ceremony: 1) verify whether the PR is authorized to run (a maintainer needs to set a label on the PR). 2) checkout the main branch from the target 3) rebase the changes from the source atop the main branch (using a script copied verbatim from CAA) 4) archive the resulting HEAD and upload it as artifact 5) call the re-usable workflow with the required runners param 6) extract the artifact 7) run the test For the sample TEE steps 1-3 are replaced by a simple checkout Signed-off-by: Magnus Kulke <[email protected]>
887379a
to
54606ce
Compare
Why
We want to be able to test PRs in a real TEE on self-hosted runners. By
default the tests are executed in the fork from which the PR is crated.
The fork does not have the self-hosted runners which provide the TEE. We
need to run them in the scope of the target repository in a safe fashion
that prevents untrusted PRs from running arbitrary code on self-hosted
runners.
fixes: #223
How
This change is modelled after simular workflows in kata and CAA repos.
The matrix-based kbs-e2e workflow has been turned into a reusable
workflow that is being called by specific TEE workflows. In this PR that
would be the "sample" and "az-snp-vtpm" TEE.
For a real TEE we follow the following ceremony:
a label on the PR).
script copied verbatim from CAA)
For the sample TEE steps 1-3 are replaced by a simple checkout
Caveats
This yaml spaghetti is very hard to test. So while this passes actionlint,
it might need several iterations to always work.
The reusable workflow is targetting main and we cannot point it to a
fork, so no workflow run will successfully complete in this PR.