-
Notifications
You must be signed in to change notification settings - Fork 35
144 lines (128 loc) · 5.33 KB
/
install_test.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Install tests
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
jobs:
installtest:
strategy:
matrix:
python3-minor-version: [7,8,9,10]
platform: [ubuntu-18.04]
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Set Python Version
run: |
echo "python-version=3.${{ matrix.python3-minor-version }}" >> "$GITHUB_ENV"
- name: Setup Python ${{ env.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
architecture: x64
- name: Checkout MultiPy
uses: actions/checkout@v2
with:
submodules: true
- name: Install runtime build dependencies
run: |
set -eux
sudo apt update
xargs sudo apt install -y -qq --no-install-recommends < build-requirements-debian.txt
git -c fetch.parallel=0 -c submodule.fetchJobs=0 submodule update --init --recursive
- name: Update cmake
run: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor -o /usr/share/keyrings/magic-key.gpg
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/magic-key.gpg] https://apt.kitware.com/ubuntu/ bionic main" | sudo tee -a /etc/apt/sources.list
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y binutils cmake
- name: Set up virtual environment
run: |
set -eux
pip3 install virtualenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export CFLAGS="-fPIC -g"
declare -A py_version_dict
py_version_dict[7]='3.7.10'
py_version_dict[8]='3.8.13'
py_version_dict[9]='3.9.13'
py_version_dict[10]='3.10.6'
py_install_version=${py_version_dict[${{ matrix.python3-minor-version }}]}
~/.pyenv/bin/pyenv install --force ${py_install_version}
virtualenv -p ~/.pyenv/versions/${py_install_version}/bin/python3 ~/venvs/multipy
- name: Install dependencies
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
python -m pip install -r dev-requirements.txt
pip3 install --pre torch
deactivate
- name: Run lightweight pip install within virtualenv
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
INSTALL_PYTHON_ONLY=1 python -m pip install -e .
deactivate
- name: Run pip editable install within virtualenv
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
rm -rf multipy/runtime/build*
pip install -e .
deactivate
- name: Run setup.py install within virtualenv
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
python setup.py install
test -e ~/venvs/multipy/lib/python3.${{ matrix.python3-minor-version }}/site-packages/multipy/runtime/build/libtorch_deploy.a
deactivate
- name: Install sdist
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
python setup.py sdist
pip install dist/*.tar.gz --force-reinstall
test -e ~/venvs/multipy/lib/python3.${{ matrix.python3-minor-version }}/site-packages/multipy/runtime/build/libtorch_deploy.a
deactivate
- name: Install bdist_wheel
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
python setup.py bdist_wheel
pip install dist/*.whl --force-reinstall
test -e ~/venvs/multipy/lib/python3.${{ matrix.python3-minor-version }}/site-packages/multipy/runtime/build/libtorch_deploy.a
deactivate
- name: Install bdist_wheel with cuda tests
run: |
set -eux
source "$HOME/venvs/multipy/bin/activate"
python setup.py bdist_wheel
BUILD_CUDA_TESTS=1 pip install dist/*.whl "--force-reinstall"
test -e ~/venvs/multipy/lib/python3.${{ matrix.python3-minor-version }}/site-packages/multipy/runtime/build/libtorch_deploy.a
deactivate
- name: Install dependencies with conda for 3.8+
run: |
set -eux
if [[ ${{ matrix.python3-minor-version }} -gt 7 ]]; then \
curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install -y python=${{ env.python-version }} mkl mkl-include conda-build pyyaml numpy ipython && \
/opt/conda/bin/conda install -y -c conda-forge libpython-static=${{ env.python-version }} && \
/opt/conda/bin/conda install -y pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch-nightly && \
/opt/conda/bin/conda clean -ya; \
fi
- name: Run pip install with conda for 3.8+
run: |
set -eux
if [[ ${{ matrix.python3-minor-version }} -gt 7 ]]; then
source /opt/conda/bin/activate
pip install -e .
fi