-
Couldn't load subscription status.
- Fork 1
Add try-update pull policy to pull image only when image is updated #23
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
Conversation
|
That would be a divergence from what the docker gitlab-runner executor supports. I think it would be better if we mirror their config files as much as possible. The underlying problem we're trying to solve is that of DockerHub rate limits, and we could fix that by using a different container registry (e.g. one on gitlab) |
| } | ||
|
|
||
| // This uses docker hub rest api to grab the time from last push. | ||
| fn get_docker_tag_timestamp(pull_url: &str) -> anyhow::Result<DateTime<Utc>> { |
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.
If we were to add this, the function should preferably be async and the reqwest dependency should not use blocking
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.
is the function calling this just async not multithread?
I thought it is multithread, so doing blocking in that thread was fine to me.
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.
The functions are async, how they are actually being executed (multi-threaded or single-threaded) is up to the runtime system. The only as I have is that they should be non-blocking, in case we want to do other things at the same time in the future/make the requests cancellable.
|
@upsj I do not think this repo needs to provide the exact same config as gitlab although it can reduce the learning rate from gitlab. |
|
@yhmtsai You're right, and I might have mixed up where the config variables are set. Still it sounds like these changes may not be necessary after all? |
|
yes, I will close it because always pull policy behavior should be good enough now |
This PR adds a new pull policy such that we can handle the image with the update easily.
It adds one more check on top of if-not-present.
To avoid download docker image for checking, I go for the rest api to grab the push time
For SIF, we can get the information from inspect. Note: the build time is not the same as push time.
It only works when remote is docker.
I test the function in small rust own project but I am not sure whether there is easy way to test it here.
Also, to distinguish only local SIF (not in remote), I add
local://