Hello I try to customize official slicer docker for jupyter, and integrate it with vs code development in a container.
I managed already to Install and test CUDA - which seem to works ok (pytorch detects it)
Now I have some problems, first I want to ask is it possible to use slicer extensions from the jupyter - primarly but not exclusively I am interested in installing SlicerRadiomics extension and use it from jupyter.
Secondly I try to install extension by modyfing install.sh
and adding after SlicerJupyter is installed
echo "Install extensions"
$slicer_executable -c '
em = slicer.app.extensionsManagerModel()
extensionMetaData = em.retrieveExtensionMetadataByName("SlicerRadiomics")
if slicer.app.majorVersion*100+slicer.app.minorVersion < 413:
# Slicer-4.11
itemId = extensionMetaData["item_id"]
url = f"{em.serverUrl().toString()}/download?items={itemId}"
extensionPackageFilename = f"{slicer.app.temporaryPath}/{itemId}"
slicer.util.downloadFile(url, extensionPackageFilename)
else:
# Slicer-4.13
itemId = extensionMetaData["_id"]
url = f"{em.serverUrl().toString()}/api/v1/item/{itemId}/download"
extensionPackageFilename = f"{slicer.app.temporaryPath}/{itemId}"
slicer.util.downloadFile(url, extensionPackageFilename)
# Prevent showing popups for installing dependencies
# (this is not needed right now for SlicerJupyter, but we still add this line here
# because this docker image may be used by other projects as a starting point)
em.interactive = False
em.installExtension(extensionPackageFilename)
'
Yet It gives error
[2022-05-21T18:07:13.536Z] Install extensions
[2022-05-21T18:07:15.830Z] Traceback (most recent call last):
[2022-05-21T18:07:15.830Z] File "<string>", line 12, in <module>
[2022-05-21T18:07:15.831Z] KeyError: '_id'
[2022-05-21T18:07:16.363Z] The command '/bin/sh -c ./install.sh ${HOME}/Slicer/Slicer && rm ${HOME}/install.sh' returned a non-zero code: 1
[2022-05-21T18:07:16.366Z] Stop (15155 ms): Run: docker build -f /home/jakub/projects/slicerModifB/.devcontainer/Dockerfile -t vsc-slicermodifb-cec2d2e6cdb09b3c149f8f6bee02d187 /home/jakub/projects/slicerModifB/.devcontainer
[2022-05-21T18:07:16.367Z] Error: Command failed: docker build -f /home/jakub/projects/slicerModifB/.devcontainer/Dockerfile -t vsc-slicermodifb-cec2d2e6cdb09b3c149f8f6bee02d187 /home/jakub/projects/slicerModifB/.devcontainer
[2022-05-21T18:07:16.367Z] at Tu (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:221:3219)
[2022-05-21T18:07:16.367Z] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-05-21T18:07:16.367Z] at async LR (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:221:1567)
[2022-05-21T18:07:16.367Z] at async zy (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:221:594)
[2022-05-21T18:07:16.367Z] at async $R (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:226:2007)
[2022-05-21T18:07:16.367Z] at async Zy (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:226:3112)
[2022-05-21T18:07:16.367Z] at async BR (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:226:12448)
[2022-05-21T18:07:16.367Z] at async qR (/home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js:226:12204)
[2022-05-21T18:07:16.370Z] Stop (15293 ms): Run: /snap/code/97/usr/share/code/code /home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/jakub/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-data-folder .vscode-server/data/Machine --container-system-data-folder /var/vscode-server --workspace-folder /home/jakub/projects/slicerModifB --workspace-mount-consistency cached --id-label vsch.local.folder=/home/jakub/projects/slicerModifB --id-label vsch.quality=stable --log-level debug --log-format json --config /home/jakub/projects/slicerModifB/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-05-21T18:07:16.370Z] Exit code 1
[2022-05-21T18:07:16.372Z] Command failed: /snap/code/97/usr/share/code/code /home/jakub/.vscode/extensions/ms-vscode-remote.remote-containers-0.234.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/jakub/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-data-folder .vscode-server/data/Machine --container-system-data-folder /var/vscode-server --workspace-folder /home/jakub/projects/slicerModifB --workspace-mount-consistency cached --id-label vsch.local.folder=/home/jakub/projects/slicerModifB --id-label vsch.quality=stable --log-level debug --log-format json --config /home/jakub/projects/slicerModifB/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-05-21T18:07:16.373Z] Exit code 1
My docker project