Skip to content

Commit ab43d71

Browse files
committed
added travis-ci support for arm64
Signed-off-by: ossdev07 <[email protected]>
1 parent dd0d353 commit ab43d71

File tree

4 files changed

+127
-21
lines changed

4 files changed

+127
-21
lines changed

.travis.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ matrix:
3636
- env:
3737
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
3838

39+
- dist: trusty
40+
os: linux
41+
sudo: true
42+
arch: arm64
43+
env:
44+
- JOB="3.7" ENV_FILE="ci/deps/travis-37-aarch64.yaml" PATTERN="(not slow and not network)"
45+
3946
- env:
4047
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
4148
services:
@@ -89,6 +96,6 @@ script:
8996

9097
after_script:
9198
- echo "after_script start"
92-
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
93-
- ci/print_skipped.py
99+
- source activate pandas-dev && pushd /tmp && if [ `uname -m` = 'aarch64' ];then VAR="python3.7" ; else VAR="python";fi && $VAR -c "import pandas; pandas.show_versions();" && popd
100+
- ci/print_skipped.py
94101
- echo "after_script done"

ci/deps/travis-37-aarch64.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
- c3i_test
6+
dependencies:
7+
- python=3.7.*
8+
9+
# tools
10+
- cython>=0.29.13
11+
- pytest>=5.0.1
12+
- pytest-xdist>=1.21
13+
- hypothesis>=3.58.0
14+
15+
# pandas dependencies
16+
- botocore>=1.11
17+
- numpy
18+
- python-dateutil
19+
- pytz
20+
- pip
21+
- pip:
22+
- moto

ci/run_tests.sh

+23-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
# https://github.com/pytest-dev/pytest/issues/1075
66
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
77

8+
if [ -n "$LOCALE_OVERRIDE" ]; then
9+
export LC_ALL="$LOCALE_OVERRIDE"
10+
export LANG="$LOCALE_OVERRIDE"
11+
PANDAS_LOCALE=`python -c 'import pandas; pandas.get_option("display.encoding")'`
12+
if [[ "$LOCALE_OVERRIDE" != "$PANDAS_LOCALE" ]]; then
13+
echo "pandas could not detect the locale. System locale: $LOCALE_OVERRIDE, pandas detected: $PANDAS_LOCALE"
14+
# TODO Not really aborting the tests until https://github.com/pandas-dev/pandas/issues/23923 is fixed
15+
# exit 1
16+
fi
17+
fi
18+
819
if [[ "not network" == *"$PATTERN"* ]]; then
920
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
1021
fi
@@ -19,14 +30,22 @@ PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --duratio
1930
# Travis does not have have an X server
2031
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
2132
DISPLAY=DISPLAY=:99.0
22-
PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD"
33+
if [ `uname -m` = 'aarch64' ]; then
34+
PYTEST_CMD="xvfb-run -e /dev/stdout pytest -m \"$PATTERN\" -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"
35+
else
36+
PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD"
37+
fi
2338
fi
2439

2540
echo $PYTEST_CMD
26-
sh -c "$PYTEST_CMD"
41+
if [ `uname -m` = 'aarch64' ]; then
42+
sudo sh -c "$PYTEST_CMD"
43+
else
44+
sh -c "$PYTEST_CMD"
45+
fi
2746

2847
if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then
2948
echo "uploading coverage"
30-
echo "bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME"
31-
bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME
49+
echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME"
50+
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
3251
fi

ci/setup_env.sh

+73-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -e
22

3+
IS_SUDO=""
4+
ARCHICONDA_PYTHON="python3.7"
35
# edit the locale file if needed
46
if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
57
echo "Adding locale to the first line of pandas/__init__.py"
@@ -12,8 +14,13 @@ if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
1214
echo
1315
fi
1416

15-
MINICONDA_DIR="$HOME/miniconda3"
1617

18+
if [ `uname -m` = 'aarch64' ]; then
19+
MINICONDA_DIR="$HOME/archiconda3"
20+
IS_SUDO="sudo"
21+
else
22+
MINICONDA_DIR="$HOME/miniconda3"
23+
fi
1724

1825
if [ -d "$MINICONDA_DIR" ]; then
1926
echo
@@ -36,9 +43,24 @@ else
3643
exit 1
3744
fi
3845

39-
wget -q "https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh" -O miniconda.sh
40-
chmod +x miniconda.sh
41-
./miniconda.sh -b
46+
if [ `uname -m` = 'aarch64' ]; then
47+
wget -q "https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh" -O archiconda.sh
48+
chmod +x archiconda.sh
49+
$IS_SUDO apt-get install python-dev
50+
$IS_SUDO apt-get install python3-pip
51+
$IS_SUDO apt-get install lib$ARCHICONDA_PYTHON-dev
52+
$IS_SUDO apt-get install xvfb
53+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/lib:/usr/local/bin/python
54+
./archiconda.sh -b
55+
echo "chmod MINICONDA_DIR"
56+
$IS_SUDO chmod -R 777 $MINICONDA_DIR
57+
$IS_SUDO cp $MINICONDA_DIR/bin/* /usr/bin/
58+
$IS_SUDO rm /usr/bin/lsb_release
59+
else
60+
wget -q "https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh" -O miniconda.sh
61+
chmod +x miniconda.sh
62+
./miniconda.sh -b
63+
fi
4264

4365
export PATH=$MINICONDA_DIR/bin:$PATH
4466

@@ -50,8 +72,8 @@ echo
5072
echo "update conda"
5173
conda config --set ssl_verify false
5274
conda config --set quiet true --set always_yes true --set changeps1 false
53-
conda install pip # create conda to create a historical artifact for pip & setuptools
54-
conda update -n base conda
75+
$IS_SUDO conda install pip # create conda to create a historical artifact for pip & setuptools
76+
$IS_SUDO conda update -n base conda
5577

5678
echo "conda info -a"
5779
conda info -a
@@ -91,8 +113,18 @@ conda list
91113
conda remove --all -q -y -n pandas-dev
92114

93115
echo
116+
if [ `uname -m` = 'aarch64' ]; then
117+
$IS_SUDO chmod -R 777 $MINICONDA_DIR
118+
$IS_SUDO conda install botocore
119+
$IS_SUDO conda install numpy
120+
$IS_SUDO conda install python-dateutil=2.8.0
121+
$IS_SUDO conda install hypothesis
122+
$IS_SUDO conda install pytz
123+
$IS_SUDO chmod -R 777 $MINICONDA_DIR
124+
fi
125+
94126
echo "conda env create -q --file=${ENV_FILE}"
95-
time conda env create -q --file="${ENV_FILE}"
127+
time $IS_SUDO conda env create -q --file="${ENV_FILE}"
96128

97129

98130
if [[ "$BITS32" == "yes" ]]; then
@@ -106,13 +138,17 @@ source activate pandas-dev
106138
echo
107139
echo "remove any installed pandas package"
108140
echo "w/o removing anything else"
109-
conda remove pandas -y --force || true
110-
pip uninstall -y pandas || true
141+
$IS_SUDO conda remove pandas -y --force || true
142+
if [ `uname -m` = 'aarch64' ]; then
143+
$IS_SUDO $ARCHICONDA_PYTHON -m pip uninstall -y pandas || true
144+
else
145+
pip uninstall -y pandas || true
146+
fi
111147

112148
echo
113149
echo "remove postgres if has been installed with conda"
114150
echo "we use the one from the CI"
115-
conda remove postgresql -y --force || true
151+
$IS_SUDO conda remove postgresql -y --force || true
116152

117153
echo
118154
echo "conda list pandas"
@@ -121,7 +157,10 @@ conda list pandas
121157
# Make sure any error below is reported as such
122158

123159
echo "[Build extensions]"
124-
python setup.py build_ext -q -i -j2
160+
if [ `uname -m` = 'aarch64' ]; then
161+
sudo chmod -R 777 /home/travis/.ccache
162+
fi
163+
python setup.py build_ext -q -i
125164

126165
# XXX: Some of our environments end up with old versions of pip (10.x)
127166
# Adding a new enough version of pip to the requirements explodes the
@@ -130,21 +169,40 @@ python setup.py build_ext -q -i -j2
130169
# - py35_compat
131170
# - py36_32bit
132171
echo "[Updating pip]"
133-
python -m pip install --no-deps -U pip wheel setuptools
172+
if [ `uname -m` = 'aarch64' ]; then
173+
sudo chmod -R 777 /home/travis/archiconda3/envs/pandas-dev/lib/$ARCHICONDA_PYTHON/site-packages
174+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install pytest-forked
175+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install pytest-xdist
176+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install --no-deps -U pip wheel setuptools
177+
sudo chmod -R 777 $MINICONDA_DIR
178+
else
179+
python -m pip install --no-deps -U pip wheel setuptools
180+
fi
134181

135182
echo "[Install pandas]"
136-
python -m pip install --no-build-isolation -e .
183+
if [ `uname -m` = 'aarch64' ]; then
184+
$IS_SUDO chmod -R 777 $MINICONDA_DIR
185+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install numpy
186+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install hypothesis
187+
$IS_SUDO chmod -R 777 /home/travis/.cache/
188+
$IS_SUDO $ARCHICONDA_PYTHON -m pip install --no-build-isolation -e .
189+
else
190+
python -m pip install --no-build-isolation -e .
191+
fi
137192

138193
echo
139194
echo "conda list"
140195
conda list
141196

142197
# Install DB for Linux
143-
144198
if [[ -n ${SQL:0} ]]; then
145199
echo "installing dbs"
200+
if [ `uname -m` = 'aarch64' ]; then
201+
sudo systemctl start mysql
202+
else
203+
psql -c 'create database pandas_nosetest;' -U postgres
204+
fi
146205
mysql -e 'create database pandas_nosetest;'
147-
psql -c 'create database pandas_nosetest;' -U postgres
148206
else
149207
echo "not using dbs on non-linux Travis builds or Azure Pipelines"
150208
fi

0 commit comments

Comments
 (0)