-
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
Merged
fitzthum
merged 1 commit into
confidential-containers:main
from
mkulke:mkulke/enable-az-snp-e2e-test
Jan 12, 2024
+149
−12
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: KBS e2e with az-snp-vtpm TEE | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# Note on repository checkout: pull_request_target sets `GITHUB_SHA` to the | ||
# "last commit on the PR base branch", meaning that by default `actions/checkout` | ||
# is going to checkout the repository main branch. In order to pick up the pull | ||
# request code, this workflow uses the `github.event.pull_request.head.sha` | ||
# property to get the last commit on the HEAD branch. One limitation of this approach | ||
# is that, unlike the `pull_request` event, the checked pull request isn't necessarily | ||
# rebased to main (so it is up to the workflow to ensure the pull request is rebased | ||
# **before* the workflow is triggering) | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
# This workflow will be run if the pull request is labeled 'test_e2e' | ||
- labeled | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
authorize: | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'test_e2e') | ||
steps: | ||
- run: "true" | ||
|
||
checkout-and-rebase: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Rebase the source | ||
run: ./kbs/hack/ci-helper.sh rebase-atop-of-the-latest-target-branch | ||
|
||
- name: Archive source | ||
run: git archive -o kbs.tar.gz HEAD | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./kbs.tar.gz | ||
|
||
e2e-test: | ||
needs: | ||
- authorize | ||
- checkout-and-rebase | ||
uses: confidential-containers/kbs/.github/workflows/kbs-e2e.yml@main | ||
with: | ||
runs-on: '["self-hosted","azure-cvm"]' | ||
tarball: kbs.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: KBS e2e with sample TEE | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
checkout: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Archive source | ||
run: git archive -o kbs.tar.gz HEAD | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./kbs.tar.gz | ||
|
||
e2e-test: | ||
needs: checkout | ||
uses: confidential-containers/kbs/.github/workflows/kbs-e2e.yml@main | ||
with: | ||
sample: true | ||
tarball: kbs.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
TARGET_BRANCH=${TARGET_BRANCH:-main} | ||
|
||
function rebase_atop_of_the_latest_target_branch() { | ||
if [ -n "${TARGET_BRANCH}" ]; then | ||
echo "Rebasing atop of the latest ${TARGET_BRANCH}" | ||
# Recover from any previous rebase left halfway | ||
git rebase --abort 2> /dev/null || true | ||
if ! git rebase "origin/${TARGET_BRANCH}"; then | ||
# if GITHUB_WORKSPACE is defined and an architecture is not equal to x86_64 | ||
# (mostly self-hosted runners), then remove the repository | ||
if [ -n "${GITHUB_WORKSPACE:-}" ] && [ "$(uname -m)" != "x86_64" ]; then | ||
echo "Rebase failed, cleaning up a repository for self-hosted runners and exiting" | ||
cd "${GITHUB_WORKSPACE}"/.. | ||
sudo rm -rf "${GITHUB_WORKSPACE}" | ||
else | ||
echo "Rebase failed, exiting" | ||
fi | ||
exit 1 | ||
fi | ||
fi | ||
} | ||
|
||
function main() { | ||
action="${1:-}" | ||
|
||
case "${action}" in | ||
rebase-atop-of-the-latest-target-branch) rebase_atop_of_the_latest_target_branch;; | ||
*) >&2 echo "Invalid argument"; exit 2 ;; | ||
esac | ||
} | ||
|
||
main "$@" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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