This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
285 lines (264 loc) · 10.5 KB
/
ci-build.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: build whl and uploads
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-cpu:
runs-on: windows-2022
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
BAZEL_PATH: "D:\\bazel.exe"
TEMP: C:\\Users\\runneradmin\\Temp
TMP: C:\\Users\\runneradmin\\Temp
PYTHONUNBUFFERED: '1'
steps:
- name: Show user home
run: ls ~
- name: Show cpu info
run: Get-CimInstance Win32_Processor
- name: Show memory info
run: Get-CimInstance Win32_PhysicalMemory | Format-Table Tag, DeviceLocator, Capacity, Speed
- name: Configure pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8GB
maximum-size: 32GB
disk-root: "C:"
# - name: Show disk info
# run: Get-Volume -DriveLetter CD | Sort-Object DriveLetter
- name: Workaround https://github.com/bazelbuild/bazel/issues/18592
run: rm -Recurse -Force "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg" -ErrorAction Continue
- uses: actions/checkout@v2
with:
submodules: true
- name: Download Bazelisk
run: curl -k -L https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-windows-amd64.exe -o $env:BAZEL_PATH
- uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('build-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
#=============#
# Python 3.11 #
#=============#
- name: py311
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: py311 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py311 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cpu -bazel_path $env:BAZEL_PATH -vs_version 2022
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#=============#
# Python 3.10 #
#=============#
- name: py310
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: py310 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py310 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cpu -bazel_path $env:BAZEL_PATH -vs_version 2022
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#============#
# Python 3.9 #
#============#
- name: py39
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: py39 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py39 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cpu -bazel_path $env:BAZEL_PATH -vs_version 2022
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#============#
# Python 3.8 #
#============#
# - name: py38
# uses: actions/setup-python@v2
# with:
# python-version: "3.8"
# - name: py38 pip install
# run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
# - name: py38 build whl and upload
# run: |
# rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
# cd "$env:GITHUB_WORKSPACE/jax"
# ../build-jaxlib.ps1 cpu -bazel_path $env:BAZEL_PATH -vs_version 2022
# az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
# - uses: actions/upload-artifact@v3
# with:
# name: whls
# path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
build-cuda:
strategy:
matrix:
cuda-version: ["11.8", "12.1"]
runs-on: windows-2022
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
BAZEL_PATH: "D:\\bazel.exe"
TEMP: C:\\Users\\runneradmin\\Temp
TMP: C:\\Users\\runneradmin\\Temp
PYTHONUNBUFFERED: '1'
steps:
- name: Show user home
run: ls ~
- name: Show cpu info
run: Get-CimInstance Win32_Processor
- name: Limit cpu
run: |
$p = Get-CimInstance Win32_Processor
if ($p.Name -match "E5-") { throw "CPU is too old!" }
- name: Show memory info
run: Get-CimInstance Win32_PhysicalMemory | Format-Table Tag, DeviceLocator, Capacity, Speed
- name: Configure pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8GB
maximum-size: 32GB
disk-root: "C:"
# - name: Show disk info
# run: Get-Volume -DriveLetter CD | Sort-Object DriveLetter
- name: Workaround https://github.com/bazelbuild/bazel/issues/18592
run: rm -Recurse -Force "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg" -ErrorAction Continue
- uses: actions/checkout@v2
with:
submodules: true
- name: Download Bazelisk
run: curl -k -L https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-windows-amd64.exe -o $env:BAZEL_PATH
- name: Install CUDA ${{ matrix.cuda-version }}
run: |
curl -k -L https://whls.blob.core.windows.net/ci-files/v${{ matrix.cuda-version }}.7z -o cuda.7z
7z x cuda.7z -o'D:/CUDA'
rm cuda.7z
ls D:/CUDA/v${{ matrix.cuda-version }}
- uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('build-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
#=============#
# Python 3.11 #
#=============#
- name: py311
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: py311 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py311 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cuda -bazel_path $env:BAZEL_PATH -vs_version 2022 -cuda_version '${{ matrix.cuda-version }}' -cuda_prefix 'D:/CUDA' -symlink_python
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#=============#
# Python 3.10 #
#=============#
- name: py310
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: py310 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py310 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cuda -bazel_path $env:BAZEL_PATH -vs_version 2022 -cuda_version '${{ matrix.cuda-version }}' -cuda_prefix 'D:/CUDA' -symlink_python
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#============#
# Python 3.9 #
#============#
- name: py39
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: py39 pip install
run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
- name: py39 build whl and upload
run: |
rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
cd "$env:GITHUB_WORKSPACE/jax"
../build-jaxlib.ps1 cuda -bazel_path $env:BAZEL_PATH -vs_version 2022 -cuda_version '${{ matrix.cuda-version }}' -cuda_prefix 'D:/CUDA' -symlink_python
az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
- uses: actions/upload-artifact@v3
with:
name: whls
path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
#============#
# Python 3.8 #
#============#
# - name: py38
# uses: actions/setup-python@v2
# with:
# python-version: "3.8"
# - name: py38 pip install
# run: pip install -r "$env:GITHUB_WORKSPACE/build-requirements.txt"
# - name: py38 build whl and upload
# run: |
# rm -Recurse -Force "$env:GITHUB_WORKSPACE/jax/bazel-dist" -ErrorAction Continue
# cd "$env:GITHUB_WORKSPACE/jax"
# ../build-jaxlib.ps1 cuda -bazel_path $env:BAZEL_PATH -vs_version 2022 -cuda_version '${{ matrix.cuda-version }}' -cuda_prefix 'D:/CUDA' -symlink_python
# az storage blob upload-batch --overwrite -d unstable -s "$env:GITHUB_WORKSPACE/jax/bazel-dist" --pattern '*.whl'
# - uses: actions/upload-artifact@v3
# with:
# name: whls
# path: $env:GITHUB_WORKSPACE/jax/bazel-dist/*.whl
update-index:
if: ${{ ! cancelled() }}
needs:
- build-cpu
- build-cuda
runs-on: windows-2022
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
steps:
- uses: actions/checkout@v2
- name: py311
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: update index.html
run: |
cd "$env:GITHUB_WORKSPACE/"
python ./update_index.py --url_mode absolute unstable > index.html
az storage blob upload --overwrite -c unstable -f index.html -n index.html --content-type='text/html'
az storage blob upload --overwrite -c '$web' -f index.html -n 'unstable/index.html' --content-type='text/html'