Skip to content

fix(cluster): start a Colima profile in its own home at login - #173

Merged
Mearman merged 2 commits into
mainfrom
feat/runtime-autostart
Nov 2, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/runtime-autostart

Conversation

@Mearman

@Mearman Mearman commented Nov 2, 2026

Copy link
Copy Markdown
Member

The autostart agent from #102 starts the Colima profile with the role's environment, which had no COLIMA_HOME. On the Mac, the bridged node profile (context colima-node) lives in ~/.colima-node, so after a reboot the agent ran colima start --profile node against ~/.colima, which has no such profile, and the node's github-runner-k3s container (restart: unless-stopped) never came back.

The role now takes the home from github_runner_cluster_colima_home when it is set, and otherwise from the endpoint of the profile's Docker context (docker context inspect, which reads the context file only, so it works with the VM stopped and under --check). Colima points that endpoint at <COLIMA_HOME>/<profile>/docker.sock; an endpoint that is not that socket fails the run asking for the variable. The home goes to every colima call the role makes and into the agent's EnvironmentVariables. The parsing is a new filter, cluster_colima_home.

A profile in ~/.colima (the mini's default one) gets no COLIMA_HOME, so its agent, com.exadev.github-runner.colima.default, renders byte for byte as before and a converge changes nothing there. A second run on a node profile that is up with its agent loaded changes nothing either; the new tests cover both.

Tested with python -m unittest over tests/unit (stubbed docker, colima, launchctl, plutil; breaking the home passed to colima fails the new test), ansible-lint --profile production, yamllint . and the playbook syntax checks. No playbook was run against a real host, so the agent loading at a real reboot is untested. An agent installed by the earlier role has no COLIMA_HOME; the next converge rewrites it and reloads it.

A filter that returns the COLIMA_HOME a profile needs from the endpoint of the
Docker context Colima made for it, since Colima puts the profile's socket at
<COLIMA_HOME>/<profile>/docker.sock. It is empty for Colima's own default home,
and refuses an endpoint that is not that socket.
A profile that lives outside ~/.colima (the bridged node profile, with context
colima-node and COLIMA_HOME ~/.colima-node) was started without COLIMA_HOME by
both the role and its launchd agent, so Colima looked in ~/.colima and created a
new VM there. After a reboot the node's container never came back.

The role now takes the home from github_runner_cluster_colima_home when that is
set, and otherwise from the endpoint of the profile's Docker context, read with
docker context inspect (no running VM needed, so it works under --check). It
passes the home to every colima call and writes it into the agent. A profile in
~/.colima gets the same agent and commands as before, with no COLIMA_HOME.
@Mearman
Mearman marked this pull request as ready for review November 2, 2026 22:40
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-02T22:40:48.018106Z
We couldn’t complete this review. Comment @codex security review to try again.
0aa386f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit 22e8460 into main Nov 2, 2026
36 of 38 checks passed
@Mearman
Mearman deleted the feat/runtime-autostart branch November 2, 2026 22:41
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant