-
Notifications
You must be signed in to change notification settings - Fork 0
/
conda-linux.yml
206 lines (184 loc) · 7.12 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
# Script for building CCTBX
# linux image descriptions
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
#
# Template Parameters:
# pipeline: pipeline name
#
# Parameters:
# distribution: centos, ubuntu
# version: [6, 10]
# modules: <modules artifact name>
# builder: <cctbx builder>
jobs:
- job: ${{ format('{0}_{1}', parameters.distribution, join('_', parameters.version) ) }}
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 360
strategy:
maxParallel: 2
matrix:
python2.7:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py27
MODULES: ${{ parameters.modules }}
python3.7:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py37
MODULES: ${{ parameters.modules }}
python3.8:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py38
MODULES: ${{ parameters.modules }}
python3.9:
CONDA: Linux
OS: linux-64
PYTHON_VERSION: py39
MODULES: ${{ parameters.modules }}
container:
image: ${{ parameters.distribution }}:${{ join('.', parameters.version) }}
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
variables:
artifact_name: ${{ parameters.distribution }}_${{ join('.', parameters.version) }}_$(PYTHON_VERSION)
day: Sunday
steps:
- script: |
day=`date +%A`
echo $(day)
echo "##vso[task.setVariable variable=day]$day"
displayName: Get day of week
- script: echo $(day)
displayName: Check day of week
# https://github.com/ApexAI/performance_test/blob/master/azure-pipelines.yml#L9-L17
# centos setup
- script: |
set -xe
/tmp/docker exec -t -u 0 ci-container \
sh -c "sed -i 's/mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-Base.repo"
/tmp/docker exec -t -u 0 ci-container \
sh -c "sed -i 's/#baseurl=http:\/\/mirror/baseurl=http:\/\/vault/g' /etc/yum.repos.d/CentOS-Base.repo"
cat /etc/yum.repos.d/CentOS-Base.repo
displayName: Modify yum repositories for CentOS 6
condition: eq('${{ parameters.version[0] }}', 6)
- 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: |
set -xe
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y mesa-libGLU-devel mesa-libGL-devel openssl tcsh wget
locale -a
displayName: Install dependencies for CentOS
condition: or(eq('${{ parameters.distribution }}', 'centos'),
eq('${{ parameters.distribution }}', 'rockylinux'))
- script: |
sudo yum install -y python-argparse
displayName: Install argparse for CentOS 6
condition: eq('${{ parameters.version[0] }}', 6)
- script: |
echo "##vso[task.setvariable variable=LC_ALL]en_US.utf8"
displayName: Setup locale for CentOS
condition: or(eq('${{ parameters.distribution }}', 'centos'),
eq('${{ parameters.distribution }}', 'rockylinux'))
- script: |
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: |
sudo apt-get install -y build-essential curl git libgl1-mesa-dev libglu1-mesa-dev locales subversion tcsh unzip wget
sudo locale-gen en_US.UTF-8
sudo update-locale
displayName: Install dependencies for Ubuntu
condition: eq('${{ parameters.distribution }}', 'ubuntu')
- script: |
echo "##vso[task.setvariable variable=LC_ALL]en_US.utf8"
displayName: Setup locale 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 (starting with cctbx build) on Saturday night (Pacific)
# always do builds from scratch for "Weekly" pipeline
# - task: DownloadPipelineArtifact@2
# inputs:
# source: 'specific'
# project: '$(resources.pipeline.cctbx_build_cache.projectID)'
# pipeline: '$(resources.pipeline.cctbx_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'),
# eq(variables['day'], 'Sunday')),
# eq(variables['Build.DefinitionName'], 'CI'),
# eq(variables['Build.DefinitionName'], 'CI test'),
# eq(variables['Build.DefinitionName'], 'Full')),
# ne(variables['SKIP_CACHED_BUILD'], 'true'))
# continueOnError: true
- 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 test'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
- script: |
cd $(Pipeline.Workspace)
tar -xf build.tar
rm build.tar
displayName: Extract build tarball
condition: >
and(or(and(eq(variables['Build.DefinitionName'], 'Update build cache'),
eq(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI test'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
failOnStderr: false
# build
- template: ./unix-conda-build.yml
parameters:
distribution: ${{ parameters.distribution }}
version: ${{ parameters.version }}
builder: ${{ parameters.builder }}
# preserve permissions
- script: |
cd $(Pipeline.Workspace)
tar -chzf build.tar build
displayName: Build tarball
continueOnError: true
# cache build directory every week for regular optimization build
- publish: $(Pipeline.Workspace)/build.tar
artifact: $(artifact_name)
continueOnError: true