@@ -19,10 +19,29 @@ conda_cleanup () {
19
19
(print_exec conda clean --all -y) || return 1
20
20
}
21
21
22
+ __download_install_miniconda () {
23
+ echo " [SETUP] Downloading the Miniconda installer ..."
24
+ (exec_with_retries 3 wget -q " https://repo.anaconda.com/miniconda/Miniconda3-latest-${PLATFORM_NAME} .sh" -O miniconda.sh) || return 1
25
+
26
+ echo " [SETUP] Installing Miniconda ..."
27
+ print_exec bash miniconda.sh -b -p " $conda_install_prefix " -u
28
+ print_exec rm -f miniconda.sh
29
+ }
30
+
31
+ __download_install_miniforge () {
32
+ echo " [SETUP] Downloading the Miniforge installer ..."
33
+ MINIFORGE_URL=" https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$( uname) -$( uname -m) .sh"
34
+ (exec_with_retries 3 wget -q " $MINIFORGE_URL " -O miniforge.sh) || return 1
35
+
36
+ echo " [SETUP] Installing Miniforge ..."
37
+ print_exec bash miniforge.sh -b -p " $conda_install_prefix " -u
38
+ print_exec rm -f miniforge.sh
39
+ }
40
+
22
41
setup_miniconda () {
23
- local miniconda_prefix =" $1 "
24
- if [ " $miniconda_prefix " == " " ]; then
25
- echo " Usage: ${FUNCNAME[0]} MINICONDA_PREFIX_PATH "
42
+ conda_install_prefix =" $1 "
43
+ if [ " $conda_install_prefix " == " " ]; then
44
+ echo " Usage: ${FUNCNAME[0]} conda_install_prefix_PATH "
26
45
echo " Example:"
27
46
echo " setup_miniconda /home/user/tmp/miniconda"
28
47
return 1
@@ -37,23 +56,23 @@ setup_miniconda () {
37
56
38
57
test_network_connection || return 1
39
58
40
- if [ -f " ${miniconda_prefix } /bin/conda" ]; then
41
- echo " [SETUP] A Miniconda installation appears to already exist in ${miniconda_prefix } ..."
42
- echo " [SETUP] Clearing out directory: ${miniconda_prefix } ..."
43
- print_exec rm -rf " ${miniconda_prefix } "
59
+ if [ -f " ${conda_install_prefix } /bin/conda" ]; then
60
+ echo " [SETUP] A Conda installation appears to already exist in ${conda_install_prefix } ..."
61
+ echo " [SETUP] Clearing out directory: ${conda_install_prefix } ..."
62
+ print_exec rm -rf " ${conda_install_prefix } "
44
63
fi
45
64
46
- print_exec mkdir -p " $miniconda_prefix "
65
+ print_exec mkdir -p " $conda_install_prefix "
47
66
48
- echo " [SETUP] Downloading the Miniconda installer ... "
49
- (exec_with_retries 3 wget -q " https://repo.anaconda.com/miniconda/Miniconda3-latest- ${PLATFORM_NAME} .sh " -O miniconda.sh) || return 1
50
-
51
- echo " [SETUP] Installing Miniconda ... "
52
- print_exec bash miniconda.sh -b -p " $miniconda_prefix " -u
53
- print_exec rm -f miniconda.sh
67
+ # NOTE: There is a flaky rate limit issue with Anaconda coming from the ROCm
68
+ # CI runners, and so to work around this, we install Conda through Miniforge
69
+ # instead of Miniconda, as it defaults to using conda-forge channel for all
70
+ # package installations.
71
+ # __download_install_miniconda
72
+ __download_install_miniforge
54
73
55
74
echo " [SETUP] Reloading the bash configuration ..."
56
- print_exec " ${miniconda_prefix } /bin/conda" init bash
75
+ print_exec " ${conda_install_prefix } /bin/conda" init bash
57
76
print_exec . ~ /.bashrc
58
77
59
78
# https://medium.com/data-tyro/resolving-the-conda-libmamba-issue-and-environment-activation-trouble-9f911a6106a4
@@ -77,16 +96,16 @@ setup_miniconda () {
77
96
78
97
# These variables will be exported outside
79
98
echo " [SETUP] Exporting Miniconda variables ..."
80
- export PATH=" ${miniconda_prefix } /bin:${PATH} "
81
- export CONDA=" ${miniconda_prefix } "
99
+ export PATH=" ${conda_install_prefix } /bin:${PATH} "
100
+ export CONDA=" ${conda_install_prefix } "
82
101
83
102
if [ -f " ${GITHUB_PATH} " ]; then
84
103
echo " [SETUP] Saving Miniconda variables to ${GITHUB_PATH} ..."
85
- echo " ${miniconda_prefix } /bin" >> " ${GITHUB_PATH} "
86
- echo " CONDA=${miniconda_prefix } " >> " ${GITHUB_PATH} "
104
+ echo " ${conda_install_prefix } /bin" >> " ${GITHUB_PATH} "
105
+ echo " CONDA=${conda_install_prefix } " >> " ${GITHUB_PATH} "
87
106
fi
88
107
89
- echo " [SETUP] Successfully set up Miniconda at ${miniconda_prefix } "
108
+ echo " [SETUP] Successfully set up Miniconda at ${conda_install_prefix } "
90
109
}
91
110
92
111
__handle_pyopenssl_version_issue () {
0 commit comments