|
2 | 2 | set -eux -o pipefail
|
3 | 3 |
|
4 | 4 | # This script is used to prepare the Docker container for aarch64_ci_wheel_build.py python script
|
5 |
| -# as we need to install conda and setup the python version for the build. |
6 |
| - |
7 |
| -CONDA_PYTHON_EXE=/opt/conda/bin/python |
8 |
| -CONDA_EXE=/opt/conda/bin/conda |
9 |
| -CONDA_ENV_NAME=aarch64_env |
10 |
| -PATH=/opt/conda/bin:$PATH |
11 |
| -LD_LIBRARY_PATH=/opt/conda/envs/${CONDA_ENV_NAME}/lib/:/opt/conda/lib:$LD_LIBRARY_PATH |
12 |
| - |
13 |
| -############################################################################### |
14 |
| -# Install conda |
15 |
| -# disable SSL_verify due to getting "Could not find a suitable TLS CA certificate bundle, invalid path" |
16 |
| -# when using Python version, less than the conda latest |
17 |
| -############################################################################### |
18 |
| -echo 'Installing conda-forge' |
19 |
| -curl -L -o /mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh |
20 |
| -chmod +x /mambaforge.sh |
21 |
| -/mambaforge.sh -b -p /opt/conda |
22 |
| -rm /mambaforge.sh |
23 |
| -source /opt/conda/etc/profile.d/conda.sh |
24 |
| -conda config --set ssl_verify False |
25 |
| -conda create -y -c conda-forge -n "${CONDA_ENV_NAME}" python=${DESIRED_PYTHON} |
26 |
| -conda activate "${CONDA_ENV_NAME}" |
| 5 | +# as we need to setup the required python version and install few tools. |
27 | 6 |
|
| 7 | +dnf update |
| 8 | +dnf install -y epel-release |
| 9 | +dnf install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make |
| 10 | + |
| 11 | +if [[ "$DESIRED_PYTHON" == "3.8" ]]; then |
| 12 | + sudo dnf install python38 |
| 13 | +elif [[ "$DESIRED_PYTHON" == "3.9" ]]; then |
| 14 | + sudo dnf install python39 |
| 15 | +elif [[ "$DESIRED_PYTHON" == "3.10" ]]; then |
| 16 | + wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz |
| 17 | + tar xzf Python-3.10.14.tgz |
| 18 | + cd Python-3.10.14 |
| 19 | + ./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions |
| 20 | + make -j 8 |
| 21 | + make altinstall |
| 22 | + cd .. |
| 23 | + rm Python-3.10.14.tgz |
| 24 | +elif [[ "$DESIRED_PYTHON" == "3.11" ]]; then |
| 25 | + wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz |
| 26 | + tar xzf Python-3.11.9.tgz |
| 27 | + cd Python-3.11.9 |
| 28 | + ./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions |
| 29 | + make -j 8 |
| 30 | + make altinstall |
| 31 | + cd .. |
| 32 | + rm Python-3.11.9.tgz |
| 33 | +else |
| 34 | + echo "unsupported python version passed. use 3.8, 3.9, 3.10 or 3.11" |
| 35 | +fi |
| 36 | + |
| 37 | +/usr/local/bin/python$DESIRED_PYTHON -m venv appenv |
| 38 | + |
| 39 | +source appenv/bin/activate |
| 40 | + |
| 41 | +python3 --version |
| 42 | + |
| 43 | +yum install -y python3-devel python3-pip openblas-openmp |
| 44 | + |
| 45 | +pip3 install dataclasses typing-extensions scons pyyaml pygit2 pyyaml ninja patchelf |
| 46 | +pip3 install Cython |
28 | 47 | if [[ "$DESIRED_PYTHON" == "3.8" ]]; then
|
29 | 48 | pip install -q numpy==1.24.4
|
30 | 49 | else
|
31 | 50 | pip install -q --pre numpy==2.0.0rc1
|
32 | 51 | fi
|
33 |
| -conda install -y -c conda-forge pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25=*openmp* ninja==1.11.1 scons==4.5.2 |
34 |
| - |
35 |
| -python --version |
36 |
| -conda --version |
|
0 commit comments