-
Notifications
You must be signed in to change notification settings - Fork 979
Expand file tree
/
Copy pathinstall_conda.sh
More file actions
executable file
·44 lines (35 loc) · 1.1 KB
/
install_conda.sh
File metadata and controls
executable file
·44 lines (35 loc) · 1.1 KB
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
43
44
#!/bin/bash
set -ex
# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
install_miniconda() {
BASE_URL="https://repo.anaconda.com/miniconda"
CONDA_FILE="Miniconda3-py${PYTHON_VERSION//./}_${MINICONDA_VERSION}-Linux-x86_64.sh"
mkdir -p /opt/conda
chown ci-user:ci-user /opt/conda
pushd /tmp
wget -q "${BASE_URL}/${CONDA_FILE}"
# Install miniconda
as_ci_user bash "${CONDA_FILE}" -b -f -p "/opt/conda"
# Clean up the download file
rm "${CONDA_FILE}"
popd
sed -e 's|PATH="\(.*\)"|PATH="/opt/conda/bin:\1"|g' -i /etc/environment
export PATH="/opt/conda/bin:$PATH"
}
install_python() {
pushd /opt/conda
# Install the correct Python version
as_ci_user conda create -n "py_${PYTHON_VERSION}" -y --file /opt/conda/conda-env-ci.txt python="${PYTHON_VERSION}"
popd
}
install_pip_dependencies() {
pushd /opt/conda
# Install all Python dependencies, including PyTorch
pip_install -r /opt/conda/requirements-ci.txt
pip_install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
popd
}
install_miniconda
install_python
install_pip_dependencies