This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
226 lines (217 loc) · 8.34 KB
/
benchmark_cpython.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Benchmark CPython
on:
workflow_dispatch:
jobs:
build_cpython_ubuntu:
strategy:
matrix:
include:
- cores: "2"
os: ubuntu-22.04
osname: ubuntu-22.04
runner-type: GitHub-Hosted
- cores: "2"
os: ubuntu-2204-2-cores-aws-xlarge
osname: ubuntu-22.04
runner-type: Self-Hosted AWS EC2 t2.large
#- cores: "4"
# os: ubuntu-latest-4-cores
- cores: "8"
os: ubuntu-latest-8-cores
osname: ubuntu-latest
runner-type: GitHub-Hosted
#- cores: "16"
# os: ubuntu-latest-16-cores
# runner-type: GitHub-Hosted
#- cores: "32"
# os: ubuntu-latest-32-cores
# runner-type: GitHub-Hosted
#- cores: "64"
# os: ubuntu-latest-64-cores
# runner-type: GitHub-Hosted
name: "CPython - ${{ matrix.osname }} - ${{ matrix.runner-type}} - ${{ matrix.cores}} cores"
runs-on: ${{ matrix.os }}
env:
OPENSSL_VER: 1.1.1t
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- name: Clone CPython
uses: actions/checkout@v3
with:
repository: python/cpython
path: CPython
ref: main
# Following steps are copy/pasted from CPython's .github/workflows/build.yml
# build_ubuntu job, with some paths modified to fit the benchmark behavior.
- name: Register gcc problem matcher
run: echo "::add-matcher::CPython/.github/problem-matchers/gcc.json"
- name: Install Dependencies
run: sudo ./CPython/.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/CPython/multissl" >> $GITHUB_ENV
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/CPython/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/CPython/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v3
with:
path: ./CPython/multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 CPython/Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
- name: Create directories for read-only out-of-tree builds
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
- name: Bind mount sources read-only
run: sudo mount --bind -o ro ${GITHUB_WORKSPACE}/CPython $CPYTHON_RO_SRCDIR
- name: Configure CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: |
../cpython-ro-srcdir/configure \
--with-pydebug \
--with-openssl=$OPENSSL_DIR
- name: Build CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make -j4
- name: Display build info
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make pythoninfo
- name: Remount sources writable for tests
# some tests write to srcdir, lack of pyc files slows down testing
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
- name: Tests
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
build_cpython_windows_32bits:
strategy:
matrix:
include:
- cores: "2"
os: windows-2022
runner-type: GitHub-Hosted
#- cores: "8"
# os: windows-2022-8-cores
# runner-type: GitHub-Hosted
#- cores: "16"
# os: windows-2022-16-cores
# runner-type: GitHub-Hosted
#- cores: "32"
# os: windows-2022-32-cores
# runner-type: GitHub-Hosted
#- cores: "64"
# os: windows-2022-64-cores
# runner-type: GitHub-Hosted
name: "CPython - ${{ matrix.os }} - ${{ matrix.runner-type }} - ${{ matrix.cores }} cores - x86 build"
runs-on: ${{ matrix.os }}
env:
IncludeUwp: 'true'
steps:
- name: Clone CPython
uses: actions/checkout@v3
with:
repository: python/cpython
path: CPython
ref: main
# Following steps are copy/pasted from CPython's .github/workflows/build.yml
# build_win32 job, with some paths modified
- name: Build CPython
run: .\CPython\PCbuild\build.bat -e -d -p Win32
- name: Display build info
run: .\CPython\python.bat -m test.pythoninfo
- name: Tests
run: .\CPython\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
build_cpython_windows_64bits:
strategy:
matrix:
include:
- cores: "2"
os: windows-2022
runner-type: GitHub-Hosted
#- cores: "8"
# os: windows-2022-8-cores
# runner-type: GitHub-Hosted
#- cores: "16"
# os: windows-2022-16-cores
# runner-type: GitHub-Hosted
#- cores: "32"
# os: windows-2022-32-cores
# runner-type: GitHub-Hosted
#- cores: "64"
# os: windows-2022-64-cores
# runner-type: GitHub-Hosted
name: "CPython - ${{ matrix.os }} - ${{ matrix.runner-type }} - ${{ matrix.cores }} cores - x64 build"
runs-on: ${{ matrix.os }}
env:
IncludeUwp: 'true'
steps:
- name: Clone CPython
uses: actions/checkout@v3
with:
repository: python/cpython
path: CPython
ref: main
# Following steps are copy/pasted from CPython's .github/workflows/build.yml
# build_win_amd64 job, with some paths modified
- name: Register MSVC problem matcher
run: echo "::add-matcher::CPython/.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\CPython\PCbuild\build.bat -e -d -p x64
- name: Display build info
run: .\CPython\python.bat -m test.pythoninfo
- name: Tests
run: .\CPython\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
# TODO: macOS runners are expensive, enable only when the benchmarking reporting is
# properly setup.
#build_cpython_macOS:
# strategy:
# matrix:
# include:
# - cores: "3"
# os: macos-latest-3-cores
# runner-type: GitHub-Hosted
# - cores: "32"
# os: macos-latest-32-cores
# runner-type: GitHub-Hosted
# name: "CPython - ${{ matrix.os }} - ${{ matrix.runner-type }} - ${{ matrix.cores }}"
# runs-on: ${{ matrix.os }}
# env:
# HOMEBREW_NO_ANALYTICS: 1
# HOMEBREW_NO_AUTO_UPDATE: 1
# HOMEBREW_NO_INSTALL_CLEANUP: 1
# PYTHONSTRICTEXTENSIONBUILD: 1
# steps:
# - name: Clone CPython
# uses: actions/checkout@v3
# with:
# repository: python/cpython
# path: CPython
# ref: main
# # Following steps are copy/pasted from CPython's .github/workflows/build.yml
# # build_macos job, with some paths modified
# - name: Install Homebrew dependencies
# run: brew install pkg-config [email protected] xz gdbm tcl-tk
# - name: Configure CPython
# run: |
# CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
# LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
# PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
# ./CPython/configure \
# --with-pydebug \
# --prefix=/opt/python-dev \
# --with-openssl="$(brew --prefix [email protected])"
# - name: Build CPython
# run: make -j4
# - name: Display build info
# run: make pythoninfo
# - name: Tests
# run: make buildbottest TESTOPTS="-j4 -uall,-cpu"