-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: add zizmor Docker image #319
Conversation
Thanks @trallard, I appreciate you opening this!
Good call IMO 🙂 -- however, I wonder if we could keep the PyPI installation (i.e. via
Pointing to
SGTM -- either a reusable workflow or a new
Yep! Ideally this PR would include those doc changes, although they could also be a follow-up. |
Yay! Thanks for the quick follow up. These all seem good so I will work the rest of the things and can add some docs in this PR, then I can iterate if needed.
I can certainly do that. Should be easy enough to swap. |
Hey @trallard! Do you intend to pick this up sometime soon? No problem at all if not, but if you think it's gonna be >1 month I'm happy to build on top of what you've got here so I can land this soon-ish 🙂 |
Hey there I took some time off but should be able to pick this in the next week or so. |
Will this be an official docker image? Are you also planning to add this image Docker Hub? |
It'll be official in the sense that it comes from this repo, so as official as the
It'll be available on GHCR most likely, since GHCR is easy to publish to with GitHub Actions. |
Now that I have finally caught up with my massive backlog, I can wrap this up so I am taking this out of To test locally (i.e., build the Docker image), one can run the following command with a valid zizmor version:
Since I ended up using If we are happy with this as is I can add some docs right away. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @trallard! I think I'd prefer having the Docker build be in its own workflow, for reasons in the review comments below. But I'm curious to hear what you think 🙂
name: docker | ||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} | ||
# Only run if the release job was successfully completed | ||
needs: [release] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a bit of a race condition with this, sadly: PyPI's propagation can take a few minutes IME, so running immediately after a release
might fail due to the index not listing the release yet.
I think there are two (easy-ish) options here:
- Add some kind of blocking "wait for PyPI" job so that the flow goes
release -> wait-for-pypi -> docker-build
instead - Move this to a separate
docker-publish.yml
or similar that can be triggered separately, e.g. by aworkflow_dispatch
with atag:
input
I'd be OK with either of these but a slight preference for (2), especially since we can give it a cron
trigger that'll do the update automatically 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was initially going for 2-ish, but then I realized the trigger would need to be other than a release tag so that this did not end up running before the PyPI release was ready, so I moved this inside the PyPI workflow, though I completely forgot about the potential delays on the PyPI side.
Let me move this out into a separate workflow again, as in 2) and we can sort out the trigger event (cron
or something else).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another alternative could be using the built wheels (already uploaded to the artefacts) to install zizmor (thus avoiding any potential delays on the PyPI side of things) so all the workflows would trigger from the same release tag event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could work, although in that case we'd need to reimplement the wheel/tag matching, right? I think a separate workflow + trigger is good for now 🙂
Thank you for working on this. I'm excited to try it out! |
Closes #135
I am opening a WIP PR since I have some outstanding questions.
Notes 📝
uv
Docker image. However, I think that might be overkill for a "vanilla" image for Zizmor, so I used the Rust image instead (bookworm-slim,
which also helps keep the image quite small). That way, we provide the minimal required amount and leave it to users to build off as they need.Questions/needs input 💬
ENTRYPOINT ["/bin/bash"]
, or would it be best to point it to Zizmor directly? ✅release.yml
workflow. ✅linux/amd64
andlinux/arm64
images.TODO for @woodruffw:
docker
environment for the build and publish Docker job