From c552d731be6cfe235cdd6cac173b24f0a02448af Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 26 Sep 2023 18:46:52 +0700 Subject: [PATCH] Updated to use templating-maven-plugin --- .gitignore | 3 +- README.md | 2 + component-pvc/pom.xml | 6 +- .../{Chart_template.yaml => Chart.yaml} | 4 +- component-scaler/pom.xml | 6 +- .../{Chart_template.yaml => Chart.yaml} | 4 +- grid-autoscaling/pom.xml | 6 +- .../resources/grid-autoscaling/Chart.yaml | 22 ++++++++ .../grid-autoscaling/Chart_template.yaml | 22 -------- grid-pvc/pom.xml | 6 +- .../{Chart_template.yaml => Chart.yaml} | 28 +++++----- patch-selenium-grid/pom.xml | 18 +++--- .../resources/patch-selenium-grid/Chart.yaml | 12 ++++ .../patch-selenium-grid/Chart_template.yaml | 12 ---- pom.xml | 55 +++++++++---------- scalable-selenium-grid/pom.xml | 7 ++- .../{Chart_template.yaml => Chart.yaml} | 36 ++++++------ 17 files changed, 126 insertions(+), 123 deletions(-) rename component-pvc/src/main/resources/component-pvc/{Chart_template.yaml => Chart.yaml} (66%) rename component-scaler/src/main/resources/component-scaler/{Chart_template.yaml => Chart.yaml} (59%) create mode 100644 grid-autoscaling/src/main/resources/grid-autoscaling/Chart.yaml delete mode 100644 grid-autoscaling/src/main/resources/grid-autoscaling/Chart_template.yaml rename grid-pvc/src/main/resources/grid-pvc/{Chart_template.yaml => Chart.yaml} (56%) create mode 100644 patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart.yaml delete mode 100644 patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart_template.yaml rename scalable-selenium-grid/src/main/resources/scalable-selenium-grid/{Chart_template.yaml => Chart.yaml} (53%) diff --git a/.gitignore b/.gitignore index d99586f..17e32b7 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,4 @@ build/ ### Helm ### **/*.tgz **/*.lock -**/patch-selenium-grid/charts -**/Chart.yaml \ No newline at end of file +**/patch-selenium-grid/charts \ No newline at end of file diff --git a/README.md b/README.md index 510d400..204af73 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ This umbrella chart is created to deploy my motivation for a Scalable Selenium Grid, details as below +Fortunately, [Selenium-Grid Helm Chart](charts/selenium-grid/README.md) added autoscaling in default values.yaml from version [0.19.0](https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/CHANGELOG.md#heavy_check_mark-0190) + ![Scalable Grid](docs/central_grid_diagram.png) More details on my motivation are mentioned in the presentation [here](docs/Topic_Scalable-Parallel-AT_Publish.pdf). diff --git a/component-pvc/pom.xml b/component-pvc/pom.xml index b971724..59ec1dd 100644 --- a/component-pvc/pom.xml +++ b/component-pvc/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} component-pvc @@ -14,7 +14,8 @@ - maven-antrun-plugin + org.codehaus.mojo + templating-maven-plugin io.kokuwa.maven @@ -32,7 +33,6 @@ - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true diff --git a/component-pvc/src/main/resources/component-pvc/Chart_template.yaml b/component-pvc/src/main/resources/component-pvc/Chart.yaml similarity index 66% rename from component-pvc/src/main/resources/component-pvc/Chart_template.yaml rename to component-pvc/src/main/resources/component-pvc/Chart.yaml index 97627d8..e7c977a 100644 --- a/component-pvc/src/main/resources/component-pvc/Chart_template.yaml +++ b/component-pvc/src/main/resources/component-pvc/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: component-pvc description: A Helm individual chart to create PV and PVC for a component in Grid type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" +version: ${chart.this.version} +appVersion: "${chart.this.version}" diff --git a/component-scaler/pom.xml b/component-scaler/pom.xml index c718325..bb835c5 100644 --- a/component-scaler/pom.xml +++ b/component-scaler/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} component-scaler @@ -14,7 +14,8 @@ - maven-antrun-plugin + org.codehaus.mojo + templating-maven-plugin io.kokuwa.maven @@ -32,7 +33,6 @@ - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true diff --git a/component-scaler/src/main/resources/component-scaler/Chart_template.yaml b/component-scaler/src/main/resources/component-scaler/Chart.yaml similarity index 59% rename from component-scaler/src/main/resources/component-scaler/Chart_template.yaml rename to component-scaler/src/main/resources/component-scaler/Chart.yaml index f5ae190..4a9970f 100644 --- a/component-scaler/src/main/resources/component-scaler/Chart_template.yaml +++ b/component-scaler/src/main/resources/component-scaler/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: component-scaler description: A Helm chart for Kubernetes type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" +version: ${chart.this.version} +appVersion: "${chart.this.version}" diff --git a/grid-autoscaling/pom.xml b/grid-autoscaling/pom.xml index 15d4f26..a2f7bae 100644 --- a/grid-autoscaling/pom.xml +++ b/grid-autoscaling/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} grid-autoscaling @@ -14,7 +14,8 @@ - maven-antrun-plugin + org.codehaus.mojo + templating-maven-plugin io.kokuwa.maven @@ -32,7 +33,6 @@ - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true diff --git a/grid-autoscaling/src/main/resources/grid-autoscaling/Chart.yaml b/grid-autoscaling/src/main/resources/grid-autoscaling/Chart.yaml new file mode 100644 index 0000000..51c4583 --- /dev/null +++ b/grid-autoscaling/src/main/resources/grid-autoscaling/Chart.yaml @@ -0,0 +1,22 @@ +apiVersion: v2 +name: grid-autoscaling +description: A Helm chart for Kubernetes +type: application +version: ${chart.this.version} +appVersion: "${chart.this.version}" +dependencies: + - alias: scale-chrome-node + condition: scale-chrome-node.enabled + name: component-scaler + repository: file://../../../../component-scaler/target/classes/component-scaler + version: ${chart.this.version} + - alias: scale-firefox-node + condition: scale-firefox-node.enabled + name: component-scaler + repository: file://../../../../component-scaler/target/classes/component-scaler + version: ${chart.this.version} + - alias: scale-edge-node + condition: scale-edge-node.enabled + name: component-scaler + repository: file://../../../../component-scaler/target/classes/component-scaler + version: ${chart.this.version} diff --git a/grid-autoscaling/src/main/resources/grid-autoscaling/Chart_template.yaml b/grid-autoscaling/src/main/resources/grid-autoscaling/Chart_template.yaml deleted file mode 100644 index cdb9fab..0000000 --- a/grid-autoscaling/src/main/resources/grid-autoscaling/Chart_template.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v2 -name: grid-autoscaling -description: A Helm chart for Kubernetes -type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" -dependencies: - - alias: scale-chrome-node - condition: scale-chrome-node.enabled - name: component-scaler - repository: file://../../../../../component-scaler/src/main/resources/component-scaler - version: @chart.this.version@ - - alias: scale-firefox-node - condition: scale-firefox-node.enabled - name: component-scaler - repository: file://../../../../../component-scaler/src/main/resources/component-scaler - version: @chart.this.version@ - - alias: scale-edge-node - condition: scale-edge-node.enabled - name: component-scaler - repository: file://../../../../../component-scaler/src/main/resources/component-scaler - version: @chart.this.version@ diff --git a/grid-pvc/pom.xml b/grid-pvc/pom.xml index b765b36..017e3d8 100644 --- a/grid-pvc/pom.xml +++ b/grid-pvc/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} grid-pvc @@ -14,7 +14,8 @@ - maven-antrun-plugin + org.codehaus.mojo + templating-maven-plugin io.kokuwa.maven @@ -32,7 +33,6 @@ - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true diff --git a/grid-pvc/src/main/resources/grid-pvc/Chart_template.yaml b/grid-pvc/src/main/resources/grid-pvc/Chart.yaml similarity index 56% rename from grid-pvc/src/main/resources/grid-pvc/Chart_template.yaml rename to grid-pvc/src/main/resources/grid-pvc/Chart.yaml index 3eedb5d..02b28ad 100644 --- a/grid-pvc/src/main/resources/grid-pvc/Chart_template.yaml +++ b/grid-pvc/src/main/resources/grid-pvc/Chart.yaml @@ -2,36 +2,36 @@ apiVersion: v2 name: grid-pvc description: A Helm chart for Kubernetes type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" +version: ${chart.this.version} +appVersion: "${chart.this.version}" dependencies: - alias: selenium-chrome-node condition: global.seleniumGrid.persistence.enabled,selenium-chrome-node.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} - alias: selenium-chrome-video condition: global.seleniumGrid.persistence.enabled,selenium-chrome-video.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} - alias: selenium-firefox-node condition: global.seleniumGrid.persistence.enabled,selenium-firefox-node.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} - alias: selenium-firefox-video condition: global.seleniumGrid.persistence.enabled,selenium-firefox-video.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} - alias: selenium-edge-node condition: global.seleniumGrid.persistence.enabled,selenium-edge-node.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} - alias: selenium-edge-video condition: global.seleniumGrid.persistence.enabled,selenium-edge-video.persistence.enabled name: component-pvc - repository: file://../../../../../component-pvc/src/main/resources/component-pvc - version: @chart.this.version@ \ No newline at end of file + repository: file://../../../../component-pvc/target/classes/component-pvc + version: ${chart.this.version} \ No newline at end of file diff --git a/patch-selenium-grid/pom.xml b/patch-selenium-grid/pom.xml index aef183f..57d3809 100644 --- a/patch-selenium-grid/pom.xml +++ b/patch-selenium-grid/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} patch-selenium-grid @@ -18,6 +18,11 @@ + + org.codehaus.mojo + templating-maven-plugin + + maven-antrun-plugin @@ -45,8 +50,8 @@ - + dest="${project.basedir}/target/classes/patch-selenium-grid/charts"> + @@ -61,7 +66,7 @@ - + @@ -83,10 +88,10 @@ dependency-build - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true + true @@ -97,9 +102,6 @@ package - - ${project.basedir}/src/main/resources/patch-selenium-grid/charts/selenium-grid - ${chart.selenium.version} ${project.parent.build.directory}/helm/repo true diff --git a/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart.yaml b/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart.yaml new file mode 100644 index 0000000..6336f59 --- /dev/null +++ b/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: patch-selenium-grid +description: A Helm chart for Kubernetes +type: application +version: ${chart.this.version} +appVersion: "${chart.this.version}" +dependencies: + - name: ${chart.selenium.name} + repository: ${chart.selenium.repository} + version: ${chart.selenium.version} + tags: + - selenium-grid \ No newline at end of file diff --git a/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart_template.yaml b/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart_template.yaml deleted file mode 100644 index ba49271..0000000 --- a/patch-selenium-grid/src/main/resources/patch-selenium-grid/Chart_template.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v2 -name: patch-selenium-grid -description: A Helm chart for Kubernetes -type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" -dependencies: - - name: @chart.selenium.name@ - repository: @chart.selenium.repository@ - version: @chart.selenium.version@ - tags: - - selenium-grid \ No newline at end of file diff --git a/pom.xml b/pom.xml index d2f910f..6d982bd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} pom patch-selenium-grid @@ -18,6 +18,7 @@ + 23.9.26 bash -c ${project.version} @@ -57,39 +58,29 @@ - maven-antrun-plugin - 3.1.0 + org.codehaus.mojo + templating-maven-plugin + 1.0.0 + true - generate-chart-yaml - validate - - - - - - - - - - - - - - - - - - - - - + chart-src-template + initialize - run + filter-sources + + ${basedir}/src/main/resources + ${project.build.directory}/classes + + + + + maven-antrun-plugin + 3.1.0 + clean-chart-lock clean @@ -99,7 +90,6 @@ dir="src/main/resources/${project.name}/charts"/> - @@ -114,6 +104,13 @@ io.kokuwa.maven helm-maven-plugin 6.6.1 + true + + ${project.build.directory}/classes + ${project.version} + true + true + diff --git a/scalable-selenium-grid/pom.xml b/scalable-selenium-grid/pom.xml index 716d0c1..f4019ed 100644 --- a/scalable-selenium-grid/pom.xml +++ b/scalable-selenium-grid/pom.xml @@ -6,13 +6,17 @@ org.ndviet test-scaling-grid - 23.5.0 + ${revision} scalable-selenium-grid + + org.codehaus.mojo + templating-maven-plugin + maven-antrun-plugin @@ -58,7 +62,6 @@ - ${project.basedir}/src/main/resources ${project.version} ${project.parent.build.directory}/helm/repo true diff --git a/scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart_template.yaml b/scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart.yaml similarity index 53% rename from scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart_template.yaml rename to scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart.yaml index 6a0fed7..901926e 100644 --- a/scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart_template.yaml +++ b/scalable-selenium-grid/src/main/resources/scalable-selenium-grid/Chart.yaml @@ -2,50 +2,50 @@ apiVersion: v2 name: scalable-selenium-grid description: A Helm chart for Kubernetes type: application -version: @chart.this.version@ -appVersion: "@chart.this.version@" +version: ${chart.this.version} +appVersion: "${chart.this.version}" dependencies: - condition: global.selenium-grid.enabled, selenium-grid.enabled - name: @chart.selenium.name@ - repository: file://../../../../../patch-selenium-grid/src/main/resources/patch-selenium-grid/charts/selenium-grid - version: @chart.selenium.version@ + name: ${chart.selenium.name} + repository: file://../../../../patch-selenium-grid/target/classes/patch-selenium-grid/charts/selenium-grid + version: ${chart.selenium.version} tags: - full - selenium-grid - condition: global.seleniumGrid.autoscaling.enabled, global.seleniumGrid.autoscaling.useKEDA, keda.enabled - name: @chart.keda.name@ - repository: @chart.keda.repository@ - version: @chart.keda.version@ + name: ${chart.keda.name} + repository: ${chart.keda.repository} + version: ${chart.keda.version} tags: - full - keda - grid-autoscaling - condition: global.seleniumGrid.autoscaling.enabled, grid-autoscaling.enabled name: grid-autoscaling - repository: file://../../../../../grid-autoscaling/src/main/resources/grid-autoscaling - version: @chart.this.version@ + repository: file://../../../../grid-autoscaling/target/classes/grid-autoscaling + version: ${chart.this.version} tags: - full - keda - grid-autoscaling - condition: global.seleniumGrid.persistence.enabled, grid-pvc.enabled name: grid-pvc - repository: file://../../../../../grid-pvc/src/main/resources/grid-pvc - version: @chart.this.version@ + repository: file://../../../../grid-pvc/target/classes/grid-pvc + version: ${chart.this.version} tags: - full - grid-pvc - condition: global.jaeger-all-in-one.enabled, jaeger-all-in-one.enabled - name: @chart.jaeger.name@ - repository: @chart.jaeger.repository@ - version: @chart.jaeger.version@ + name: ${chart.jaeger.name} + repository: ${chart.jaeger.repository} + version: ${chart.jaeger.version} tags: - full - jaeger-all-in-one - condition: global.ingress-nginx.enabled, ingress-nginx.enabled - name: @chart.ingress.name@ - repository: @chart.ingress.repository@ - version: @chart.ingress.version@ + name: ${chart.ingress.name} + repository: ${chart.ingress.repository} + version: ${chart.ingress.version} tags: - full - ingress-nginx \ No newline at end of file