Skip to content

fix(standard): use podman when docker is installed but does not answer - #243

Merged
harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:fix/engine-fallback
Nov 19, 2026
Merged

harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:fix/engine-fallback

Conversation

@harenome

@harenome harenome commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #242

What

One rule in both places: docker, unless docker ps fails and podman ps succeeds. When neither answers, the choice stays as today, docker if it is installed, else podman, so the reason given is unchanged.

  1. This machine (standard/container.py).
    • _answers(program) runs <program> ps with a 10 s limit.
    • engine() asks it only when both programs are on the PATH and docker is not podman under that name. A machine with only one of them makes no call.
    • DOCKER is still chosen once, when the module is imported.
    • The hint in unusable() now says "Nullius uses it when docker does not answer and podman does".
  2. A host (hosts.py). The probe already ran <engine> ps for each engine. Its engine now applies the same rule to docker_ok and podman_ok. A run on the host goes through the standard's own code there, which calls the same engine(), so the probe and the run pick the same engine.
  3. Settings → Sandbox (sandbox.py, settings/sandbox.js, settings/settings.html).
    • docker_state() adds also when both engines are installed: the other one, with its version or the last line of why it does not answer.
    • The page shows it in a row under Engine, hidden when there is no other engine.
    • Podman's own docker script counts as the same program, not as a second engine.

The builder, prerequisites and execution.py read the chosen engine and its _ok and need no change. Harbor recipes still need docker, 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:

docker's daemon stopped both answer
after-sandbox-docker-down after-sandbox-both-working

Verified

With stub programs on a PATH that holds nothing else, the same checks on main and on this branch:

Check main this branch
container.engine() docker podman
sandbox.docker_state() ok: False, the docker error ok: True, podman …, also: docker does not answer
prerequisites.check_here(["engine"], standard=True) missing ok
hosts.test engine: docker engine: podman
Where, Test connection "✓ Connected · ✕ docker not usable by this user: this run needs it" "✓ Connected"

A 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.

  • The app with its docker daemon stopped picks podman. With the daemon running, it picks docker.
  • A host whose user is in the docker group picks docker. A host whose user is not, where docker ps says "permission denied while trying to connect to the docker API", picks podman.
  • Test connection says Connected for both hosts.

In a throwaway rootless python:3.12 container with Node.js and uv:

  • python3 app/tests/parallel.py: 3078 tests in 156 modules, OK.
  • pip install -r app/requirements.txt, then python3 app/tests/parallel.py app/ui_tests: 674 tests in 55 modules, OK.
  • New tests, which fail on main:
    • 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 and engine() pick the same engine; the Sandbox names the other engine when both are installed, and not podman's docker script; the updated hint.
    • test_hosts.py: the probe's engine for each combination of docker_ok and podman_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

  • On a machine with both installed, each start runs docker ps, and podman ps when docker fails. Each takes up to 10 s if the engine hangs, for example a DOCKER_HOST that does not answer.
  • The engine is still chosen once per process. Starting or stopping a daemon later takes a restart, as today.
  • To undo, revert the commits.

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.
@harenome
harenome merged commit 5c918be into ThinkFlowLab:main Nov 19, 2026
2 checks passed
@harenome
harenome deleted the fix/engine-fallback branch November 19, 2026 15:46
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.
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.

Standard: a broken docker beside a working podman stops the container backend

1 participant