-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
run_commands
executable file
·69 lines (59 loc) · 2.52 KB
/
run_commands
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash -il
set -exo pipefail
export additional_channel=""
if [ "$(uname -m)" = "x86_64" ]; then
export supkg="gosu"
export condapkg="https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh"
export conda_chksum="718259965f234088d785cad1fbd7de03"
elif [ "$(uname -m)" = "ppc64le" ]; then
export supkg="su-exec"
export condapkg="https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-ppc64le.sh"
export conda_chksum="6d3bd64dfc436f38755cde1a3ad40799"
elif [ "$(uname -m)" = "aarch64" ]; then
export supkg="su-exec"
export condapkg="https://github.com/jjhelmus/conda4aarch64/releases/download/1.0.0/c4aarch64_installer-1.0.0-Linux-aarch64.sh"
export conda_chksum="7f6f3c6ac5895188766218f222feb131"
# defaults is not enough
export additional_channel="--add channels c4aarch64"
elif [ "$(uname -m)" = "armv7l" ]; then
export supkg="su-exec"
export condapkg="https://github.com/jjhelmus/conda4armv7l/releases/download/1.0.0/conda4armv7l_installer-1.0.0-Linux-armv7l.sh"
export conda_chksum="7d1b7b10d5194d8572cc39dd22fe6e18"
# defaults is not enough
export additional_channel="--add channels c4armv7l"
else
exit 1
fi
# give sudo permission for conda user to run yum (user creation is postponed
# to the entrypoint, so we can create a user with the same id as the host)
echo 'conda ALL=NOPASSWD: /usr/bin/yum' >> /etc/sudoers
# Install the latest Miniconda with Python 3 and update everything.
curl -s -L $condapkg > miniconda.sh
md5sum miniconda.sh | grep $conda_chksum
bash miniconda.sh -b -p /opt/conda
rm -f miniconda.sh
touch /opt/conda/conda-meta/pinned
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
source /opt/conda/etc/profile.d/conda.sh
conda activate
conda config --set show_channel_urls True
conda config ${additional_channel} --add channels conda-forge
conda config --show-sources
conda update --all --yes
conda clean -tipy
# Install conda build and deployment tools.
conda install --yes --quiet \
git patch \
python=3.7 setuptools conda-build anaconda-client
conda clean -tipy
# Install docker tools
conda install --yes $supkg
export CONDA_SUEXEC_INFO=( `conda list $supkg | grep $supkg` )
echo "$supkg ${CONDA_SUEXEC_INFO[1]}" >> /opt/conda/conda-meta/pinned
conda install --yes tini
export CONDA_TINI_INFO=( `conda list tini | grep tini` )
echo "tini ${CONDA_TINI_INFO[1]}" >> /opt/conda/conda-meta/pinned
conda clean -tipy
# Lucky group gets permission to write in the conda dir
groupadd -g 32766 lucky
chgrp -R lucky /opt/conda && chmod -R g=u /opt/conda