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

Add container build workflow #9

Merged
merged 8 commits into from
Dec 5, 2024
Merged

Add container build workflow #9

merged 8 commits into from
Dec 5, 2024

Conversation

tpoliaw
Copy link
Collaborator

@tpoliaw tpoliaw commented Dec 4, 2024

Build the image on every PR, publish all tags

Copy link

@gilesknap gilesknap left a comment

Choose a reason for hiding this comment

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

looks good. I have one suggestion inline.

If you do a beta tag on this you can check that the Publish works.

.github/workflows/publish.yaml Outdated Show resolved Hide resolved
gilesknap
gilesknap previously approved these changes Dec 4, 2024
@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Dec 4, 2024

Thanks for looking at this.

If you do a beta tag on this you can check that the Publish works.

I tried it (after changing the load/cache suggestion) and it failed because (I think) it's trying to publish to docker.io instead of ghcr.io. Any idea how to set the registry it's using? There doesn't seem to be a registry field in the options.

Also, does the image name need to be set somewhere or is it taken automatically from the repository name?

Container is built on every PR and published on all tags matching `v*`
@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Dec 4, 2024

Think I've figured it out. Things left as an exercise for later PRs

  • The publish build stage doesn't seem to use any caching and downloads/compiles each time. This probably isn't a problem if it's only for releases
  • The description is missing from the package registry
    • Downloading the image and running podman inspect shows that the label it's asking for is present but for some reason it's not being picked up
    • Not a big issue but it'd be good to figure out what's going on
  • Setting up releases in github
    • Might be better the other way around anyway - create the tag as part of the release process
  • There are additional untagged images (manifests?) being push to the registry. No idea what they are but probably don't hurt anything.

@gilesknap
Copy link

gilesknap commented Dec 5, 2024

  • The publish build stage doesn't seem to use any caching and downloads/compiles each time. This probably isn't a problem if it's only for releases

I would expect 'load: true' to resolve this. I certainly don't see it.

  • Downloading the image and running podman inspect shows that the label it's asking for is present but for some reason it's not being picked up
  • Not a big issue but it'd be good to figure out what's going on

I'm not sure which label you are discussing here

  • There are additional untagged images (manifests?) being push to the registry. No idea what they are but probably don't hurt anything.

Note that if you push the same tag twice it does not delete the old image, just removes the tag from it. I'm pretty sure I also see untagged images in addition to that. I plan to create a job for our registries that cleans up untagged images occasionally.

callumforrester
callumforrester previously approved these changes Dec 5, 2024
Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

LGTM

.github/workflows/publish.yaml Show resolved Hide resolved
And don't add 'latest' tag manually - the action adds it automatically
@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Dec 5, 2024

I would expect 'load: true' to resolve this. I certainly don't see it.

See this one as an example. I think I was not tagging the build version correctly though so should be fixed now.

I'm not sure which label you are discussing here

On the package page here it says No description provided and

To provide a description, add the following line to your Dockerfile:
    LABEL org.opencontainers.image.description DESCRIPTION

Note that if you push the same tag twice it does not delete the old image, just removes the tag from it. I'm pretty sure I also see untagged images in addition to that. I plan to create a job for our registries that cleans up untagged images occasionally.

I don't think I've been reusing tags (other than latest) so I think they're only the additional ones. I'll ignore them for now and if you get a job working to clean them up I might borrow it.

Copy link

@gilesknap gilesknap left a comment

Choose a reason for hiding this comment

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

See inline comment.

.github/workflows/publish.yaml Show resolved Hide resolved
@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Dec 5, 2024

I would expect 'load: true' to resolve this. I certainly don't see it.

I think it might just be for tags and not PRs? Epics containers appear to behave the same way, eg here the image is recompiled whereas the PR version of the same commit is using the cached version.

@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Dec 5, 2024

Will close this as it is for now. Any other changes can be their own PR

@tpoliaw tpoliaw merged commit 89f41d1 into main Dec 5, 2024
4 checks passed
@tpoliaw tpoliaw deleted the registry branch December 5, 2024 14:47
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.

3 participants