-
Notifications
You must be signed in to change notification settings - Fork 9
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
Chore: add pip metadata file to app container #1733
Conversation
e7f7115
to
6ce30cc
Compare
similar to having the SHA, will help confirm changes and debug
6ce30cc
to
0a961c2
Compare
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.
Was able to get this running locally 👍
Originally got this error:
machikoyasuda@compiler benefits % docker pull ghcr.io/cal-itp/benefits:pip-freeze
pip-freeze: Pulling from cal-itp/benefits
no matching manifest for linux/arm64/v8 in the manifest list entries
But then I clicked on the OS/Arch tab to find a better pull URL for linux/amd64
:
and that worked fine for me.
Just out of curiosity, why not save this file somewhere that's read by Git, like how Gemfile.lock/package-lock.json/yarn.lock files are?
Good question! So we do save a representation of our dependencies in the This is slightly different, in that we are saving the complete runtime environment, which includes e.g. packages that were installed as dependencies of our dependencies. It also includes the exact version of This would have been more helpful a few weeks ago when we were doing all those package updates across As I was typing the above reply, I realized it might be more useful to see the
|
Runs
pip freeze
pipdeptree
and puts the results inbenefits/static/requirements.txt
before building and publishing the app image.Similar to having the
sha.txt
, this will help confirm changes and debug issues with Python package updates.Reviewing this PR
I ran the Deploy Action manually for this branch to produce an image using the updated workflow, you can see in the logs the results of the updates.
That image is here: https://github.com/cal-itp/benefits/pkgs/container/benefits/129491917?tag=pip-freeze
To test that this works, pull the image locally:
Then run a container based on that image, using the
-P
flag to ensure the port is bound for traffic from your host --> container:Now visit
localhost:PORT/static/requirements.txt
for the dynamic port that Docker assigned, and you should see the list of requirements. Take note that the version specified forbenefits
is tied to the commit SHA (which is the same as the HEAD from this PR):0a961c2e0d59befb1d5195eb7a5d3a1310c81a5b