Skip to content

Commit 32aee44

Browse files
authored
Merge ea79455 into 6621626
2 parents 6621626 + ea79455 commit 32aee44

File tree

2 files changed

+17
-101
lines changed

2 files changed

+17
-101
lines changed
Lines changed: 16 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
name: Multipy runtime nightly release
1+
name: Multipy runtime nightly test + release
22

33
on:
44
schedule:
55
- cron: '0 2 * * *' # run at 2 AM UTC
6+
pull_request:
7+
push:
8+
branches:
9+
- main
610

711
jobs:
812
unittest:
913
strategy:
1014
matrix:
1115
python-version: [3.8, 3.9, '3.10']
12-
platform: [linux.2xlarge]
13-
abi: [0,1]
16+
platform: [ubuntu-18.04]
1417
fail-fast: false
1518
runs-on: ${{ matrix.platform }}
1619
steps:
17-
- name: Update pip
18-
run: |
19-
sudo yum update -y
20-
sudo yum -y install git python3-pip
21-
sudo pip3 install --upgrade pip
22-
23-
- name: Setup conda
24-
run: |
25-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ${RUNNER_TEMP}/miniconda.sh
26-
bash ${RUNNER_TEMP}/miniconda.sh -b -p ${RUNNER_TEMP}/miniconda
27-
28-
- name: setup Path
29-
run: |
30-
echo "${RUNNER_TEMP}/miniconda/bin" >> $GITHUB_PATH
31-
echo "CONDA=${RUNNER_TEMP}/miniconda" >> $GITHUB_PATH
32-
3320
- name: Checkout MultiPy
3421
uses: actions/checkout@v2
3522
with:
@@ -40,94 +27,23 @@ jobs:
4027
with:
4128
github-secret: ${{ secrets.GITHUB_TOKEN }}
4229

43-
- name: Install C++ toolchain
44-
run: |
45-
sudo yum -y install clang llvm
46-
export CC=clang
47-
export CXX=clang++
48-
sudo yum -y install xz-devel bzip2-devel libnsl2-devel readline-devel expat-devel gdbm-devel glibc-devel gmp-devel libffi-devel libGL-devel libX11-devel ncurses-devel openssl-devel sqlite-devel tcl-devel tix-devel tk-devel
49-
sudo yum -y install lzma
50-
sudo yum -y install uuid
51-
sudo yum -y install openmpi-devel
52-
sudo yum -y install zlib-devel
53-
54-
- name: create conda env
55-
run: |
56-
conda create --name multipy_runtime_env python=${{ matrix.python-version }}
57-
conda info
58-
59-
- name: Install python/pytorch dependencies
60-
shell: bash -l {0}
30+
- name: Build
6131
env:
62-
PYTHON_VERSION: ${{ matrix.python-version }}
63-
run: |
64-
conda run -n multipy_runtime_env python -m pip install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses pytest
65-
66-
- name: gen examples
67-
shell: bash -l {0}
68-
env:
69-
PYTHON_VERSION: ${{ matrix.python-version }}
70-
run: |
71-
# A minor hack to get the CI working as conda doesn't have torch,
72-
# fortunately we can remove this once we have a dynamically linked torch
73-
cd multipy/runtime/example
74-
conda create --name example_env python=${{ matrix.python-version }}
75-
conda run -n example_env python -m pip install torch torchvision torchaudio pathlib
76-
conda run -n example_env python generate_examples.py
32+
DOCKER_BUILDKIT: 1
33+
run: docker build -t multipy --progress=plain --build-arg PYTHON_VERSION=${{ matrix.python-version }} .
7734

78-
- name: Build pytorch with ABI=${{ matrix.abi }}
79-
shell: bash -l {0}
80-
env:
81-
PYTHON_VERSION: ${{ matrix.python-version }}
82-
run: |
83-
export GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}
84-
export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
85-
export TORCH_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
86-
cd multipy/runtime/third-party/pytorch
87-
export USE_DEPLOY=1
88-
conda run -n multipy_runtime_env python setup.py develop
89-
90-
- name: Build multipy runtime with ABI=${{ matrix.abi }}
91-
shell: bash -l {0}
92-
env:
93-
PYTHON_VERSION: ${{ matrix.python-version }}
94-
run: |
95-
cd multipy/runtime
96-
mkdir build
97-
cd build
98-
conda run -n multipy_runtime_env cmake -DABI_EQUALS_1=${{ matrix.abi }} ..
99-
conda run -n multipy_runtime_env cmake --build . --config Release
100-
101-
- name: install files
102-
shell: bash -l {0}
103-
env:
104-
PYTHON_VERSION: ${{ matrix.python-version }}
105-
run: |
106-
cd multipy/runtime/build
107-
conda run -n multipy_runtime_env cmake --install . --prefix "."
108-
109-
- name: Run unit tests with ABI=${{ matrix.abi }}
110-
shell: bash -l {0}
111-
env:
112-
PYTHON_VERSION: ${{ matrix.python-version }}
113-
run: |
114-
export PYTHONPATH=$PYTHONPATH:$(pwd)
115-
cd multipy/runtime/build
116-
./test_deploy
117-
118-
- name: create tarball [click me to get a list of files for the nightly release]
119-
shell: bash -l {0}
120-
env:
121-
PYTHON_VERSION: ${{ matrix.python-version }}
35+
- name: Create Tarball
12236
run: |
123-
cd multipy/runtime/build/dist
124-
tar -czvf multipy_runtime.tar.gz multipy/
37+
docker cp $(docker run -d multipy):/opt/dist/multipy .
38+
tar -czvf multipy_runtime.tar.gz multipy/
39+
pwd
40+
ls
12541
12642
- name: Update nightly release
12743
uses: pyTooling/Actions/releaser@main
12844
with:
129-
tag: nightly-runtime-abi-${{ matrix.abi }}
45+
tag: nightly-runtime-python-${{ matrix.python-version }}
13046
rm: true
13147
token: ${{ secrets.GITHUB_TOKEN }}
13248
files: |
133-
multipy/runtime/build/dist/multipy_runtime.tar.gz
49+
multipy_runtime.tar.gz

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ RUN mkdir multipy/runtime/build && \
7878
RUN cd multipy/runtime/example && python generate_examples.py
7979
ENV PYTHONPATH=. LIBTEST_DEPLOY_LIB=multipy/runtime/build/libtest_deploy_lib.so
8080

81-
RUN mkdir /opt/dist && cp -r multipy/runtime/build/dist /opt/dist/
81+
RUN mkdir /opt/dist && cp -r multipy/runtime/build/dist/* /opt/dist/

0 commit comments

Comments
 (0)