feat(nodes): add Docker API backend#394
Conversation
runleveldev
left a comment
There was a problem hiding this comment.
The UI displays "Creds missing" for Docker nodes
Running our default templates fail since they use SystemD. Similar to how Proxmox checks for "application containers" and make the nessecary adjustments, this needs to check for "system containers" and make the nessacary adjustments (such as setting privileged: true)
7a542e3b9e12 ghcr.io/mieweb/opensource-server/base:latest "/sbin/init" 19 seconds ago Exited (255) 17 seconds ago hollow-urban-otter
|
The Docker credential badge was fixed in The systemd/default template handling was fixed in I pushed the requested review fixes as separate commits so each item is easier to inspect. Testing run:
I replied on the individual threads with the commit that addresses each item. I left the Docker real container ID thread unresolved because |
|
I pushed the latest review fixes as separate commits:
I also ran the backend syntax checks, frontend type-check, and |
runleveldev
left a comment
There was a problem hiding this comment.
@ArshSSandhu this was the only thing found in my final QA round. Once it's fixed I think this is ready to merge.
|
@runleveldev I fixed it, let me know if anything else is needed. |
runleveldev
left a comment
There was a problem hiding this comment.
@ArshSSandhu I pushed one commit because it was such a small fix by the time I knew what the issue was I already had it fixed. I'm going to approve this, let me know that you've reviewed what I did then I'll merge.
There was a problem hiding this comment.
@runleveldev I think this should compare String(r.vmid) === String(vmid) instead of strict equality, since containerId is now stored as a string but Proxmox snapshots may still return numeric VMIDs.
Good catch. My commit fixed the issue for docker containers but just moved it to affecting Proxmox containers. |
|
@runleveldev I fixed it. This PR should be ready to merge. |
Summary
Closes #375.
This PR adds support for Docker-backed nodes by introducing a new
DockerApiimplementation that follows the existing Node API contract used byProxmoxApiandDummyApi.Changes include:
DockerApiusing Docker Engine's native HTTP API throughaxiosunix:///var/run/docker.socktcp://host:2375http://...https://...Node.api()to dispatch toDockerApiwhennodeType === "docker"node.hasApiAccess()Node.provisionableWhere(...)nodeTypesupport to node API serialization, create, and update routesunix:///var/run/docker.sockin the frontend formRelated Issue
Closes #375
Testing
Tested locally with the following checks:
Ran backend syntax checks successfully:
Ran frontend type-check successfully:
Ran whitespace checks successfully:
Tested
DockerApidirectly against local Docker using:Verified direct Docker lifecycle flow:
nginx:latestVerified the UI can create a Docker node with:
Attempted full UI container creation with
nginx:latest. The job selected the Docker node and Docker image path correctly, but failed with:This appears to be a local runtime/socket-mount limitation because the Manager runtime does not currently have the host Docker socket mounted. The
DockerApiitself was verified successfully through the direct lifecycle test above.Screenshots
Docker node form
Docker node created
Breaking Changes
None known.
Notes
Full end-to-end Docker provisioning from the UI requires the Manager runtime to have access to the configured Docker host. For local socket usage,
/var/run/docker.sockmust be mounted or otherwise reachable from the process running Manager.