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

Support user-specified image pull policy #132

Merged
merged 9 commits into from
Oct 25, 2024
Merged

Support user-specified image pull policy #132

merged 9 commits into from
Oct 25, 2024

Conversation

maxmynter
Copy link
Collaborator

@maxmynter maxmynter commented Oct 24, 2024

Closes #124

Todo's

  • Tests
  • Tests need IfNotPresent as pull policy to support running e2e tests in cluster with no image registry available
  • Resolve and remove comment in.../runner/ray.py: 46
  • Update docs (.../guides/exeution-modes.md)

Notes

I have thought a bit about where to put the pull policy. Candidates were the Image or ImageOptions, or a standalone argument.
I decided on the former as ImageOptions are defined when the Job is defined but a user may want to change the pull policy without touching the job. The pull policy is more ephemeral than ImageOptions.

As we build up the Image on the backend we can at that point inject the pull policy.

A separate object is imo not warranted as we never need a policy without an association to an image.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 83.67347% with 8 lines in your changes missing coverage. Please review.

Project coverage is 56.89%. Comparing base (abdc993) to head (1e600a0).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
backend/src/jobq_server/runner/docker.py 62.50% 3 Missing ⚠️
client/src/cli/commands/submit.py 50.00% 2 Missing ⚠️
client/src/openapi_client/api_client.py 0.00% 1 Missing ⚠️
...ent/src/openapi_client/models/image_pull_policy.py 91.66% 1 Missing ⚠️
client/src/openapi_client/rest.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   56.60%   56.89%   +0.28%     
==========================================
  Files          62       63       +1     
  Lines        3132     3164      +32     
==========================================
+ Hits         1773     1800      +27     
- Misses       1359     1364       +5     
Flag Coverage Δ
backend 88.04% <88.88%> (-0.23%) ⬇️
client 48.92% <77.27%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

AdrianoKF and others added 5 commits October 25, 2024 09:24
This commit adds support for pull policies in the runners.

The job submission endpoint passes the pull policy to the runner, by
default the policy is set to `Always` to prevent issues with stale
images.

The e2e test has been updated to pass `IfNotPresent` as the pull policy,
since the job image for the test suite is built locally and cannot be
pulled from a registry.
The `Runner` interface has been changed to accept an `ImageRef`,
instead of importing the (useless) `Image` type from the client package.

Co-authored-by: Max Mynter <maxmynter@users.noreply.github.com>
@AdrianoKF AdrianoKF changed the title (wip) Add image pull policy to CLI kwargs Support user-specified image pull policy Oct 25, 2024
@AdrianoKF AdrianoKF merged commit ff36c96 into main Oct 25, 2024
4 checks passed
@AdrianoKF AdrianoKF deleted the pull-policy branch October 25, 2024 09:33
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.

Allow setting image pull policy for job image
2 participants