istopwg / ippsample

IPP sample implementations.
http://istopwg.github.io/ippsample
Apache License 2.0
225 stars 83 forks source link

Improve docker image autobuild workflow #245

Closed thenewguy closed 3 years ago

thenewguy commented 3 years ago

Supersedes #242

Improves #239, #240

Adds the option to push image to Github container registry and/or docker hub

Uses the following secrets:

Simple sanity check runs most commands (see #244) expected to be available. A follow up commit can test they work as expected.

Currently, the docker image is built and tested for the master branch after the test workflow completes. It is built on every commit for PRs to provide continuous feedback during development.

The image is explicitly tagged with the branch/tag, sha, and timestamp. Not sure how you will want release tags to work, but the template is laid out. The workflow_run trigger is used to ensure we only push images that have completed the "Build and Test" job on the master branch with a successful conclusion per github.event.workflow_run.conclusion == 'success'. It would be simple to add :stable or something along those lines when pushing the image - this should be straightforward to adjust in a follow up commit.

Images are saved as artifacts with a unique name based on these details to shuffle between steps. This keeps development images from getting into the docker repo and lingering around. Currently, we rely on the artifact retention of 1 day to remove old artifacts after jobs complete. There is supposedly an API for removing them but it is unclear if this can work within the running workflow (refer to https://github.com/actions/upload-artifact/issues/5)

thenewguy commented 3 years ago

Let me know if I have missed something important - otherwise, I think this covers all the bases now

thenewguy commented 3 years ago

Sorry - working on this to keep busy while waiting at hospital - running this against my branch to demonstrate working function

thenewguy commented 3 years ago

Ok - demonstrated to work as expected

Build passes - https://github.com/thenewguy/ippsample/actions/runs/1329947866 Then docker runs - https://github.com/thenewguy/ippsample/actions/runs/1329953289

This pushed to a docker repo under my namespace since I merged it into my personal branch: https://hub.docker.com/repository/docker/thenewguy/ippsample/tags?page=1&ordering=last_updated

This is complete and ready to merge

thenewguy commented 3 years ago

@michaelrsweet are you happy with this approach? I have a little bit of sitting around time available for the next day or so - want to make sure you like it before moving on to something else

thenewguy commented 3 years ago

Just wanted to update I've been able to work this docker image into some initial testing! Awesome! Thanks for providing the Dockerfile to get all of this rolling

michaelrsweet commented 3 years ago

@thenewguy This looks fine, still not sure what we'll be doing to officially support this but happy to merge it...

thenewguy commented 3 years ago

Ok - I will create an issue for the follow up action