Skip to content

Third-party template discovery #4097

@jandubois

Description

@jandubois

We have rejected several submissions of additional templates to be bundled with Lima. The main concern is ongoing maintenance:

  • We don't want to get bug reports for the templates
  • We don't want to update image references
  • We don't want to endorse the templates because we don't want to review them

Unfortunately this makes it hard for template authors to advertise their templates, and for users to find them.


I propose to create a "self-managing" registry for third-party templates:

Registry location

The registry will be in the https://github.com/lima-vm/lima.yaml repo.

It will have a templates.json file in the root directory which contains the URLs of all known templates and their metadata.

There may be additional GitHub Pages for human consumption.

Template discovery

Any repo owner can add the lima.yaml tag to their repo, promising that the repo contains a lima.yaml file in the root directory.

A GitHub action will once per day query GitHub for a list of all repositories with the lima.yaml tag. It will verify that the promised lima.yaml at the root directory exists. If it does, it will collect metadata (repo description, other repo tags, last modified date for lima.yaml). Archived repos are ignored.

A commit with the new templates.json will replace the previous version. This automatically takes care of finding new templates and pruning ones that have been renamed or deleted.

We can implement a block-list filter if people start abusing this mechanism to publish misleading or malicious templates. But otherwise the mechanism is fully autonomous.

User experience

The templates.json file will be cached on the user's system. If GitHub supports using ETag or similar, then we can always check; otherwise we can update the cached version once per day (as needed).

Similar to limactl create --list-templates we can provide a limactl create --list-external-templates.

The menu displayed by limactl start can be extended with another entry:

 Choose another template (docker, podman, archlinux, fedora, ...)
 Choose an external template

We can even extend tab completion for the github: scheme (once that is supported).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions