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

Invalidate image cache on git clones #242

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Invalidate image cache on git clones #242

merged 1 commit into from
Nov 27, 2024

Conversation

JoshCu
Copy link
Collaborator

@JoshCu JoshCu commented Nov 26, 2024

Adds lines to the dockerfile that make sure the cache is not used if remote repositories of ngen and troute have been updated

It's something I've had in my fork for a bit and thought could be useful. It means we can build the images without --no-cache and not have to worry about it using an old version of troute or ngen

Adds lines to the dockerfile that make sure the cache is not used if remote repositories of ngen and troute have been updated
@benlee0423
Copy link

@JoshCu
The build on x86 platform took long time to finish. It usually finishes about 10 or 11 min, and it didn't finish more than 29 min as of this writing.
Might be this change causing this delay?

@JoshCu
Copy link
Collaborator Author

JoshCu commented Nov 26, 2024

Those two lines will invalidate any existing build cache we have for layers after them so the first time might take longer but then subsequent builds should be able to do without clearing the build cache and they should be much quicker.
I added it to my fork to let me use build cache with docker build cloud but it should work locally or on selfhosted instances with persistent storage too.
The build cloud CI ends up being reasonably simple https://github.com/JoshCu/NGIAB-CloudInfra/blob/new_ci-test/.github/workflows/build-and-push.yml and the repeated builds are much quicker.

Although now I'm having issues where the version of python ngen is built with is cached and the version of python in the final image isn't which is breaking ngen.
image
If I can get it to work it should speed up repeat builds a lot, but right now it isn't :(

@benlee0423 benlee0423 self-requested a review November 27, 2024 04:06
@benlee0423 benlee0423 merged commit 70ee857 into main Nov 27, 2024
10 of 11 checks passed
@benlee0423 benlee0423 deleted the ngiab_build_cache branch November 27, 2024 04:07
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.

2 participants