Repository navigation
fix(standard): use podman when docker is installed but does not answer - #243
Merged
Merged
Conversation
With both docker and podman on the PATH, the container backend chose docker by presence alone, so a docker that refuses this user or has no daemon blocked the standard's container runs even where podman works. The engine is now docker unless `docker ps` fails and `podman ps` succeeds, on this machine (container.engine) and in a host's probe (hosts.test) alike, so the probe and the standard's run there agree. Only a machine with both is asked; with one engine the choice costs no call. Where neither answers, docker is kept and its reason is said as before.
aitianshi
added a commit
that referenced
this pull request
Nov 20, 2026
…gs as its popup, and drop the Engine card (#251) Closes #250 ## What The Where step's Boat card gets Boat's mark (light or dark by theme) and loses its two description lines, which the Isolation line and Limits' concurrency already say. Without a Boat key, Sandboxes can now be chosen: the Boat card is greyed and its one live control, **Add API Key**, opens the Settings popup on Boat's key form. Every Settings link in the builder now opens the Settings popup (`window.nulliusOpenSettings`, shared with the popup's own link handling) instead of leaving for the page, and closing the popup, however it was opened, reloads the builder from its draft on the same step. A Where problem is said once: the step no longer draws its own copy of "cannot run in a Boat VM", and a compile error can be marked `shown` (the missing Boat key, which the card already says) so the step's error line leaves it to Review. The machines sit 20px below the Hosts/Sandboxes switch. Settings → Sandbox drops its Engine card, its probe (`sandbox.docker_state`, `_other`) and #243's second-engine row with it: this machine's Docker or Podman is in the Hosts table. ## Touches backend · routes · templates and static · docs and site ## Before and after Run builder, Where step, no Boat key: | Before | After | | --- | --- | | <img width="560" alt="Where step on main: Sandboxes greyed and not selectable" src="https://github.com/user-attachments/assets/aede1b2a-2e05-4a28-aa4c-b7a5ce679add" /> | <img width="560" alt="Where step on this branch: Sandboxes chosen, a greyed Boat card with its logo and Add API Key" src="https://github.com/user-attachments/assets/acb82c0a-089f-4ef0-b268-a2cdb3050c2e" /> | Settings → Sandbox: | Before | After | | --- | --- | | <img width="560" alt="Settings Sandbox on main: Engine card and Boat card" src="https://github.com/user-attachments/assets/6656d2e3-81f7-4ba9-87dc-1dcd72b5b6bc" /> | <img width="560" alt="Settings Sandbox on this branch: the Boat card alone" src="https://github.com/user-attachments/assets/ce5c72b6-8f0e-498d-afb2-bc91292210c7" /> | ## Verified - Backend suite (3098 tests) and route suite (690 tests) pass after merging `main`. - New and changed tests: the Boat card's marks and its Add API Key link (`test_builder_where.py`), a non-key Boat problem staying a plain line with Sandboxes disabled, `shown` set only when no key is saved (`test_standard_boat.py`), the Sandbox section without the Engine card and its route returning only Boat's state (`test_settings_page.py`). - Headless Chromium, light and dark, 1280 and 390 px: the card's mark per theme, no sideways scroll, no page errors; Add API Key opens the popup with Boat's form open and its field focused; closing the popup, opened from the link or from the rail, lands back on Where with the recipe kept; Settings → Sandbox shows only Boat. - Not verified: a real key added or removed, since a fake key would reach Boat's API. The builder reads the key state from the server on each load. ## Risk - The builder reloads every time the Settings popup closes, even without a change; the draft restores the recipe and step, but a `?run=` or `?saved=` notice is not shown again. - #243's note naming a second installed engine leaves Settings with the Engine card; which engine runs is unchanged, and Hosts still shows it. - Undone by reverting the squash commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #242
What
One rule in both places: docker, unless
docker psfails andpodman pssucceeds. When neither answers, the choice stays as today, docker if it is installed, else podman, so the reason given is unchanged.standard/container.py)._answers(program)runs<program> pswith a 10 s limit.engine()asks it only when both programs are on the PATH anddockeris not podman under that name. A machine with only one of them makes no call.DOCKERis still chosen once, when the module is imported.unusable()now says "Nullius uses it when docker does not answer and podman does".hosts.py). The probe already ran<engine> psfor each engine. Itsenginenow applies the same rule todocker_okandpodman_ok. A run on the host goes through the standard's own code there, which calls the sameengine(), so the probe and the run pick the same engine.sandbox.py,settings/sandbox.js,settings/settings.html).docker_state()addsalsowhen both engines are installed: the other one, with its version or the last line of why it does not answer.dockerscript counts as the same program, not as a second engine.The builder,
prerequisitesandexecution.pyread the chosen engine and its_okand need no change. Harbor recipes still needdocker, which is Harbor's own requirement.Touches
backend (
nullius/standard/container.py,nullius/hosts.py,nullius/sandbox.py) · static and templates (settings/sandbox.js,settings/settings.html) · tests · docs (docs/standard.md, the Backends row)Before and after
Before, on main, Settings → Sandbox shows "✕ docker is installed but not usable by this user: … podman is on this machine: Nullius uses it when docker is not on the PATH", and nothing runs on the container backend.
After, in a preview container with both programs installed:
Verified
With stub programs on a PATH that holds nothing else, the same checks on main and on this branch:
container.engine()dockerpodmansandbox.docker_state()ok: False, the docker errorok: True,podman …,also: docker does not answerprerequisites.check_here(["engine"], standard=True)missingokhosts.testengine: dockerengine: podmanA preview with real programs: an app container with docker.io and podman 5.4.2, and two ssh hosts with both, on Fedora's podman image.
docker pssays "permission denied while trying to connect to the docker API", picks podman.In a throwaway rootless
python:3.12container with Node.js and uv:python3 app/tests/parallel.py: 3078 tests in 156 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 674 tests in 55 modules, OK.test_standard_container.py: with both on the PATH, the one that answers is the engine (podman, docker, and docker when neither answers); the host probe andengine()pick the same engine; the Sandbox names the other engine when both are installed, and not podman'sdockerscript; the updated hint.test_hosts.py: the probe's engine for each combination ofdocker_okandpodman_ok.test_sandbox.py: the engine named with its version is asked with no other engine on the PATH, so a docker installed on the machine running the suite does not change it.Not checked: a real run through podman in the preview, the docker test tier, and a host reached over a network rather than a local container.
Risk
docker ps, andpodman pswhen docker fails. Each takes up to 10 s if the engine hangs, for example aDOCKER_HOSTthat does not answer.