Skip to content

Commit

Permalink
Switch to mamba softlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Aug 18, 2023
1 parent c0b8b9f commit 4f273f6
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -87,8 +87,6 @@ install_ipykernel() {
do_kernel_install "python_311" "3.11"
fi
fi

rm -rf ${kernel_path}_template
}

main "$@"; exit
Empty file.

0 comments on commit 4f273f6

Please sign in to comment.