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

Don't remove and rebuild images based on creation date #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JunShern
Copy link
Contributor

@JunShern JunShern commented Aug 7, 2024

Reference Issues/PRs

(No references, this is self-contained)

What does this implement/fix? Explain your changes.

The current behavior of the SWEB harness is to rebuild images if the instance/env image's creation date is older than the env/base image's creation date. This sounds like a sensible and helpful feature, except if you consider the following workflow:

On my team we find it useful to share images with each other, for example it is useful to build once and upload env or instance images to Dockerhub, so that others can skip the build step completely and just download an image with 100% guarantee that the environment is identical. In this setup, the downloaded images have a creation date that may be some weeks old, while I might have a base image on my local machine which was built more recently. But the base image in this case is irrelevant, and I just want to use the image I've downloaded. In this scenario, if I try to run the harness, the creation date feature blocks me from being able to use my downloaded image, and the harness always forces a rebuild.

Furthermore, this print statement even tells the user Found {len(existing_images)} existing instance images. Will reuse them., but it might later still silently rebuild the images without the user knowing. This has caused some confusion more than once!

Overall, I think it would be cleaner to remove this behavior which makes it harder to reason about rebuilds and caching images. We can leave it to the user's responsibility to make sure their images are up-to-date.

So this PR is both an ask and a proposed implementation to remove the "rebuild if image is older" feature.

Any other comments?

If there is a strong preference to keep the feature, I think we should at least fix the part where this happens silently - the user should know if their images are being skipped and rebuilt.

Thank you!

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.

1 participant