Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add lima incus example#24640

Merged
johnstcn merged 6 commits into
mainfrom
cj/lima-incus
Apr 23, 2026
Merged

feat: add lima incus example#24640
johnstcn merged 6 commits into
mainfrom
cj/lima-incus

Conversation

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn johnstcn commented Apr 22, 2026

Depends on #24616

Adds a sample Lima configuration for Coder+Incus.

NOTE: this will only work with a version of Coder that has the Incus template pre-baked. Otherwise you'll see the following in /var/log/cloud-init-output.log:

+ coder templates init --id incus
parsing flags ([templates init --id incus]) for "coder templates init": invalid argument "incus" for "--id" flag: invalid choice: incus, should be one of [aws-devcontainer aws-linux aws-windows azure-linux digitalocean-
linux docker docker-devcontainer docker-envbuilder gcp-devcontainer gcp-linux gcp-vm-container gcp-windows kubernetes kubernetes-devcontainer nomad-docker scratch tasks-docker]

@johnstcn johnstcn self-assigned this Apr 22, 2026
@johnstcn
Copy link
Copy Markdown
Member Author

/coder-agents-review

@johnstcn johnstcn changed the title examples: add lima incus example feat(examples): add lima incus example Apr 22, 2026
Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

First-pass review (Netero only). 1 P1, 2 P2, 1 P3, 2 Nits. The full review panel has not yet reviewed this PR. These are mechanical findings that should be addressed before the panel spends parallel review time.

The Lima Incus example is a welcome addition. The YAML structure is clean, the preseed config is well-thought-out (explicit subnet to avoid Lima bridge collisions), and the probe structure mirrors the Docker config nicely.

The main concern is the feature-branch download in the provisioning script. Once that branch is deleted, new VMs will fail to provision. The filename references in comments are also stale after the rename.

"A user copying the comment command gets 'No such file'." (Netero)

🤖 This review was automatically generated with Coder Agents.

Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/README.md Outdated
Comment thread examples/lima/coder-docker.yaml Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/README.md Outdated
@johnstcn
Copy link
Copy Markdown
Member Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Second first-pass review (Netero only). All 6 R1 findings addressed in c2811a3, nicely done. 1 new P2, 1 P4, 1 Nit.

The full review panel has not yet reviewed this PR. These are mechanical findings from Netero. The panel will review after these are addressed.

The main new issue is an instance name mismatch: the README tells users --name=coder for both Docker and Incus, which collides, and doesn't match the YAML header's limactl shell coder-incus.

"If a user follows the README, the instance is named coder. Then the YAML header example fails to find the instance." (Netero)

🤖 This review was automatically generated with Coder Agents.

Comment thread examples/lima/README.md Outdated
Comment thread examples/lima/README.md Outdated
Comment thread examples/lima/coder-docker.yaml Outdated
@johnstcn
Copy link
Copy Markdown
Member Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Panel review (8 reviewers). All 9 prior findings addressed across R1-R2. 1 new P1, 3 P3, 2 Nit, 1 P4, 3 Notes.

The configs are well-structured, the preseed is thoughtful, and the author's responsiveness to prior rounds has been excellent. Every finding was addressed promptly with generalized fixes.

The blocking issue: coder templates init --id incus will fail because the incus template is not registered as an embedded example. Three independent reviewers (Mafuuu, Pariston, Razor) traced this through the code and confirmed examples/examples.go has no //go:embed templates/incus directive and examples.gen.json has no incus entry. Neither this PR nor the dependency PR #24616 closes this gap. The VM provisions, Coder runs, but the template initialization step fails under set -eux, breaking the zero-to-Coder experience.

Hisoka's finding about #!/bin/sh with set -o pipefail was investigated and downgraded: Debian Trixie ships dash 0.5.12-7+, which implements pipefail (added May 2024). The first provision block still works, but it is vestigial since hostResolver.hosts handles the same concern natively.

Note for the author (outside this PR's diff): Mafuuu found that examples/templates/incus/main.tf:251 uses data.coder_parameter.cpu.value for the memory limit instead of data.coder_parameter.memory.value. A user setting CPU=2 and memory=16 gets 2 GiB. This was introduced in PR #24616.

"The script has set -eux, so this exits the user provision step. The VM starts, Incus initializes, Coder runs, but no template is created. The automated zero-to-Coder experience is broken." (Mafuuu)

🤖 This review was automatically generated with Coder Agents.

Comment thread examples/lima/coder-incus.yaml
Comment thread examples/lima/README.md
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/README.md Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/README.md Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
Comment thread examples/lima/coder-incus.yaml Outdated
- Fix stale filename references in coder-incus.yaml and coder-docker.yaml
- Replace feature-branch download with coder templates init
- Fix misleading Docker description in README
- Fix punctuation style violations
- Fix trailing period inconsistency
- Add //go:embed templates/incus and regenerate examples.gen.json
- Fix header comment and add explanatory comments in coder-incus.yaml
- Add next-step guidance to Incus section in README
- Fix Terraform install description and double-word typo in README
- Remove inert hostResolver and /etc/hosts fallback blocks
- Switch coder login to --flag value style, drop --first-user-trial
- Fix probe hints to point to Lima logs instead of cloud-init
@johnstcn johnstcn changed the title feat(examples): add lima incus example feat: add lima incus example Apr 22, 2026
@johnstcn
Copy link
Copy Markdown
Member Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Re-review panel (5 reviewers + Netero). All 19 posted findings from R1-R3 addressed. Zero new findings from any reviewer.

The author addressed every finding across four rounds, including Notes that didn't require action. The cleanup in 866369a86 went beyond what was asked: removing the vestigial hostResolver block, fixing probe hints to point to the correct Lima log, and switching to consistent flag style.

Netero's mechanical pass is clean. Mafuuu, Pariston, Hisoka, Leorio, and Chopper (wildcard) all returned no findings. Pariston's analysis confirmed the problem-solution alignment is correct and the dependency chain (template registration, Lima config, README) is properly sequenced. Chopper verified contract fidelity across all 18 embedded template IDs.

CI failure is the title check only (not a code issue).

"Four rounds, twenty fixes. Every thread I pulled held. Boring code got silence from me until now. It earned it." (Hisoka)

🤖 This review was automatically generated with Coder Agents.

@johnstcn johnstcn requested a review from matifali April 22, 2026 21:18
Copy link
Copy Markdown
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

Looks good to me. Can we move/copy the template to the coder/registry in a follow-up? Thanks

@johnstcn johnstcn merged commit f5ccf68 into main Apr 23, 2026
35 of 36 checks passed
@johnstcn johnstcn deleted the cj/lima-incus branch April 23, 2026 07:24
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants