Repository navigation
feat(run-spaceapp): support rootless Podman and Podman machine container engine (closes #63) #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a611c25
09ff626
536ec37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -654,7 +654,7 @@ async function dockerCliAndComposeAreAvailable(execute) { | |
| return true; | ||
| } | ||
|
|
||
| async function dockerIsReady(execute) { | ||
| export async function dockerIsReady(execute) { | ||
| for (const spec of [ | ||
| { command: "docker", args: ["--version"] }, | ||
| { command: "docker", args: ["compose", "version"] }, | ||
|
|
@@ -667,6 +667,48 @@ async function dockerIsReady(execute) { | |
| return true; | ||
| } | ||
|
|
||
| export async function podmanIsReady(execute) { | ||
| for (const spec of [ | ||
| { command: "podman", args: ["--version"] }, | ||
| { command: "podman", args: ["compose", "version"] }, | ||
| { command: "podman", args: ["info"] } | ||
| ]) { | ||
| if (await execute(spec, { stdout: null, stderr: null }) !== 0) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| export async function ensurePodmanAvailable({ | ||
| platform = process.platform, | ||
| stdout = process.stdout, | ||
| stderr = process.stderr, | ||
| execute | ||
| }) { | ||
| if (platform === "win32") { | ||
| stderr.write("Podman engine support is available on Linux and macOS only.\n"); | ||
| return { code: 1, reexecuted: false }; | ||
| } | ||
| const cliOk = await execute({ command: "podman", args: ["--version"] }, { stdout: null, stderr: null }) === 0; | ||
| const composeOk = cliOk && await execute({ command: "podman", args: ["compose", "version"] }, { stdout: null, stderr: null }) === 0; | ||
| const infoOk = composeOk && await execute({ command: "podman", args: ["info"] }, { stdout: null, stderr: null }) === 0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis
Check the Linux Podman runtime in the readiness probe. On Linux, 🤖 Prompt for AI Agents
|
||
| if (cliOk && composeOk && infoOk) { | ||
| return { code: 0, reexecuted: false }; | ||
| } | ||
| const failedProbe = !cliOk | ||
| ? "podman --version" | ||
| : !composeOk | ||
| ? "podman compose version (run `podman compose version` to inspect the resolved Compose provider)" | ||
| : "podman info"; | ||
| stderr.write( | ||
| platform === "darwin" | ||
| ? `Podman check failed at \`${failedProbe}\`. Podman (>= 5) and a Compose provider must be installed and your Podman machine must be running (\`podman machine init --cpus 4 --memory 8192 --disk-size 25 && podman machine start\`).\n` | ||
| : `Podman check failed at \`${failedProbe}\`. Rootless Podman (>= 5, cgroup v2) and \`podman compose\` must be installed and ready (verify with \`podman compose version\`).\n` | ||
| ); | ||
| return { code: 1, reexecuted: false }; | ||
| } | ||
|
|
||
| async function installLinuxDockerEngine({ | ||
| arch, | ||
| release, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.