generated from berkeley-dsep-infra/hub-user-image-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-mambaforge.bash
executable file
·42 lines (30 loc) · 1.19 KB
/
install-mambaforge.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This downloads and installs a pinned version of mambaforge
set -ex
cd $(dirname $0)
MAMBAFORGE_VERSION=24.9.2-0
URL="https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Miniforge3-${MAMBAFORGE_VERSION}-Linux-x86_64.sh"
INSTALLER_PATH=/tmp/mambaforge-installer.sh
# make sure we don't do anything funky with user's $HOME
# since this is run as root
#unset HOME
export XDG_CACHE_HOME=$(mktemp)
wget --quiet $URL -O ${INSTALLER_PATH}
chmod +x ${INSTALLER_PATH}
bash ${INSTALLER_PATH} -f -b -p ${CONDA_DIR}
export PATH="${CONDA_DIR}/bin:$PATH"
# Do not attempt to auto update conda or dependencies
conda config --system --set auto_update_conda false
conda config --system --set show_channel_urls true
# empty conda history file,
# which seems to result in some effective pinning of packages in the initial env,
# which we don't intend.
# this file must not be *removed*, however
echo '' > ${CONDA_DIR}/conda-meta/history
# Clean things out!
conda clean --all -f -y
# Remove the big installer so we don't increase docker image size too much
rm ${INSTALLER_PATH}
# Remove the pip cache created as part of installing mambaforge
rm -rf ${XDG_CACHE_HOME}
conda list -n root