Reset ci with sbom and cosign - #2490
SamYuan1990 wants to merge 1 commit into
Conversation
6362d4f to
2a8805a
Compare
894f65c to
e5d1588
Compare
|
@sunya-ch and @nikimanoledaki |
e5d1588 to
ef9f608
Compare
|
related with #2235 |
ef9f608 to
d20b82b
Compare
nikimanoledaki
left a comment
There was a problem hiding this comment.
Thanks @SamYuan1990. There are three main issues:
- Please reorder the steps so that it's: build,
make push, SBOM,cosign sign. Cosign can only sign a digest that exists after a push. Right now it fails. - Add
--yesto all five cosign calls. - Remove
oci://fromCHART_REF. Only keep it forhelm push- cosign needs a bareregistry/repo:tag.
| on: # yamllint disable-line rule:truthy | ||
| on: | ||
| schedule: | ||
| - cron: 0 6 * * * # 每天早上6点(UTC) |
There was a problem hiding this comment.
| - cron: 0 6 * * * # 每天早上6点(UTC) | |
| - cron: 0 6 * * * # daily at 6:00 UTC |
| shell: bash | ||
| run: | | ||
| IMAGE="${{ inputs.image_base }}/kepler:${{ inputs.version }}" | ||
| cosign attach sbom --sbom image-kepler-${{ inputs.version }}.spdx.json "${IMAGE}" |
There was a problem hiding this comment.
cosign attach sbom has been deprecated. Please use the newer equivalent:
cosign attest --predicate sbom.spdx.json --type spdxjson <image>
hi @nikimanoledaki , For "reorder the steps", in my point of view: As "pipeline as code", having a reusable workflow for both release, pr build and daily build as implementation level. We can "test" steps for release in daily changes. Hence, at implementation level, reusable workflow build image, build binary, build helm will have their own response for build(asset) and meta(as openSSF asset), receive parameters for build tag.(such like version) at invoker/trigger level, the workflow, push(means code merge to default branch), release(means a release tag), .... represent the reason as event trigger, owns value(as build tag, version) to implementation level, and response for push or not. For cosign, I will change to https://docs.sigstore.dev/quickstart/quickstart-ci/ , and have some comments in code. The code will be built on github action as WDYT? |
|
Thanks @SamYuan1990, I agree with creating a reusable workflow if it works for every scenario, and I also agree with using |
|
The docs say that signing the artifact should happen after pushing to the artifact registry: https://docs.sigstore.dev/quickstart/quickstart-ci/#signing-and-verifying-a-container-image |
58534e1 to
addd7b1
Compare
Signed-off-by: oe1019 <yy19902439@126.com>
addd7b1 to
972d8ec
Compare
I suppose it's about what are we going to "release"/provide. Another founding as we can't test cosign unless this been merged, as it's require a write permission on GHA token. |
| # Image push is intentionally left to the caller workflow. | ||
| # The caller is expected to: | ||
| # 1. Log into the container registry (e.g. docker login) | ||
| # 2. Push the image and optionally attach the signed SBOM or the bundle. |
There was a problem hiding this comment.
nit: cleanup extra comments
There was a problem hiding this comment.
Well, I want to keep the comments, we can discuss on the format.
The reason I want to keep those comments as I hope either coding agent or people can know on how to use this action.yaml.
Any suggestions?
There was a problem hiding this comment.
Better to place it in either CLAUDE.md/AGENTS.md or maybe in our ci docs https://github.com/sustainable-computing-io/kepler/tree/main/docs/developer
vprashar2929
left a comment
There was a problem hiding this comment.
@SamYuan1990 Couple of things that look broken with this PR:
- Release never actually signs. The composites default to
false. Release never setssign: trueSo the sign steps don't run. - Aren't we uploading the wrong signature files? 🤔 Cosign is writing
.sigstore.jsonbundles but the release artifact globs still look for the old.certAFAIU they won't match so signature won't show up on the GH releases. - We stopped publishing images on main. The existing workflow built and pushed to Quay via
publish-imageThe new workflow only builds it doesn't push. Can you elaborate on why this change was done? - We used to helm push to
oci://...Now we only package and attach the chart to GH release. Why this was done? Please elaborate more - The existing workflow on main also runs tests/codecov and scorecard. With your changes they won't run on the push to main. Can you please revert it or elaborate why the change was done?
Also putting id-token: write at the top of the workflow that runs on PRs is broader than we need. Safer pattern would be default to readonly at top level and elevate the access only on the jobs that actually sign!
Smaller nits:
- Cosign install is done repeatedly. This could live inside the composite actions so callers stay thin.
- Prefer docker/login-action over
echo $TOKEN | docker login
|
@SamYuan1990 Have you tested this on your fork? |
| name: helm-artifacts | ||
| retention-days: 1 | ||
| path: | | ||
| helm-releases/*.tgz |
There was a problem hiding this comment.
@vprashar2929 , I suppose helm publish process is not changed in this PR.
hi @vprashar2929, I will check item 1 and item 2. For item 1 the sign is set to false as default as pr can't get For item 3, I will leave to @nikimanoledaki , as I don't know how our build process going to be, before rebuild, we have latest build and pre merge build. ref https://github.com/SamYuan1990/kepler/blob/main/.github/workflows/push.yml#L14, https://github.com/SamYuan1990/kepler/blob/main/.github/workflows/image.yml#L9 For item 4, as I checked in pr diff, seems out of this PR's scope. For item 5, I will add tests/codecov and scorecard back. My own fork is before rewrite, I will find a way to test on my own fork, but as we have condition in CI as For nits and code changes, I will check and update after we got agreement on item 1,2,3. As a summary: Todo list:
Out of scope:
BTW, I hope coding agent can help us on CI changes. |
|
This PR is stale because it has been open 60 days with no activity. |
related with #2235