-
Notifications
You must be signed in to change notification settings - Fork 90
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
Build and push kbs-client binary #349
Merged
Xynnn007
merged 2 commits into
confidential-containers:main
from
portersrc:issue333-release-kbs-client-binary
Apr 1, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,39 @@ | ||
name: Build and push kbs-client | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_push: | ||
env: | ||
RUSTC_VERSION: 1.76.0 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUSTC_VERSION }} | ||
override: true | ||
profile: minimal | ||
- name: Log in to ghcr.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build a statically linked kbs-client for x86_64 linux | ||
working-directory: kbs | ||
run: | | ||
make cli-static-x86_64-linux | ||
- name: Push to ghcr.io | ||
working-directory: target/x86_64-unknown-linux-gnu/release | ||
run: | | ||
commit_sha=${{ github.sha }} | ||
oras push \ | ||
portersrc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ghcr.io/confidential-containers/staged-images/kbs-client:sample_only-x86_64-linux-gnu-${commit_sha},latest \ | ||
kbs-client |
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
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.
Hi @portersrc ! I don't remember the last time I built static executables on Ubuntu, so wondering if you need to install the static libc package. On my fedora 39 laptop I had to install glibc-static to test this static build.
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.
I don't think I checked this; great question; will check it now.
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.
I can confirm that
gcc -static
works on a simple test. Also 22.04 package list includes libc6-dev, and the (debian) file list for libc6-dev includes libc.a, etc. (So I think we're OK?)The easier thing is to just verify that this workflow succeeds before merging, but I don't see this workflow getting kicked... Do you know how/why?
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.
Hi @portersrc !
Cool!
The workflow didn't get kicked because it is configure to run on
push
. One way to test it is to add thepull_request
to the list of triggering events. Then you will need to skip the execution ofLog in to ghcr.io
andPush to ghcr.io
steps based on the event type (because these steps will fail onpull_request
).See
.github/workflows/kbs-e2e-az-tdx-vtpm.yaml
as an example of workflow that run for two events and skip steps conditionally.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 pointers! I looked at the yaml file, but to test at least part of this PR, I did something cruder: I changed to
on: pull_request
and commented out the ghcr login and push. This at least checks thatmake cli-static-x86_64-linux
completes on the runner. It built fine (GHA result here). I changed it back toon: push
, as intended for this PR. But I guess we need it to merge in order to verify the oras step works (though I tested with a personal repo, and it looks OK).