-
Notifications
You must be signed in to change notification settings - Fork 119
/
conda-linux.yml
237 lines (217 loc) · 7.72 KB
/
conda-linux.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
# Script for building CCTBX
# linux image descriptions
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
#
# Parameters:
# distribution: centos, ubuntu
# version: [6, 10]
# modules: <modules artifact name>
# template: <build template file>
# prefix: <build artifact prefix>
jobs:
- job: ${{ format('{0}_{1}', parameters.distribution, join('_', parameters.version) ) }}
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 180
strategy:
maxParallel: 2
matrix:
python2.7:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py27
MODULES: ${{ parameters.modules }}
python3.9:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py39
MODULES: ${{ parameters.modules }}
python3.10:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py310
MODULES: ${{ parameters.modules }}
python3.11:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py311
MODULES: ${{ parameters.modules }}
python3.12:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py312
MODULES: ${{ parameters.modules }}
python3.13:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py313
MODULES: ${{ parameters.modules }}
container:
image: ${{ parameters.distribution }}:${{ join('.', parameters.version) }}
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
variables:
- name: artifact_name
value: ${{ parameters.prefix }}${{ parameters.distribution }}_${{ join('.', parameters.version) }}_$(PYTHON_VERSION)
- name: day
value: $(Get-Date -Format dddd)
steps:
- script: |
job_name=`echo $(Agent.JobName) | sed s/" "/"_"/g`
echo "##vso[task.setvariable variable=job_name]$job_name"
displayName: Set job_name
- script: |
day=`date +%A`
echo $(day)
echo "##vso[task.setVariable variable=day]$day"
displayName: Get day of week
- script: |
echo $(job_name)
echo $(day)
displayName: Check variables
# https://github.com/ApexAI/performance_test/blob/master/azure-pipelines.yml#L9-L17
# centos setup
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "yum install -y sudo"
displayName: Set up sudo for CentOS
condition: or(eq('${{ parameters.distribution }}', 'centos'),
eq('${{ parameters.distribution }}', 'rockylinux'))
- script: |
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y mesa-libGLU-devel mesa-libGL-devel tcsh \
libX11 \
libXext \
libXrender \
libXau \
alsa-lib \
firefox \
gtk2 \
libXcomposite \
libXcursor \
libXi \
libXrandr \
pciutils \
libXScrnSaver \
libXtst \
libXdamage \
libXfixes \
libXxf86vm \
wget \
xorg-x11-server-Xvfb
displayName: Install dependencies for CentOS
condition: or(eq('${{ parameters.distribution }}', 'centos'),
eq('${{ parameters.distribution }}', 'rockylinux'))
- script: |
sudo yum install -y gtkmm24
displayName: Install dependencies for CentOS 7 and Rocky Linux 8
condition: and(or(eq('${{ parameters.distribution }}', 'centos'),
eq('${{ parameters.distribution }}', 'rockylinux')),
ne('${{ parameters.version[0] }}', 9))
- script: |
sudo yum install -y glibc-langpack-en gtkmm30
displayName: Install dependencies for Rocky Linux 9
condition: and(eq('${{ parameters.distribution }}', 'rockylinux'),
eq('${{ parameters.version[0] }}', 9))
- bash: |
echo "##vso[task.setvariable variable=LC_ALL]C.utf8"
displayName: Setup locale for Rocky Linux 8
condition: eq('${{ parameters.version[0] }}', 8)
# ubuntu setup
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo for Ubuntu
condition: eq('${{ parameters.distribution }}', 'ubuntu')
- script: |
export DEBIAN_FRONTEND=noninteractive
sudo --preserve-env=DEBIAN_FRONTEND apt-get install -y \
build-essential \
curl \
firefox \
git \
libgl1-mesa-dev \
libglu1-mesa-dev \
libxcomposite-dev \
libxss1 \
locales \
pciutils \
subversion \
unzip \
wget
sudo locale-gen en_US.UTF-8
sudo update-locale
displayName: Install dependencies for Ubuntu
condition: eq('${{ parameters.distribution }}', 'ubuntu')
- script: |
echo $(System.CollectionId)
echo $(System.CollectionUri)
echo $(System.TeamProject)
echo $(System.TeamProjectId)
echo $(System.DefinitionID)
displayName: Show System variables
# download daily cached build directory for builds
# always do builds from scratch for "Update build cache" on Saturday night (Pacific)
# always do builds from scratch for "Weekly" pipeline
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.build_cache.projectID)'
pipeline: '$(resources.pipeline.build_cache.pipelineID)'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
artifact: '$(artifact_name)'
path: $(Pipeline.Workspace)
displayName: Download cached build
condition: >
and(or(and(eq(variables['Build.DefinitionName'], 'Update build cache'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'XFEL CI'),
eq(variables['Build.DefinitionName'], 'XFEL CI branch'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
- script: |
cd $(Pipeline.Workspace)
tar -xf build.tar
displayName: Extract build tarball
condition: >
and(or(and(eq(variables['Build.DefinitionName'], 'Update build cache'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'XFEL CI'),
eq(variables['Build.DefinitionName'], 'XFEL CI branch'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
failOnStderr: false
# build
- template: ${{ parameters.template }}
parameters:
distribution: ${{ parameters.distribution }}
version: ${{ parameters.version }}
# preserve permissions
- script: |
cd $(Pipeline.Workspace)
mkdir -p build
tar -chf build.tar build
displayName: Build tarball
condition: >
and(eq(variables['Build.DefinitionName'], 'Update build cache'),
or(eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')),
eq(variables['System.StageAttempt'], 1),
eq('${{ parameters.modules }}', 'modules'))
continueOnError: true
# cache build directory every week for regular optimization build
- publish: $(Pipeline.Workspace)/build.tar
artifact: $(artifact_name)
condition: >
and(eq(variables['Build.DefinitionName'], 'Update build cache'),
or(eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')),
eq(variables['System.StageAttempt'], 1),
eq('${{ parameters.modules }}', 'modules'))
continueOnError: true