Skip to content

Commit 7b22624

Browse files
authored
Issue #1219 upgrade deploy pipeline (#1220)
Fixes #1219 # Description In this PR the Deploy pipeline and pixi pipeline have been updated to use the docker build images. Further more a docker image and docker version parameter have been created on root level, making it easy to update those # Checklist <!--- Before requesting review, please go through this checklist: --> - [x] Links to correct issue - [ ] Update changelog, if changes affect users - [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737`` - [ ] Unit tests were added - [ ] **If feature added**: Added/extended example
1 parent 0dceaa6 commit 7b22624

8 files changed

Lines changed: 77 additions & 17 deletions

File tree

.teamcity/Deploy/DeployProject.kt

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package Deploy
22

33
import jetbrains.buildServer.configs.kotlin.*
4+
import jetbrains.buildServer.configs.kotlin.buildFeatures.dockerSupport
5+
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
46
import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell
57
import jetbrains.buildServer.configs.kotlin.buildSteps.script
68
import jetbrains.buildServer.configs.kotlin.triggers.vcs
@@ -42,11 +44,19 @@ object BuildPackage : BuildType({
4244
pixi run --environment default --frozen python -m build
4345
""".trimIndent()
4446
formatStderrAsError = true
47+
dockerImage = "%DockerContainer%:%DockerVersion%"
48+
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
49+
dockerRunParameters = """--cpus=4 --memory=16g"""
50+
dockerPull = true
4551
}
4652
}
4753

48-
requirements {
49-
equals("env.OS", "Windows_NT")
54+
features {
55+
dockerSupport {
56+
loginToRegistry = on {
57+
dockerRegistryId = "PROJECT_EXT_134"
58+
}
59+
}
5060
}
5161
})
5262

@@ -72,11 +82,15 @@ object BuildPages : BuildType({
7282
name = "Build documentation"
7383
workingDir = "imod-python"
7484
scriptContent = """
75-
set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path%
85+
SET PATH=%%PATH%%;%system.teamcity.build.checkoutDir%\modflow6
7686
7787
pixi run --environment default --frozen docs
7888
""".trimIndent()
7989
formatStderrAsError = true
90+
dockerImage = "%DockerContainer%:%DockerVersion%"
91+
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
92+
dockerRunParameters = """--cpus=8 --memory=32g"""
93+
dockerPull = true
8094
}
8195
}
8296

@@ -105,8 +119,12 @@ object BuildPages : BuildType({
105119
}
106120
}
107121

108-
requirements {
109-
equals("env.OS", "Windows_NT")
122+
features {
123+
dockerSupport {
124+
loginToRegistry = on {
125+
dockerRegistryId = "PROJECT_EXT_134"
126+
}
127+
}
110128
}
111129
})
112130

@@ -147,15 +165,23 @@ object CreateGitHubRelease : BuildType({
147165
pixi run --environment default --frozen gh release create ${'$'}tag --verify-tag --notes "See https://deltares.github.io/imod-python/api/changelog.html"
148166
""".trimIndent()
149167
}
168+
param("plugin.docker.imagePlatform", "windows")
169+
param("plugin.docker.pull.enabled", "true")
170+
param("plugin.docker.imageId", "%DockerContainer%:%DockerVersion%")
171+
param("plugin.docker.run.parameters", "--cpus=4 --memory=16g")
150172
}
151173
}
152174

153175
failureConditions {
154176
errorMessage = true
155177
}
156178

157-
requirements {
158-
equals("env.OS", "Windows_NT")
179+
features {
180+
dockerSupport {
181+
loginToRegistry = on {
182+
dockerRegistryId = "PROJECT_EXT_134"
183+
}
184+
}
159185
}
160186
})
161187

@@ -188,6 +214,10 @@ object DeployPackage : BuildType({
188214
pixi run --frozen twine check ../dist/*
189215
pixi run --frozen twine upload ../dist/*
190216
""".trimIndent()
217+
dockerImage = "%DockerContainer%:%DockerVersion%"
218+
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
219+
dockerRunParameters = """--cpus=4 --memory=16g"""
220+
dockerPull = true
191221
}
192222
}
193223

@@ -203,8 +233,12 @@ object DeployPackage : BuildType({
203233
}
204234
}
205235

206-
requirements {
207-
equals("env.OS", "Windows_NT")
236+
features {
237+
dockerSupport {
238+
loginToRegistry = on {
239+
dockerRegistryId = "PROJECT_EXT_134"
240+
}
241+
}
208242
}
209243
})
210244

@@ -260,6 +294,10 @@ object DeployPages : BuildType({
260294
git push origin gh-pages
261295
""".trimIndent()
262296
formatStderrAsError = true
297+
dockerImage = "%DockerContainer%:%DockerVersion%"
298+
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
299+
dockerRunParameters = """--cpus=4 --memory=16g"""
300+
dockerPull = true
263301
}
264302
}
265303

@@ -276,8 +314,12 @@ object DeployPages : BuildType({
276314
}
277315
}
278316

279-
requirements {
280-
equals("env.OS", "Windows_NT")
317+
features {
318+
dockerSupport {
319+
loginToRegistry = on {
320+
dockerRegistryId = "PROJECT_EXT_134"
321+
}
322+
}
281323
}
282324
})
283325

.teamcity/Pixi/PixiProject.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package Pixi
33
import jetbrains.buildServer.configs.kotlin.AbsoluteId
44
import jetbrains.buildServer.configs.kotlin.BuildType
55
import jetbrains.buildServer.configs.kotlin.Project
6+
import jetbrains.buildServer.configs.kotlin.buildFeatures.dockerSupport
67
import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell
78
import jetbrains.buildServer.configs.kotlin.triggers.schedule
89

@@ -64,6 +65,10 @@ object UpdateDependencies : BuildType({
6465
""".trimIndent()
6566
}
6667
noProfile = false
68+
param("plugin.docker.imagePlatform", "windows")
69+
param("plugin.docker.pull.enabled", "true")
70+
param("plugin.docker.imageId", "%DockerContainer%:%DockerVersion%")
71+
param("plugin.docker.run.parameters", "--cpus=4 --memory=16g")
6772
}
6873
}
6974

@@ -81,4 +86,12 @@ object UpdateDependencies : BuildType({
8186
failureConditions {
8287
errorMessage = true
8388
}
89+
90+
features {
91+
dockerSupport {
92+
loginToRegistry = on {
93+
dockerRegistryId = "PROJECT_EXT_134"
94+
}
95+
}
96+
}
8497
})

.teamcity/Templates/ExamplesTemplate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object ExamplesTemplate : Template({
3131
pixi run --environment default --frozen examples
3232
""".trimIndent()
3333
formatStderrAsError = true
34-
dockerImage = "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1"
34+
dockerImage = "%DockerContainer%:%DockerVersion%"
3535
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
3636
dockerRunParameters = """--cpus=8 --memory=32g"""
3737
dockerPull = true

.teamcity/Templates/LintTemplate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object LintTemplate : Template({
2626
pixi run --environment default --frozen lint
2727
""".trimIndent()
2828
formatStderrAsError = true
29-
dockerImage = "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1"
29+
dockerImage = "%DockerContainer%:%DockerVersion%"
3030
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
3131
dockerRunParameters = """--cpus=4 --memory=16g"""
3232
dockerPull = true

.teamcity/Templates/MyPyTemplate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object MyPyTemplate : Template({
3131
pixi run --environment default --frozen mypy
3232
""".trimIndent()
3333
formatStderrAsError = true
34-
dockerImage = "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1"
34+
dockerImage = "%DockerContainer%:%DockerVersion%"
3535
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
3636
dockerRunParameters = """--cpus=4 --memory=16g"""
3737
dockerPull = true

.teamcity/Templates/PipPythonTemplate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object PipPythonTemplate : Template({
2727
pixi run --environment %python_env% --frozen test_import
2828
""".trimIndent()
2929
formatStderrAsError = true
30-
dockerImage = "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1"
30+
dockerImage = "%DockerContainer%:%DockerVersion%"
3131
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
3232
dockerRunParameters = """--cpus=4 --memory=16g"""
3333
dockerPull = true

.teamcity/Templates/UnitTestsTemplate.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object UnitTestsTemplate : Template({
3434
pixi run --environment default --frozen unittests
3535
""".trimIndent()
3636
formatStderrAsError = true
37-
dockerImage = "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1"
37+
dockerImage = "%DockerContainer%:%DockerVersion%"
3838
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Windows
3939
dockerRunParameters = """--cpus=8 --memory=32g"""
4040
dockerPull = true
@@ -58,7 +58,7 @@ object UnitTestsTemplate : Template({
5858
""".trimIndent()
5959
}
6060
param("plugin.docker.imagePlatform", "windows")
61-
param("plugin.docker.imageId", "containers.deltares.nl/hydrology_product_line_imod/windows-pixi:v0.26.1")
61+
param("plugin.docker.imageId", "%DockerContainer%:%DockerVersion%")
6262
param("plugin.docker.pull.enabled", "true")
6363
}
6464
}

.teamcity/_Self/MainProject.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import jetbrains.buildServer.configs.kotlin.projectFeatures.projectReportTab
1515
import jetbrains.buildServer.configs.kotlin.triggers.vcs
1616

1717
object MainProject : Project({
18+
params {
19+
param("DockerContainer", "containers.deltares.nl/hydrology_product_line_imod/windows-pixi")
20+
param("DockerVersion", "v0.26.1")
21+
}
22+
1823
buildType(Lint)
1924
buildType(MyPy)
2025
buildType(UnitTests)

0 commit comments

Comments
 (0)