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

Allow manually specifying the prebuild image tag #1371

Open
oenglund opened this issue Nov 12, 2024 · 4 comments
Open

Allow manually specifying the prebuild image tag #1371

oenglund opened this issue Nov 12, 2024 · 4 comments

Comments

@oenglund
Copy link

Is your feature request related to a problem?
Yes. We're trying to use prebuilds but the prebuild hash that devpod calculates does not match any of the prebuilt images in our registry. We could investigate why that is but for our use case, it would be easier to just manually add a hash that is used to find the prebuilt image.

Which solution do you suggest?
Add a new field under customizations.devpod called prebuildHash where one can manually set a hash that devpod should use for selecting a prebuild image.

Which alternative solutions exist?
Some further documentation on how the hash is generated would help investigate why the hash does not match the one generated when doing the prebuild.

Additional context

@bkneis
Copy link
Contributor

bkneis commented Nov 14, 2024

Hi @oenglund thanks for reporting your issue! Here is the logic for calculating a prebuild hash - https://github.com/loft-sh/devpod/blob/main/pkg/devcontainer/config/prebuild.go#L18 It sounds like your getting cache misses which are not too infrequent, this is due to the high cardinality of the devcontainer. Since many files can affect the build context, resulting in a different devcontainer, prebuild hash's can be missed. We have an open ticket to support the use of a --tag command line arg for devpod build so you can do as you mentioned. If you'd like to take a crack at it I'll be happy to review the PR. If not I will try get to this soon. In the meantime, you could take a look at using a registry cache to cache individual layers so when you miss the cache, you only have to build the changes https://devpod.sh/docs/tutorials/reduce-build-times-with-cache

@manel-bc
Copy link
Contributor

Hi, thanks for considering it. It would be quite helpful to have.

A questions I have is, if we can eventually specify the tag when building the image, shouldn't we be able to specify the tag when creating the Workspace as well, to be able to target that image specifically? Or how were you thinking this would work?

@bkneis
Copy link
Contributor

bkneis commented Nov 14, 2024

Hi @manel-bc, the idea would be that you would do something like devpod build --tag stable, then in your .devcontainer.json specify the image with tag stable and perform devpod up

@fcaroline2020
Copy link

@bkneis here is a PR to add tags to images https://github.com/loft-sh/devpod/pull/1388/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants