-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (136 loc) · 4.85 KB
/
build-one-job.yml
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
145
146
147
148
149
150
151
152
153
154
name: Dragon
on:
workflow_dispatch: {}
# push:
# branches:
# - master
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
jobs:
Build:
runs-on: ubuntu-20.04
strategy:
fail-fast:
false
matrix:
python-version: ["3.9.4", "3.10.10", "3.11.7"]
outputs:
GITHASH: ${{ steps.build.outputs.GITHASH }}
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: check environment
run: |
set -x
uname -a
git branch
ls
which python3
python3 --version
whoami
- name: Build
id: build
run: |
. hack/build_no_module
set -x
ARTIFACT=$(ls ./src/release)
GITHASH=$(git rev-parse --short HEAD)
VERSION=$(echo $ARTIFACT | awk -F- '{print $2}')
echo "GITHASH=$GITHASH" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
mv ./src/release/$ARTIFACT ./src/release/dragon-$VERSION-py${{ matrix.python-version }}-$GITHASH.tar.gz
ARTIFACT=$(ls ./src/release)
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_OUTPUT
- name: Run Test
run: |
set -ex
pwd
ls -la
ls ./src/release
echo "ARTIFACT=$ARTIFACT"
############################
### untar relase package ###
############################
mkdir -p release
tar -C release -xvzf $PWD/src/release/${{ steps.build.outputs.ARTIFACT }}
ROOTDIR="$(realpath release/dragon-${{ steps.build.outputs.VERSION }})"
#################################
### Install Python Dependency ###
#################################
python3 -m venv dvenv
source dvenv/bin/activate
python3 -m pip install -U pip
python3 -m pip install -c src/constraints.txt \
cloudpickle \
cryptography \
numpy \
parameterized \
scipy \
wheel \
pyyaml
python3 -m pip install $ROOTDIR/dragon-${{ steps.build.outputs.VERSION }}-*.whl
############################
### set environment path ###
############################
pushd $ROOTDIR
export DRAGON_VERSION=${{ steps.build.outputs.VERSION }}
export DRAGON_BASE_DIR=$PWD
export DRAGON_INCLUDE_DIR=$DRAGON_BASE_DIR/include
export DRAGON_LIB_DIR=$DRAGON_BASE_DIR/lib
export PATH=$DRAGON_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$DRAGON_LIB_DIR:$LD_LIBRARY_PATH
export LIBRARY_PATH=$DRAGON_LIB_DIR:$LIBRARY_PATH
export DRAGON_DEBUG="0"
popd
####################
### Run unittest ###
####################
make -C test test
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/dragon_unittests
python3 test_utils.py -f -v
python3 test_channels.py -f -v
popd
# Run Dragon GS client API tests
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/examples/dragon_gs_client/
dragon queue_demo.py
dragon pi_demo.py 4
dragon --single-node-override pi_demo.py 4
# Reduce size of default memory pool to 0.5GB
DRAGON_DEFAULT_SEG_SZ=536870912 dragon connection_demo.py
dragon dragon_run_api.py ls
dragon dragon_popen_api.py ls
popd
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/examples/dragon_native/
dragon pi_demo.py 4
popd
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/examples/multiprocessing/unittests
make
popd
# Run multiprocessing benchmarks
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/examples/multiprocessing/
dragon p2p_lat.py --iterations 1000 --lg_max_message_size 12 --dragon
dragon p2p_bw.py --iterations 10 --lg_max_message_size 12 --dragon
dragon aa_bench.py --iterations 100 --num_workers $NCPU --lg_message_size 21 --dragon
popd
# Run multiprocessing numpy teests
find /dev/shm -user $(USER) -exec rm -fr {} \;
pushd $ROOTDIR/examples/multiprocessing/numpy-mpi4py-examples
dragon numpy_scale_work.py
dragon numpy_scale_work.py --dragon
dragon scipy_scale_work.py
dragon scipy_scale_work.py --dragon
popd