Skip to content

Refactor images lists and default mounts into base templates #3453

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

jandubois
Copy link
Member

Also adds template://default/mounts to setup the default mounts globally.

Closes #2418

If we decide to do this, then we should also create images/* templates for the other distributions.

@AkihiroSuda AkihiroSuda added this to the v1.1.0 milestone Apr 21, 2025
@jandubois
Copy link
Member Author

I wonder how we should deal with templates/default.yaml. Ideally it should also use the base templates, but then we are missing out on the comments.

Maybe include some commented out sample values in the default template, but still use the base templates to get the images and mounts?

@jandubois
Copy link
Member Author

The tests also use the templates via filename locator (templates/docker.yaml) without installing the templates first.

Which means all the references to base templates should be relative locators: _images/ubuntu-lts.yaml instead of template://_images/ubuntu-lts. I've changed this PR to accommodate.

Which means the templates in templates/experimental cannot use the new base templates because ../_images/ubuntu-lts.yaml is invalid; all relative references must be in or below the directory of the parent template.

So I think I should revert the change and reference the base templates via template:// again. Which means that we either need to install the templates before we need use them, or we could add a LIMA_TEMPLATES variable so we can override the location of the template store.

I would prefer to add LIMA_TEMPLATES.

@AkihiroSuda
Copy link
Member

LIMA_TEMPLATES

Maybe LIMA_TEMPLATES_PATH, with the support for PATH separators (:)

@jandubois
Copy link
Member Author

Maybe LIMA_TEMPLATES_PATH, with the support for PATH separators (:)

I'll take a look, but this is now getting into scope-creep for a quick PR that I hoped to do on the side while working on something else. 😄

@jandubois jandubois force-pushed the image-templates branch 9 times, most recently from e1b3c84 to 7402238 Compare April 22, 2025 00:39
@jandubois
Copy link
Member Author

This turned into a bit bigger PR than originally expected. I think it is getting close now, so please do another review.

We could move other distro images to _images/* as well, but since they are not currently duplicated, it would not really simplify anything. It would just make it easier to reuse the image lists from end-user templates.

That may be enough of a reason to do it, but maybe it should be done at a later point in time, when we have some experience/feedback on the current refactoring?

Also adds template://default/mounts to setup the default mounts globally.

Signed-off-by: Jan Dubois <[email protected]>
@jandubois
Copy link
Member Author

@AkihiroSuda PTAL! I hope CI will be green (except for the unrelated Windows failure). I will not be making any more changes today, and I hope this is close to "done" now.

Hope I don't jinx it by marking it "Ready for review". 😄

@jandubois jandubois marked this pull request as ready for review April 22, 2025 05:34
@jandubois jandubois changed the title Refactor Ubuntu images into base templates Refactor images lists and default mounts into base templates Apr 22, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 2adaf1d into lima-vm:master Apr 22, 2025
31 of 32 checks passed
@jandubois jandubois deleted the image-templates branch April 22, 2025 06:33
@AkihiroSuda
Copy link
Member

Now WARN[0000] base is experimental is printed for almost every invocation of limactl start.

Can we make it out of experimental now?

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.

Simplify syntax for selecting images, with locations and digests
2 participants