From 4f273f6371ee3b04a387da9418fdfb29f56fbe27 Mon Sep 17 00:00:00 2001 From: Rob Ballantyne Date: Fri, 18 Aug 2023 11:31:55 +0100 Subject: [PATCH] Switch to mamba softlinks --- README.md | 4 ++-- .../opt/ai-dock/bin/build/layer0/common.sh | 6 ++---- .../jupyter/{kernels => }/_template/kernel.json | 0 .../jupyter/{kernels => }/_template/logo-32x32.png | Bin .../jupyter/{kernels => }/_template/logo-64x64.png | Bin .../jupyter/{kernels => }/_template/logo-svg.svg | 0 .../usr/local/share/jupyter/kernels/.gitkeep | 0 7 files changed, 4 insertions(+), 6 deletions(-) rename build/COPY_ROOT/usr/local/share/jupyter/{kernels => }/_template/kernel.json (100%) rename build/COPY_ROOT/usr/local/share/jupyter/{kernels => }/_template/logo-32x32.png (100%) rename build/COPY_ROOT/usr/local/share/jupyter/{kernels => }/_template/logo-64x64.png (100%) rename build/COPY_ROOT/usr/local/share/jupyter/{kernels => }/_template/logo-svg.svg (100%) create mode 100644 build/COPY_ROOT/usr/local/share/jupyter/kernels/.gitkeep diff --git a/README.md b/README.md index b4d07f9..7aef8dd 100644 --- a/README.md +++ b/README.md @@ -166,11 +166,11 @@ If you are extending this image or running an interactive session where addition | `micromamba deactivate` | Close the active environment | | `micromamba run -n [name] [command]` | Run a command in the named environment without activating | -All ai-dock images create micromamba environments using the `--experimental` flag to enable hardlinks which can save disk space where multiple environments are available. +All ai-dock images create micromamba environments using the `--always-softlink` flag which can save disk space where multiple environments are available. To create an additional micromamba environment, eg for python, you can use the following: -`micromamba --experimental create -y -c conda-forge -n [name] python=3.10` +`micromamba --always-softlink create -y -c conda-forge -n [name] python=3.10` ## Volumes diff --git a/build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh b/build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh index debf2e7..fe08c3c 100755 --- a/build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh +++ b/build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh @@ -32,14 +32,14 @@ do_kernel_install() { # Add a clone, probably the often-present Python3 (ipykernel) pointed to our default python install dir="${kernel_path}${3}/" file="${dir}kernel.json" - cp -rf ${kernel_path}_template ${dir} + cp -rf ${kernel_path}../_template ${dir} sed -i 's/DISPLAY_NAME/'"$4"'/g' ${file} sed -i 's/PYTHON_MAMBA_NAME/'"$1"'/g' ${file} fi dir="${kernel_path}$1/" file="${dir}kernel.json" - cp -rf ${kernel_path}_template ${dir} + cp -rf ${kernel_path}../_template ${dir} sed -i 's/DISPLAY_NAME/'"Python $2"'/g' ${file} sed -i 's/PYTHON_MAMBA_NAME/'"$1"'/g' ${file} @@ -87,8 +87,6 @@ install_ipykernel() { do_kernel_install "python_311" "3.11" fi fi - - rm -rf ${kernel_path}_template } main "$@"; exit \ No newline at end of file diff --git a/build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/kernel.json b/build/COPY_ROOT/usr/local/share/jupyter/_template/kernel.json similarity index 100% rename from build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/kernel.json rename to build/COPY_ROOT/usr/local/share/jupyter/_template/kernel.json diff --git a/build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-32x32.png b/build/COPY_ROOT/usr/local/share/jupyter/_template/logo-32x32.png similarity index 100% rename from build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-32x32.png rename to build/COPY_ROOT/usr/local/share/jupyter/_template/logo-32x32.png diff --git a/build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-64x64.png b/build/COPY_ROOT/usr/local/share/jupyter/_template/logo-64x64.png similarity index 100% rename from build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-64x64.png rename to build/COPY_ROOT/usr/local/share/jupyter/_template/logo-64x64.png diff --git a/build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-svg.svg b/build/COPY_ROOT/usr/local/share/jupyter/_template/logo-svg.svg similarity index 100% rename from build/COPY_ROOT/usr/local/share/jupyter/kernels/_template/logo-svg.svg rename to build/COPY_ROOT/usr/local/share/jupyter/_template/logo-svg.svg diff --git a/build/COPY_ROOT/usr/local/share/jupyter/kernels/.gitkeep b/build/COPY_ROOT/usr/local/share/jupyter/kernels/.gitkeep new file mode 100644 index 0000000..e69de29