Skip to content

Commit

Permalink
Merge pull request #455 from boozallen/373-fix-hard-coded-version
Browse files Browse the repository at this point in the history
[#373] use .Chart.AppVersion for image tags in custom charts
  • Loading branch information
ewilkins-csi authored Nov 5, 2024
2 parents 0a35812 + e52cf28 commit 4f8df35
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 55 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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') }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
</plugin>
<plugin>
<groupId>${group.helm.plugin}</groupId>
<artifactId>helm-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
target
pom.xml

#helm ignore the base template and generate the values.yaml via POM plugin executions
values.template.yaml
pom.xml
4 changes: 0 additions & 4 deletions extensions/extensions-helm/aissemble-fastapi-chart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
</plugin>
<plugin>
<groupId>${group.helm.plugin}</groupId>
<artifactId>helm-maven-plugin</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ replicaCount: 1
hostname: fastapi
image:
name: boozallen/aissemble-fastapi
tag: "@version.aissemble@"
tag: ""
imagePullPolicy: Always
dockerRepo: ghcr.io/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
target
pom.xml

#helm ignore the base template and generate the values.yaml via POM plugin executions
values.template.yaml
pom.xml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions extensions/extensions-helm/aissemble-quarkus-chart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
</plugin>
<plugin>
<groupId>${group.helm.plugin}</groupId>
<artifactId>helm-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ 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:
- mountPath: /tmp/jars
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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ 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:
- mountPath: /tmp/jars
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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4f8df35

Please sign in to comment.