-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add workflow for publishing container image #327
Add workflow for publishing container image #327
Conversation
Relates to Green-Software-Foundation#252 and Green-Software-Foundation#326 Signed-off-by: Yasumasa Suenaga <[email protected]>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## dev #327 +/- ##
=======================================
Coverage 81.73% 81.73%
=======================================
Files 69 69
Lines 2392 2392
Branches 244 244
=======================================
Hits 1955 1955
Misses 355 355
Partials 82 82 |
That is great @YaSuenag . Is it possible to trigger from merging to Dev for pre-release please? Is if ref is Dev, use pre release naming. Only triggers on merges to Dev or main Speak in the morning... |
Do you mean that you want to use
I think binary release should be happen from GitHub release webhook (= release trigger action). OTOH we can ship nightly build release from GitHub Packages built by GitHub Actions. It is out of scope of ADR-0011, but I agree to ship it for upstream developers and CASDK enthusiasts. I'd like to work for nightly build if it is needed.
In context of
Do you mean "expired" container images should be gone from GitHub Packages? We need to remove them manually and/or using GitHub Actions which are fired like a cron. |
Thank you for your response and chat this morning.
You are right, maybe we don't use expiry, maybe we limit to say the latest 2-5 packages (so old ones get automatically removes however many changes go into dev for a given period) @YaSuenag, Is that clearer? EDIT: |
Signed-off-by: Yasumasa Suenaga <[email protected]>
I updated my PR. This would be fired when some commits are pushed to And also, this workflow attempt to keep recent 3 images which have a tag starts with I believe this workflow works fine, but I want to test it on "real" repo because some configurations might be different from my repo - permissions of GHA and/or GHP, API endpoint of GHP, and so on... Note that the test would publish container image to package are in GSF CASDK. |
bash script to retrieve package ID which should be removed is a bit complex. I think it is more simple if we can use PowerShell. You can see the example on my branch: IMHO bash has more users than PowerShell, so it can get more help for this workflow if we write in bash. However PowerShell is not so minor, and also if most of the SDK maintainers are familiar of PowerShell, we can go through with PowerShell. What do you think about using PowerShell in this proposal? I will use it in this PR if I do not hear any objections. |
Thank you @YaSuenag sorry I missed your message last week. (I thought I had looked out for it before the week end and yet missed it) |
Hi @YaSuenag sorry still on holiday and struggled to find time in front of a computer to test this. Especially to be able to comment on naming as well. I am not sure I understood what the (powershell) script was for (in the latest comment). Can you explain further please? Generally I think it is what we are after. So if I have no chance to comment further on naming and anything else we should look to merge and iterate as needed while we progress. Thank you again very much for this and hope we get each of our general release steps in as we progress through our weekly. |
In release workflow, we have to pick up image IDs to keep. We need to keep recent N container images, it is linked to the commits. Multi-arch containers has 3 images (manifest, AMD64, Arm64 in this case), so we need to scan all of manifests to decide what container images should be kept.
If we need to keep recent 3 commits (1 - 3 in this example), we should remove no.4 images - it means we have to remove ID 100, 101, 102. Unfortunately container images for specific architecture (ID 101 and 102 in this case) are untagged. Thus we need to track all of images from the manifest (ID 100 in this case). This is collection operation. we can do it on bash as you know, but I think it is complex. So I want to implement it in PowerShell. However I'm concerned whether there are any disadvantages in point of maintenance. (mainly in point of maintainer skill)
Agree. This PR is first step to implement ADR-0011, and it does not affect the SDK behavior and other workflows. We just need to decide to use bash or PowerShell before merging IMHO. |
LGTM. Approved |
Pull Request
Relates to #252 and #326
Summary
Publish WebAPI container to GitHub Packages (container registry) when new release is published on GitHub release page. It would happen on both pre-release and official relaese.
pre
is added as suffix of container tag like<release tag>pre
latest
Note that this workflow would not be fired when official release is migrated from pre-release - it means container image of official release wouldn't be generated even if you uncheck the pre-release checkbox in existing release in edit mode.
Changes
Checklist
Are there API Changes?
No
Is this a breaking change?
No
Anything else?
I want to discuss about following topics before merging:
released
trigger if it is needed.pre
as a suffix of container image tag if this workflow is fired by pre-release. Is this suffix is needed?