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

Build and push kbs-client binary #349

Conversation

portersrc
Copy link
Member

This PR attempts to partially address #333

It adds a workflow to build a statically linked kbs-client and push it to ghcr.io.

Limitations: It only covers x86-64 linux for now. It only supports the sample_only kbs-client.

Hard-code --features to sample_only for now, because it covers current
use cases without overcomplicating the link.

Signed-off-by: Chris Porter <porter@ibm.com>
@portersrc portersrc requested a review from sameo as a code owner March 8, 2024 19:35
Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

Thanks for this! Only a little question.

.github/workflows/kbs-client-build-and-push.yaml Outdated Show resolved Hide resolved
@portersrc portersrc force-pushed the issue333-release-kbs-client-binary branch 2 times, most recently from c72e505 to 91434a6 Compare March 13, 2024 14:46
Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

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

Nice. One question

build_and_push:
env:
RUSTC_VERSION: 1.76.0
runs-on: ubuntu-22.04
Copy link
Member

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.

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 don't think I checked this; great question; will check it now.

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 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?

Copy link
Member

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 the pull_request to the list of triggering events. Then you will need to skip the execution of Log in to ghcr.io and Push to ghcr.io steps based on the event type (because these steps will fail on pull_request).

See .github/workflows/kbs-e2e-az-tdx-vtpm.yaml as an example of workflow that run for two events and skip steps conditionally.

Copy link
Member Author

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 that make cli-static-x86_64-linux completes on the runner. It built fine (GHA result here). I changed it back to on: 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).

kbs/Makefile Show resolved Hide resolved
@portersrc portersrc force-pushed the issue333-release-kbs-client-binary branch from 91434a6 to 5857fd3 Compare March 28, 2024 21:37
Signed-off-by: Chris Porter <porter@ibm.com>
@portersrc portersrc force-pushed the issue333-release-kbs-client-binary branch from 5857fd3 to e266c20 Compare March 28, 2024 21:47
Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

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

LGTM

@Xynnn007 Xynnn007 merged commit ac59d33 into confidential-containers:main Apr 1, 2024
15 checks passed
@portersrc
Copy link
Member Author

I just noticed that the "latest" tag didn't get applied correctly:
https://github.com/confidential-containers/trustee/actions/runs/8502445853/job/23286620681#step:6:13
I will look at it.

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