-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconda-win-test.yml
242 lines (209 loc) · 9.03 KB
/
conda-win-test.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
# Script for building CCTBX
# Windows image description
# https://github.com/actions/virtual-environments/blob/master/images/win/Windows2016-Readme.md
# https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
#
# Template Parameters:
# builder: cctbx builder
#
# Parameters:
# vmImage: vs2017-win2016, windows-2019
# vs: vs2015, vs2017
# modules: <modules artifact name>
jobs:
- job: vs${{ parameters.vs }}
pool:
vmImage: ${{ parameters.vmImage }}
timeoutInMinutes: 360
strategy:
maxParallel: 2
matrix:
python3.9:
OS: win-64
PYTHON_VERSION: py39
MODULES: ${{ parameters.modules }}
variables:
artifact_name: vs${{ parameters.vs }}_$(PYTHON_VERSION)
day: $(Get-Date -Format dddd)
temp: "C:\\Miniconda3\\envs\\temp\\working"
steps:
- powershell: |
Write-Host $(day)
Write-Host "##vso[task.setVariable variable=day]$(day)"
displayName: Get day of week
- powershell: Write-Host $(day)
displayName: Check day of week
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
# download components
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.ci.projectID)'
pipeline: '$(resources.pipeline.ci.pipelineID)'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
artifact: '$(artifact_name)'
path: $(Pipeline.Workspace)
displayName: Download cached build
- script: |
cd $(Pipeline.Workspace)
tar -xf build.tar
del build.tar
displayName: Extract build tarball
continueOnError: true
failOnStderr: false
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
- powershell: |
cd $(Pipeline.Workspace)\build
gci -rec *.obj | rm
displayName: Delete obj files
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
# download public key
- task: DownloadSecureFile@1
name: private_key
inputs:
secureFile: 'file_key'
displayName: Download private key
- 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: |
echo on
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
del modules.enc
tar -xf modules.tar
del modules.tar
displayName: Extract modules tarball
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
# download test data
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.data_cache.projectID)'
pipeline: '$(resources.pipeline.data_cache.pipelineID)'
artifact: 'chem_data'
path: $(Pipeline.Workspace)/modules
displayName: Download chem_data
- script: |
cd $(Pipeline.Workspace)/modules
tar -xf chem_data.tar
del chem_data.tar
displayName: Extract chem_data tarball
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.data_cache.projectID)'
pipeline: '$(resources.pipeline.data_cache.pipelineID)'
artifact: 'phenix_regression'
path: $(Pipeline.Workspace)/modules
displayName: Download phenix_regression
- script: |
cd $(Pipeline.Workspace)/modules
tar -xf phenix_regression.tar
del phenix_regression.tar
displayName: Extract phenix_regression tarball
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.data_cache.projectID)'
pipeline: '$(resources.pipeline.data_cache.pipelineID)'
artifact: 'phenix_examples'
path: $(Pipeline.Workspace)/modules
displayName: Download phenix_examples
- script: |
cd $(Pipeline.Workspace)/modules
tar -xf phenix_examples.tar
del phenix_examples.tar
displayName: Extract phenix_examples tarball
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
- script: |
cd $(Pipeline.Workspace)
copy modules\cctbx_project\libtbx\auto_build\bootstrap.py .
displayName: Copy bootstrap.py
# create conda environment
# - script: |
# call %CONDA%\condabin\conda.bat config --set channel_priority flexible
# call %CONDA%\condabin\conda.bat install -y -n base conda=4.8
# displayName: Update conda
# - task: DownloadPipelineArtifact@2
# displayName: Download conda packages
# inputs:
# source: 'current'
# artifact: $(PYTHON_VERSION)_$(OS)
# path: $(Pipeline.Workspace)/channel
# - script: |
# call %CONDA%\condabin\conda.bat install -y conda-build
# cd $(Pipeline.Workspace)\channel
# more filenames.txt
# call %CONDA%\condabin\conda.bat index $(Pipeline.Workspace)\channel
# echo @EXPLICIT > env.txt
# for /f "tokens=*" %%f in (filenames.txt) do echo file:///$(Pipeline.Workspace)\channel\%%f >> env.txt
# more env.txt
# displayName: Build local channel
# call %CONDA%\condabin\conda.bat create -y --offline -n $(PYTHON_VERSION) --file $(Pipeline.Workspace)\channel\env.txt
- script: |
echo on
call %CONDA%\condabin\conda.bat create -y -n $(PYTHON_VERSION) --file $(Pipeline.Workspace)\modules\phenix\conda_envs\phenix_%PYTHON_VERSION%_%OS%.txt
call %CONDA%\condabin\conda.bat install -y -c conda-forge -c defaults --freeze-installed --no-deps -n $(PYTHON_VERSION) junit-xml
displayName: Create conda environment
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host
# test, libtbx.refresh is needed to build missing dispatchers
- script: |
echo on
cd $(Pipeline.Workspace)
call .\build\setpaths.bat
call libtbx.refresh
del /s /q .\modules\chem_data\rotarama_data\*.pickle
del /s /q .\modules\chem_data\rotarama_data\*.dlite
del /s /q .\modules\chem_data\cablam_data\*.pickle
del /s /q .\modules\chem_data\cablam_data\*.dlite
call mmtbx.rebuild_rotarama_cache
call mmtbx.rebuild_cablam_cache
mkdir tests
cd tests
call 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'
- powershell: |
Get-CimInstance -Class CIM_LogicalDisk | Select-Object @{Name="Size(GB)";Expression={$_.size/1gb}}, @{Name="Free Space(GB)";Expression={$_.freespace/1gb}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}}, DeviceID, DriveType | Where-Object DriveType -EQ '3'
displayName: Get disk information on host