Skip to content

Commit 3c46709

Browse files
authored
Decouple aarch64 ci setup and build (#1470)
1 parent e904a85 commit 3c46709

File tree

2 files changed

+46
-41
lines changed

2 files changed

+46
-41
lines changed

aarch64_linux/aarch64_ci_build.sh

100755100644
Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
11
#!/bin/bash
22
set -eux -o pipefail
33

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-
PATH=/opt/conda/bin:$PATH
10-
LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
11-
12-
###############################################################################
13-
# Install OS dependent packages
14-
###############################################################################
15-
yum -y install epel-release
16-
yum -y install less zstd libgomp
17-
18-
###############################################################################
19-
# Install conda
20-
# disable SSL_verify due to getting "Could not find a suitable TLS CA certificate bundle, invalid path"
21-
# when using Python version, less than the conda latest
22-
###############################################################################
23-
echo 'Installing conda-forge'
24-
curl -L -o /mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
25-
chmod +x /mambaforge.sh
26-
/mambaforge.sh -b -p /opt/conda
27-
rm /mambaforge.sh
28-
/opt/conda/bin/conda config --set ssl_verify False
29-
/opt/conda/bin/conda install -y -c conda-forge python=${DESIRED_PYTHON} numpy pyyaml setuptools patchelf pygit2 openblas
30-
python --version
31-
conda --version
32-
33-
###############################################################################
34-
# Exec libglfortran.a hack
35-
#
36-
# libgfortran.a from quay.io/pypa/manylinux2014_aarch64 is not compiled with -fPIC.
37-
# This causes __stack_chk_guard@@GLIBC_2.17 on pytorch build. To solve, get
38-
# ubuntu's libgfortran.a which is compiled with -fPIC
39-
###############################################################################
40-
cd ~/
41-
curl -L -o ~/libgfortran-10-dev.deb http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-10/libgfortran-10-dev_10.5.0-1ubuntu1_arm64.deb
42-
ar x ~/libgfortran-10-dev.deb
43-
tar --use-compress-program=unzstd -xvf data.tar.zst -C ~/
44-
cp -f ~/usr/lib/gcc/aarch64-linux-gnu/10/libgfortran.a /opt/rh/devtoolset-10/root/usr/lib/gcc/aarch64-redhat-linux/10/
4+
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
5+
source $SCRIPTPATH/aarch64_ci_setup.sh
456

467
###############################################################################
478
# Run aarch64 builder python

aarch64_linux/aarch64_ci_setup.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
set -eux -o pipefail
3+
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+
PATH=/opt/conda/bin:$PATH
10+
LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
11+
12+
###############################################################################
13+
# Install OS dependent packages
14+
###############################################################################
15+
yum -y install epel-release
16+
yum -y install less zstd libgomp
17+
18+
###############################################################################
19+
# Install conda
20+
# disable SSL_verify due to getting "Could not find a suitable TLS CA certificate bundle, invalid path"
21+
# when using Python version, less than the conda latest
22+
###############################################################################
23+
echo 'Installing conda-forge'
24+
curl -L -o /mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
25+
chmod +x /mambaforge.sh
26+
/mambaforge.sh -b -p /opt/conda
27+
rm /mambaforge.sh
28+
/opt/conda/bin/conda config --set ssl_verify False
29+
/opt/conda/bin/conda install -y -c conda-forge python=${DESIRED_PYTHON} numpy pyyaml setuptools patchelf pygit2 openblas
30+
python --version
31+
conda --version
32+
33+
###############################################################################
34+
# Exec libglfortran.a hack
35+
#
36+
# libgfortran.a from quay.io/pypa/manylinux2014_aarch64 is not compiled with -fPIC.
37+
# This causes __stack_chk_guard@@GLIBC_2.17 on pytorch build. To solve, get
38+
# ubuntu's libgfortran.a which is compiled with -fPIC
39+
###############################################################################
40+
cd ~/
41+
curl -L -o ~/libgfortran-10-dev.deb http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-10/libgfortran-10-dev_10.5.0-1ubuntu1_arm64.deb
42+
ar x ~/libgfortran-10-dev.deb
43+
tar --use-compress-program=unzstd -xvf data.tar.zst -C ~/
44+
cp -f ~/usr/lib/gcc/aarch64-linux-gnu/10/libgfortran.a /opt/rh/devtoolset-10/root/usr/lib/gcc/aarch64-redhat-linux/10/

0 commit comments

Comments
 (0)