-
Notifications
You must be signed in to change notification settings - Fork 43
Implement "repo-mode" to use the repo as source of truth for devcontainer/Dockerfile #218
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
Comments
@mafredri We're having trouble researching the idea, so I will put this on hold until we have a good understanding. Envbuilder supports the Also, what kind of problem will this issue address? monorepo & sparse checkout? |
Just read the RFC again. Will the filesystem mode have the same level of caching, just via a different architecture or is repo mode more performant in some scenarios? |
As I understand, it entirely depends on whether the layers are present in the build cache.
The way it's described here, repo mode will always clone from the remote. Therefore it may take slightly longer depending on the size of the repo to be cloned. The future performance improvement (only reading the relevant files directly from the repo). |
Understood 👍🏼 I feel like I'd personally use local mode so I can iterate on a devcontainer without having to commit and set a branch parameter |
@mtojek what you describe here is "filesystem"-mode. The repo is cloned onto a persistent volume, and on next start the local files are used to run envbuidler. The repo isn't cloned or updated. This is the current behavior. What we want with "repo"-mode is (in simple terms, disregarding optimizations):
The issue we're addressing is startup performance (cache utilization) first and foremost. Essentially on use-case is, the repo owner can pre-generate an envbuilder image from the latest commit (of some git repo). By using "repo"-mode, the user can take advantage of the existing image even when their own local files are old and outdated. The second issue we're addressing is building the functionality for use in a Terraform provider so that startup performance can be further improved without having to run For this issue, we simply want full clone of repo. In future, we can improve performance further by only checking out necessary files (like @johnstcn mentioned). |
In case of "repo-mode" this would be
Does it mean we want to precache the repo snapshot in the image? I'm trying to see the benefits because in both cases we have to checkout the Git repo, and for large repos it will take some time unless we "snapshot" it in the image. |
Probably configurability is best, but
No, the git repo is only for building, and for get cached image. We don't want it as part of the image. |
Ok, I think I got what you mean: You want to pull the Git repo based on branch/commit/sha, get
Right 👍 we don't want to keep redundant data in too many places. |
We can just rely on the image sha produced by Kaniko. The get cached image can deduce the correct sha by cloning the repo. If we tag the git commit sha there needs to be a new build/tag for every commit. Whereas with clone + get cached image it works without tagging. And if the files haven't changed, no additional images need to be pushed. |
As part of #128, we want to implement "repo"-mode for envbuilder as an alternative to the current "filesystem"-mode.
Filesystem-mode work like this:
In that last step, the devcontainer or Dockerfile may be old or locally modified. It depends on what the user has done.
Repo-mode differs from filesystem-mode in that it will always clone the repo (to a temporary location) and use the devcontainer/Dockerfile from there. This way the resulting container is always in-sync with the repo.
For now, we can keep this simple and always clone the repo. This feature should be implemented as a package that can be used by both envbuilder and a future envbuilder Terraform provider.
In the future, we can improve performance by only reading the relevant files from the repo.
The text was updated successfully, but these errors were encountered: