-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
185 lines (182 loc) · 6.43 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
185 lines (182 loc) · 6.43 KB
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
variables:
CIBW_SKIP: pp* *_i686 *-win32 *musllinux* cp314t-*
CIBW_TEST_REQUIRES: --index-url https://pypi.ampl.com --extra-index-url https://pypi.org/simple amplpy ampl_module_base pandas
CIBW_ARCHS_WINDOWS: AMD64
AMPLPY_SWIG_THREADS: 1
CIBW_ENVIRONMENT_PASS_LINUX: AMPLKEY_UUID
CIBW_ARCHS_MACOS: x86_64 universal2
stages:
- stage: build
jobs:
- job: linux
pool: {vmImage: 'ubuntu-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
cplex:
solver: 'cplex'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
#CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux_2_28'
CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
#CIBW_TEST_COMMAND: python -m amplpy_copt.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
# - script: |
# sudo apt-get install swig
# displayName: Install SWIG
- template: support/templates/download-solver-libs.yml
- bash: |
python -m pip install setuptools
set -ex
mkdir -p tmp
TMP=`pwd`/tmp
cp support/twine.sh $WHEELHOUSE/twine.sh
cd python/$SOLVER
bash prepare.sh linux64
export AMPLPY_SWIG_THREADS=1
bash swig.sh
pip install --upgrade pip
pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==3.4.1
cibuildwheel --platform linux --output-dir $TMP .
ls -l $TMP
test "$(ls -A $TMP)" || exit 1
mv $TMP/* $WHEELHOUSE/
bash prepare.sh # to package libs for all platforms
python setup.py sdist -d $WHEELHOUSE
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- job: macos
pool: {vmImage: 'macOS-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
cplex:
solver: 'cplex'
CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
#CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_TEST_COMMAND: python -m amplpy_copt.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
- script: |
brew install swig
displayName: Install SWIG
- template: support/templates/download-solver-libs.yml
- bash: |
set -ex
mkdir -p tmp
TMP=`pwd`/tmp
cd python/$SOLVER
bash prepare.sh osx64
export AMPLPY_SWIG_THREADS=1
bash swig.sh
pip install --upgrade pip
pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==3.4.1
cibuildwheel --platform macos --output-dir $TMP .
ls -l $TMP
test "$(ls -A $TMP)" || exit 1
mv $TMP/* $WHEELHOUSE/
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
MACOSX_DEPLOYMENT_TARGET: '14.0'
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- job: windows
pool: {vmImage: 'windows-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
cplex:
solver: 'cplex'
CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_TEST_COMMAND: python -m amplpy_copt.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
- powershell: |
$version = "4.4.1"
$url = "https://downloads.sourceforge.net/project/swig/swigwin/swigwin-$version/swigwin-$version.zip"
$zip = "$(Agent.TempDirectory)\swig.zip"
$dest = "$(Agent.ToolsDirectory)\swig"
# curl -L follows mirror redirects; plain Invoke-WebRequest often saves an HTML page
curl.exe -fsSL -A "Azure-DevOps" -o $zip $url
if ((Get-Item $zip).Length -lt 1MB) { throw "SWIG download failed (got HTML or empty file)" }
Expand-Archive $zip -DestinationPath $dest -Force
$swigDir = "$dest\swigwin-$version"
Write-Host "##vso[task.prependpath]$swigDir"
& "$swigDir\swig.exe" -version
displayName: Upgrade SWIG to 4.4.1
- template: support/templates/download-solver-libs.yml
- bash: |
set -ex
mkdir -p tmp
cd python/$SOLVER
bash prepare.sh win64
export AMPLPY_SWIG_THREADS=1
bash swig.sh
python -m pip install --user --upgrade pip
python -m pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==3.4.1
cibuildwheel --platform windows --archs AMD64 --output-dir tmp .
cp tmp/* $WHEELHOUSE/
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- stage: publish
jobs:
- job: upload
pool: {vmImage: 'ubuntu-latest'}
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadPath: 'artifacts/ampls-api'
artifactName: 'drop'
displayName: 'Download current pipeline artifacts'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'artifacts/'
artifact: 'release'
artifactType: 'pipeline'