Skip to content
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

Does it work with Podman? #1

Closed
benz0li opened this issue Jun 26, 2023 · 4 comments
Closed

Does it work with Podman? #1

benz0li opened this issue Jun 26, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@benz0li
Copy link
Member

benz0li commented Jun 26, 2023

https://podman.io

@benz0li benz0li added the question Further information is requested label Jun 26, 2023
@benz0li benz0li self-assigned this Jun 26, 2023
@benz0li
Copy link
Member Author

benz0li commented Jun 27, 2023

Yes.

However, certain tricks like Docker-from-Docker do not work due to limitations in Podman. This affects the Dev Containers: Try a Dev Container Sample... and Dev Containers: Clone Repository in Container Volume... commands.

Dev Containers Docker options (2023-06-26)

@benz0li
Copy link
Member Author

benz0li commented Jun 27, 2023

You must disable feature docker-outside-of-docker and are supposed to run the Dev Container as root. E.g. modify the devcontainer.json for Julia base as follows:

diff --git a/.devcontainer/julia-base/devcontainer.json b/.devcontainer/julia-base/devcontainer.json
index fe18c76..85c8410 100644
--- a/.devcontainer/julia-base/devcontainer.json
+++ b/.devcontainer/julia-base/devcontainer.json
@@ -28,9 +28,6 @@
 			"username": "vscode",
 			"userUid": "automatic",
 			"userGid": "automatic"
-		},
-		"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
-			"moby": false
 		}
 	},
 
@@ -52,8 +49,7 @@
 				"julialang.language-julia",
 				"dbaeumer.vscode-eslint",
 				"esbenp.prettier-vscode",
-				"ms-python.black-formatter",
-				"ms-azuretools.vscode-docker"
+				"ms-python.black-formatter"
 			],
 			"settings": {
 				"gitlens.graph.statusBar.enabled": false,
@@ -78,14 +74,8 @@
 		}
 	},
 
-	// Set 'remoteUser' to 'root' to connect as root instead.
-	"remoteUser": "vscode",
-	"workspaceMount": "source=julia-base-home-vscode,target=/home/vscode,type=volume",
-	// "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/julia-base-home-vscode,target=/home/vscode,type=bind",
-	"workspaceFolder": "/home/vscode"
-
-	// "remoteUser": "root",
-	// "workspaceMount": "source=julia-base-root,target=/root,type=volume",
-	// // "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/julia-base-root,target=/root,type=bind",
-	// "workspaceFolder": "/root"
+	"remoteUser": "root",
+	"workspaceMount": "source=julia-base-root,target=/root,type=volume",
+	// "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/julia-base-root,target=/root,type=bind",
+	"workspaceFolder": "/root"
 }

@benz0li
Copy link
Member Author

benz0li commented Jun 27, 2023

NVIDIA Container Toolkit: Should you not use the Container Device Interface (CDI), ensure that the hook has been added and that you changed the NVIDIA runtime configuration.

For CUDA-enabled versions, you also need to modify the runArgs. E.g. modify the devcontainer.json for CUDA Julia base as follows:

diff --git a/.devcontainer/cuda-julia-base/devcontainer.json b/.devcontainer/cuda-julia-base/devcontainer.json
index ac01b36..e43f1d8 100644
--- a/.devcontainer/cuda-julia-base/devcontainer.json
+++ b/.devcontainer/cuda-julia-base/devcontainer.json
@@ -28,9 +28,6 @@
                        "username": "vscode",
                        "userUid": "automatic",
                        "userGid": "automatic"
-               },
-               "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
-                       "moby": false
                }
        },
 
@@ -52,8 +49,7 @@
                                "julialang.language-julia",
                                "dbaeumer.vscode-eslint",
                                "esbenp.prettier-vscode",
-                               "ms-python.black-formatter",
-                               "ms-azuretools.vscode-docker"
+                               "ms-python.black-formatter"
                        ],
                        "settings": {
                                "gitlens.graph.statusBar.enabled": false,
@@ -79,15 +75,10 @@
        },
 
        // Set 'remoteUser' to 'root' to connect as root instead.
-       "remoteUser": "vscode",
-       "workspaceMount": "source=cuda-julia-base-home-vscode,target=/home/vscode,type=volume",
-       // "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/cuda-julia-base-home-vscode,target=/home/vscode,type=bind",
-       "workspaceFolder": "/home/vscode",
+       "remoteUser": "root",
+       "workspaceMount": "source=cuda-julia-base-root,target=/root,type=volume",
+       // "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/cuda-julia-base-root,target=/root,type=bind",
+       "workspaceFolder": "/root",
 
-       // "remoteUser": "root",
-       // "workspaceMount": "source=cuda-julia-base-root,target=/root,type=volume",
-       // // "workspaceMount": "source=${localWorkspaceFolder}/.bind-mounts/cuda-julia-base-root,target=/root,type=bind",
-       // "workspaceFolder": "/root",
-
-       "runArgs": [ "--gpus=all" ]
+       "runArgs": [ "--device", "nvidia.com/gpu=all" ]
 }

👉 Should you not use the CDI: "runArgs": [ "--hooks-dir=/usr/share/containers/oci/hooks.d/" ]

@benz0li benz0li closed this as completed Jun 27, 2023
@benz0li benz0li pinned this issue Jul 12, 2023
@b-data b-data locked and limited conversation to collaborators Jul 13, 2023
@benz0li benz0li converted this issue into a discussion Jun 16, 2024
@benz0li benz0li unpinned this issue Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant