From e52cf28fffd4f8ab56a9a21cddfb6b35a47619fe Mon Sep 17 00:00:00 2001 From: "Wilkins, Emily (Counterpointe Solutions)" <80470879+ewilkins-csi@users.noreply.github.com> Date: Fri, 1 Nov 2024 08:11:50 -0500 Subject: [PATCH] [#373] use .Chart.AppVersion for image tags in custom charts --- .github/workflows/build.yml | 30 +++++++++---------- .gitignore | 3 -- .../pom.xml | 4 --- .../{values.template.yaml => values.yaml} | 2 +- .../aissemble-fastapi-chart/.helmignore | 5 +--- .../aissemble-fastapi-chart/pom.xml | 4 --- .../aissemble-fastapi-chart/values-dev.yaml | 3 -- .../{values.template.yaml => values.yaml} | 2 +- .../aissemble-quarkus-chart/.helmignore | 5 +--- .../aissemble-quarkus-chart/Chart.yaml | 1 - .../aissemble-quarkus-chart/pom.xml | 4 --- .../{values.template.yaml => values.yaml} | 2 +- .../templates/deployment.yaml | 8 ++--- .../aissemble-spark-history-chart/values.yaml | 2 +- .../templates/deployment.yaml | 8 ++--- .../aissemble-thrift-server-chart/values.yaml | 2 +- 16 files changed, 30 insertions(+), 55 deletions(-) rename extensions/extensions-helm/aissemble-configuration-store-chart/{values.template.yaml => values.yaml} (98%) delete mode 100644 extensions/extensions-helm/aissemble-fastapi-chart/values-dev.yaml rename extensions/extensions-helm/aissemble-fastapi-chart/{values.template.yaml => values.yaml} (95%) rename extensions/extensions-helm/aissemble-quarkus-chart/{values.template.yaml => values.yaml} (98%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 933bf4738..11a0b65a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,6 +55,14 @@ jobs: docker-username: ${{ secrets.DOCKERHUB_USERNAME }} docker-token: ${{ secrets.DOCKERHUB_TOKEN }} #NB: We restore/save cache manually so that we save the cache even if the build fails + - name: Load docker build cache + id: cached-docker-build + uses: actions/cache/restore@v4 + with: + path: ~/.docker/cache + key: docker-cache-${{ hashFiles('**/Dockerfile') }} + restore-keys: | + docker-cache- - name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches id: cached-m2-repo uses: actions/cache/restore@v4 @@ -71,14 +79,6 @@ jobs: key: maven-build-cache-${{ hashFiles('**/pom.xml') }} restore-keys: | maven-build-cache- - - name: Load docker build cache - id: cached-docker-build - uses: actions/cache/restore@v4 - with: - path: ~/.docker/cache - key: docker-cache-${{ hashFiles('**/Dockerfile') }} - restore-keys: | - docker-cache- #NB: Not saving poetry cache on failure in case it's a failure caused by an in-flight python package release - name: Poetry cache id: cached-poetry @@ -105,6 +105,13 @@ jobs: - name: Run Archetype Tests run: | ./mvnw -B clean install -Parchetype-test -pl :foundation-archetype + - name: Save docker build cache + id: save-docker-build + uses: actions/cache/save@v4 + if: always() && steps.cached-docker-build.outputs.cache-hit != 'true' + with: + path: ~/.docker/cache + key: docker-cache-${{ hashFiles('**/Dockerfile') }} - name: Save m2 repository cache id: save-m2-repo uses: actions/cache/save@v4 @@ -119,10 +126,3 @@ jobs: with: path: ~/.m2/build-cache key: maven-build-cache-${{ hashFiles('**/pom.xml') }} - - name: Save docker build cache - id: save-docker-build - uses: actions/cache/save@v4 - if: always() && steps.cached-docker-build.outputs.cache-hit != 'true' - with: - path: ~/.docker/cache - key: docker-cache-${{ hashFiles('**/Dockerfile') }} diff --git a/.gitignore b/.gitignore index df90e3256..f0ec122ac 100644 --- a/.gitignore +++ b/.gitignore @@ -64,9 +64,6 @@ docs/antora-aissemble-ui/public/ **/charts/* Chart.lock extensions/extensions-helm/aissemble-spark-operator-chart/values.yaml -extensions/extensions-helm/aissemble-fastapi-chart/values.yaml -extensions/extensions-helm/aissemble-quarkus-chart/values.yaml -extensions/extensions-helm/aissemble-configuration-store-chart/values.yaml extensions/extensions-helm/aissemble-infrastructure-chart/values.yaml # The test project should test that we generate files that compile and have the expected structure for model options diff --git a/extensions/extensions-helm/aissemble-configuration-store-chart/pom.xml b/extensions/extensions-helm/aissemble-configuration-store-chart/pom.xml index 444ee7de3..306f66b6f 100644 --- a/extensions/extensions-helm/aissemble-configuration-store-chart/pom.xml +++ b/extensions/extensions-helm/aissemble-configuration-store-chart/pom.xml @@ -24,10 +24,6 @@ - - com.google.code.maven-replacer-plugin - replacer - ${group.helm.plugin} helm-maven-plugin diff --git a/extensions/extensions-helm/aissemble-configuration-store-chart/values.template.yaml b/extensions/extensions-helm/aissemble-configuration-store-chart/values.yaml similarity index 98% rename from extensions/extensions-helm/aissemble-configuration-store-chart/values.template.yaml rename to extensions/extensions-helm/aissemble-configuration-store-chart/values.yaml index 40f74b4b8..f00b24268 100644 --- a/extensions/extensions-helm/aissemble-configuration-store-chart/values.template.yaml +++ b/extensions/extensions-helm/aissemble-configuration-store-chart/values.yaml @@ -8,7 +8,7 @@ aissemble-quarkus-chart: repo: ghcr.io/ name: boozallen/aissemble-configuration-store imagePullPolicy: IfNotPresent - tag: "@version.aissemble@" + tag: "" hostname: configuration-store restartPolicy: Always diff --git a/extensions/extensions-helm/aissemble-fastapi-chart/.helmignore b/extensions/extensions-helm/aissemble-fastapi-chart/.helmignore index c229e9325..9e6a0fc34 100644 --- a/extensions/extensions-helm/aissemble-fastapi-chart/.helmignore +++ b/extensions/extensions-helm/aissemble-fastapi-chart/.helmignore @@ -1,5 +1,2 @@ target -pom.xml - -#helm ignore the base template and generate the values.yaml via POM plugin executions -values.template.yaml \ No newline at end of file +pom.xml \ No newline at end of file diff --git a/extensions/extensions-helm/aissemble-fastapi-chart/pom.xml b/extensions/extensions-helm/aissemble-fastapi-chart/pom.xml index f0ac69232..a217dbed2 100644 --- a/extensions/extensions-helm/aissemble-fastapi-chart/pom.xml +++ b/extensions/extensions-helm/aissemble-fastapi-chart/pom.xml @@ -15,10 +15,6 @@ - - com.google.code.maven-replacer-plugin - replacer - ${group.helm.plugin} helm-maven-plugin diff --git a/extensions/extensions-helm/aissemble-fastapi-chart/values-dev.yaml b/extensions/extensions-helm/aissemble-fastapi-chart/values-dev.yaml deleted file mode 100644 index b3a326b31..000000000 --- a/extensions/extensions-helm/aissemble-fastapi-chart/values-dev.yaml +++ /dev/null @@ -1,3 +0,0 @@ -image: - imagePullPolicy: IfNotPresent - dockerRepo: "" diff --git a/extensions/extensions-helm/aissemble-fastapi-chart/values.template.yaml b/extensions/extensions-helm/aissemble-fastapi-chart/values.yaml similarity index 95% rename from extensions/extensions-helm/aissemble-fastapi-chart/values.template.yaml rename to extensions/extensions-helm/aissemble-fastapi-chart/values.yaml index daafc6370..f6730baed 100644 --- a/extensions/extensions-helm/aissemble-fastapi-chart/values.template.yaml +++ b/extensions/extensions-helm/aissemble-fastapi-chart/values.yaml @@ -10,7 +10,7 @@ replicaCount: 1 hostname: fastapi image: name: boozallen/aissemble-fastapi - tag: "@version.aissemble@" + tag: "" imagePullPolicy: Always dockerRepo: ghcr.io/ diff --git a/extensions/extensions-helm/aissemble-quarkus-chart/.helmignore b/extensions/extensions-helm/aissemble-quarkus-chart/.helmignore index c229e9325..9e6a0fc34 100644 --- a/extensions/extensions-helm/aissemble-quarkus-chart/.helmignore +++ b/extensions/extensions-helm/aissemble-quarkus-chart/.helmignore @@ -1,5 +1,2 @@ target -pom.xml - -#helm ignore the base template and generate the values.yaml via POM plugin executions -values.template.yaml \ No newline at end of file +pom.xml \ No newline at end of file diff --git a/extensions/extensions-helm/aissemble-quarkus-chart/Chart.yaml b/extensions/extensions-helm/aissemble-quarkus-chart/Chart.yaml index eda29c767..623629724 100644 --- a/extensions/extensions-helm/aissemble-quarkus-chart/Chart.yaml +++ b/extensions/extensions-helm/aissemble-quarkus-chart/Chart.yaml @@ -1,4 +1,3 @@ ---- name: aissemble-quarkus-chart # Version is automatically set by the plugin so this is only a placeholder version: 1.0.0 diff --git a/extensions/extensions-helm/aissemble-quarkus-chart/pom.xml b/extensions/extensions-helm/aissemble-quarkus-chart/pom.xml index bdf816465..d9fac7c2f 100644 --- a/extensions/extensions-helm/aissemble-quarkus-chart/pom.xml +++ b/extensions/extensions-helm/aissemble-quarkus-chart/pom.xml @@ -15,10 +15,6 @@ - - com.google.code.maven-replacer-plugin - replacer - ${group.helm.plugin} helm-maven-plugin diff --git a/extensions/extensions-helm/aissemble-quarkus-chart/values.template.yaml b/extensions/extensions-helm/aissemble-quarkus-chart/values.yaml similarity index 98% rename from extensions/extensions-helm/aissemble-quarkus-chart/values.template.yaml rename to extensions/extensions-helm/aissemble-quarkus-chart/values.yaml index 1ef422e9c..a12fa5c64 100644 --- a/extensions/extensions-helm/aissemble-quarkus-chart/values.template.yaml +++ b/extensions/extensions-helm/aissemble-quarkus-chart/values.yaml @@ -10,7 +10,7 @@ deployment: # Override with specific image name: boozallen/aissemble-quarkus # Overrides the default chart AppVersion value - tag: "@version.aissemble@" + tag: "" # Default IfNotPresent imagePullPolicy: '' volumeMounts: diff --git a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/templates/deployment.yaml b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/templates/deployment.yaml index a7df63405..1ca0276b0 100644 --- a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/templates/deployment.yaml +++ b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/templates/deployment.yaml @@ -42,7 +42,7 @@ spec: {{- if or (not (empty .Values.dependencies.packages)) (not (empty .Values.dependencies.jars)) }} initContainers: - name: "populate-jar-volume" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} command: ["sh", "-c", "cp /opt/spark/jars/* /tmp/jars/"] volumeMounts: @@ -50,7 +50,7 @@ spec: name: shs-jars {{- if not (empty .Values.dependencies.packages) }} - name: "install-spark-history-packages" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} # Uses the Ivy jar packaged with spark to download dependency packages (and their transitive dependencies) to /tmp/jars/... # Specifically downloads the binaries-- Does not download supplemental classifiers, ie sources @@ -61,7 +61,7 @@ spec: {{- end }} {{- if not (empty .Values.dependencies.jars) }} - name: "install-spark-history-jars" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} command: ["wget", "-P", "/tmp/jars/", {{ include "deps.jars" . }}] volumeMounts: @@ -71,7 +71,7 @@ spec: {{- end }} containers: - name: {{ .Release.Name }} - image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }} command: {{ .Values.deployment.command }} env: diff --git a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/values.yaml b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/values.yaml index 7aa3fac41..61dfca1dc 100644 --- a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/values.yaml +++ b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-spark-history-chart/values.yaml @@ -12,7 +12,7 @@ deployment: image: repository: "ghcr.io/boozallen/aissemble-spark" imagePullPolicy: IfNotPresent - tag: "1.10.0-SNAPSHOT" + tag: "" command: ["/opt/spark/sbin/start-history-server.sh"] env: SPARK_NO_DAEMONIZE: "true" diff --git a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/templates/deployment.yaml b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/templates/deployment.yaml index d3ba1614f..cd2779805 100644 --- a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/templates/deployment.yaml +++ b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: {{- if or (not (empty .Values.dependencies.packages)) (not (empty .Values.dependencies.jars)) }} initContainers: - name: "populate-thrift-service-jar-volume" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} command: ["sh", "-c", "cp /opt/spark/jars/* /tmp/jars/"] volumeMounts: @@ -46,7 +46,7 @@ spec: name: sts-jars {{- if not (empty .Values.dependencies.packages) }} - name: "install-thrift-packages" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} # Uses the Ivy jar packaged with spark to download dependency packages (and their transitive dependencies) to /tmp/jars/... # Specifically downloads the binaries-- Does not download supplemental classifiers, ie sources @@ -57,7 +57,7 @@ spec: {{- end }} {{- if not (empty .Values.dependencies.jars) }} - name: "install-thrift-jars" - image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }} + image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion}} imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy | default "IfNotPresent" }} command: ["wget", "-P", "/tmp/jars/", {{ include "deps.jars" . }}] volumeMounts: @@ -67,7 +67,7 @@ spec: {{- end }} containers: - name: {{ .Release.Name }} - image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }} command: {{ .Values.deployment.command }} lifecycle: diff --git a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/values.yaml b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/values.yaml index 9348b5674..7ff87bad8 100644 --- a/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/values.yaml +++ b/extensions/extensions-helm/extensions-helm-spark-infrastructure/aissemble-thrift-server-chart/values.yaml @@ -13,7 +13,7 @@ deployment: image: repository: "ghcr.io/boozallen/aissemble-spark" imagePullPolicy: IfNotPresent - tag: "1.10.0-SNAPSHOT" + tag: "" command: ["/opt/spark/sbin/start-thriftserver.sh"] env: SPARK_NO_DAEMONIZE: "true"