-
Notifications
You must be signed in to change notification settings - Fork 0
/
unix-conda-build.yml
199 lines (178 loc) · 6.03 KB
/
unix-conda-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
# Script for building CCTBX on linux and macOS
#
# Variables:
# CONDA: Linux, MacOSX
# OS: linux-64, osx-64
# PYTHON_VERSION: py27, py36, py37, py38
# MODULES: <modules artifact name>
#
# Optional Parameters:
# distribution: centos, ubuntu
# version: [6, 10]
# builder: cctbx builder
steps:
# download components
- checkout: none
# download public key
- task: DownloadSecureFile@1
name: private_key
inputs:
secureFile: 'file_key'
displayName: Download private key
# install miniforge
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.cctbx_data_cache.projectID)'
pipeline: '$(resources.pipeline.cctbx_data_cache.pipelineID)'
artifact: 'miniforge'
path: $(Pipeline.Workspace)/miniforge
displayName: Download miniforge
- script: |
set -xe
bash $(Pipeline.Workspace)/miniforge/Miniforge3-$(CONDA)-x86_64.sh -b -u -p $(Pipeline.Workspace)/miniforge
displayName: Install miniforge
- script: |
set -xe
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda update -y -n base conda
conda update -y -n base --all
conda info
displayName: Update conda
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.data_cache.projectID)'
pipeline: '$(resources.pipeline.data_cache.pipelineID)'
artifact: $(MODULES)
path: $(Pipeline.Workspace)
displayName: Download modules tarball
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.data_cache.projectID)'
pipeline: '$(resources.pipeline.data_cache.pipelineID)'
artifact: password
path: $(Pipeline.Workspace)
displayName: Download password
- script: |
set -xe
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda create -y -n openssl openssl=1.1
conda activate openssl
cd $(Pipeline.Workspace)
openssl rsautl -decrypt -inkey $(private_key.secureFilePath) -in password.enc -out password
openssl enc -d \
-aes-256-cbc \
-md sha256 \
-iter 100000 \
-pbkdf2 \
-in modules.enc \
-out modules.tar \
-pass file:./password
rm modules.enc
tar -xf modules.tar
rm modules.tar
displayName: Extract modules tarball
- script: |
set -xe
cd $(Pipeline.Workspace)/modules
SCONS_URL="https://github.com/SCons/scons/archive/3.1.1.zip"
if [[ "$OSTYPE" == "darwin"* ]]; then
curl -fsSL ${SCONS_URL} > 3.1.1.zip
else
wget ${SCONS_URL}
fi
unzip 3.1.1.zip
mv scons-3.1.1 scons
displayName: Download SCons for Python 2
condition: eq(variables['PYTHON_VERSION'], 'py27')
- script: |
set -xe
cd $(Pipeline.Workspace)/modules
rm -fr dxtbx
git clone -b dials-2.2 https://github.com/dials/dxtbx.git
displayName: Download dials-2.2 version of dxtbx for Python 2
condition: eq(variables['PYTHON_VERSION'], 'py27')
- script: |
set -xe
cd $(Pipeline.Workspace)
ln -s modules/cctbx_project/libtbx/auto_build/bootstrap.py
displayName: Link bootstrap.py
# create conda environment
# fresh downloads for "Update build cache" and "Full" pipelines
- task: DownloadPipelineArtifact@2
inputs:
source: 'current'
artifact: $(PYTHON_VERSION)_$(OS)
path: $(Pipeline.Workspace)/channel
displayName: Download conda packages
condition: >
or(eq(variables['Build.DefinitionName'], 'Update build cache'),
eq(variables['Build.DefinitionName'], 'Full'))
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.build_cache.projectID)'
pipeline: '$(resources.pipeline.build_cache.pipelineID)'
allowPartiallySucceededBuilds: true
artifact: $(PYTHON_VERSION)_$(OS)
path: $(Pipeline.Workspace)/channel
displayName: Download cached conda packages
condition: >
and(ne(variables['Build.DefinitionName'], 'Update build cache'),
ne(variables['Build.DefinitionName'], 'Full'))
- script: |
set -xe
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda install -y conda-build
cd $(Pipeline.Workspace)/channel
conda index .
echo @EXPLICIT > env.txt
for filename in `cat filenames.txt`; do
echo file://$(Pipeline.Workspace)/channel/${filename} >> env.txt
done
displayName: Build local channel
- script: |
set -xe
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda config --set channel_priority flexible
conda create -y --offline -n $(PYTHON_VERSION) --file $(Pipeline.Workspace)/channel/env.txt
displayName: Create conda environment
# - script: |
# set -xe
# source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
# conda remove -y --force -n $(PYTHON_VERSION) llvm-openmp
# condition: eq('${{ parameters.version[0] }}', 6)
# displayName: Remove OpenMP headers from conda environment
# - script: |
# source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
# conda remove -y --force -n $(PYTHON_VERSION) boost boost-cpp
# conda install -y --no-deps -c cctbx-old-abi -n $(PYTHON_VERSION) boost boost-cpp
# displayName: Use Boost from cctbx-old-abi channel
# condition: or(eq('${{ parameters.version[0] }}', 6), eq('${{ parameters.version[0] }}', 7), eq('${{ parameters.version[0] }}', 14))
# build
- script: |
set -xe
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda activate $(PYTHON_VERSION)
cd $(Pipeline.Workspace)
python bootstrap.py build --builder=${{ parameters.builder }} --use-conda=${CONDA_PREFIX} --nproc=4
displayName: Configure and Build
# test
# - script: |
# set -xe
# source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
# conda activate $(PYTHON_VERSION)
# cd $(Pipeline.Workspace)
# source ./build/setpaths.sh
# mkdir tests
# cd tests
# phenix_regression.test_all_parallel nproc=4
# failOnStderr: false
# displayName: Test
# - task: PublishTestResults@2
# condition: succeededOrFailed()
# inputs:
# testResultsFormat: 'JUnit'
# testResultsFiles: '$(Pipeline.Workspace)/tests/output.xml'