Skip to content

Commit

Permalink
Updated helm chart and dockerfile dependencies (hapifhir#540)
Browse files Browse the repository at this point in the history
* Updated Helm chart to use hapi fhir image v6.6.0

* Updated maven base image due to openjdk deprecation

* Removed superfluous app/main.war in entrypoint

* Update curlimages/curl to 8.1.2
  • Loading branch information
chgl authored Jun 25, 2023
1 parent a06c0b9 commit fdcd021
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 46 deletions.
2 changes: 0 additions & 2 deletions .github/ct/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ helm-extra-args: --timeout 300s
upgrade: true
skip-missing-values: true
release-label: release
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
release-name-template: "helm-v{{ .Version }}"
13 changes: 7 additions & 6 deletions .github/workflows/chart-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ on:

jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Add workspace as safe directory
run: |
git config --global --add safe.directory /__w/hapi-fhir-jpaserver-starter/hapi-fhir-jpaserver-starter
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0

Expand All @@ -21,14 +25,11 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Add bitnami repo
run: helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Update dependencies
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \;

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
with:
config: .github/ct/config.yaml
env:
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:

jobs:
lint:
runs-on: ubuntu-20.04
container: quay.io/helmpack/chart-testing:v3.4.0
runs-on: ubuntu-22.04
container: quay.io/helmpack/chart-testing:v3.8.0@sha256:f058c660a28d99a9394ae081d98921efe068079531f247c86b8054e3c9d407aa
steps:
- name: Install helm-docs
working-directory: /tmp
Expand All @@ -22,32 +22,35 @@ jobs:
chmod +x /usr/local/bin/helm-docs && \
helm-docs --version
- name: Add workspace as safe directory
run: |
git config --global --add safe.directory /__w/hapi-fhir-jpaserver-starter/hapi-fhir-jpaserver-starter
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0

- name: Check if documentation is up-to-date
run: helm-docs && git diff --exit-code HEAD

- name: Run chart-testing (lint)
run: ct lint --config .github/ct/config.yaml

test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
k8s-version: [1.22.9, 1.23.6, 1.24.1]
k8s-version: [1.25.9, 1.26.4, 1.27.2]
needs:
- lint
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -58,13 +61,12 @@ jobs:
fi
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.2.0
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
if: ${{ steps.list-changed.outputs.changed == 'true' }}
with:
version: v0.14.0
cluster_name: kind-cluster-k8s-${{ matrix.k8s-version }}
node_image: kindest/node:v${{ matrix.k8s-version }}

- name: Run chart-testing (install)
run: ct install --config .github/ct/config.yaml
if: steps.list-changed.outputs.changed == 'true'
if: ${{ steps.list-changed.outputs.changed == 'true' }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM maven:3.8-openjdk-17-slim as build-hapi
FROM docker.io/library/maven:3.9.2-eclipse-temurin-17 as build-hapi
WORKDIR /tmp/hapi-fhir-jpaserver-starter

ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.17.0
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.26.0
RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar

COPY pom.xml .
Expand Down Expand Up @@ -46,4 +46,4 @@ WORKDIR /app
COPY --chown=nonroot:nonroot --from=build-distroless /app /app
COPY --chown=nonroot:nonroot --from=build-hapi /tmp/hapi-fhir-jpaserver-starter/opentelemetry-javaagent.jar /app

ENTRYPOINT ["java", "--class-path", "/app/main.war", "-Dloader.path=main.war!/WEB-INF/classes/,main.war!/WEB-INF/,/app/extra-classes", "org.springframework.boot.loader.PropertiesLauncher", "app/main.war"]
ENTRYPOINT ["java", "--class-path", "/app/main.war", "-Dloader.path=main.war!/WEB-INF/classes/,main.war!/WEB-INF/,/app/extra-classes", "org.springframework.boot.loader.PropertiesLauncher"]
8 changes: 4 additions & 4 deletions charts/hapi-fhir-jpaserver/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: postgresql
repository: https:https://charts.bitnami.com/bitnami
version: 12.1.2
digest: sha256:525689611a29f90b0bc8cd674df5d97024c99eda8104216390f6747904fd0208
generated: "2022-11-21T22:55:45.1699395+01:00"
repository: oci:https://registry-1.docker.io/bitnamicharts
version: 12.5.6
digest: sha256:4d21dbc02bbdb55b957b0093e37376853727de82396abfadfaf1d738bd51b8e6
generated: "2023-06-03T20:58:45.922102213+02:00"
14 changes: 8 additions & 6 deletions charts/hapi-fhir-jpaserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ sources:
- https://github.com/hapifhir/hapi-fhir-jpaserver-starter
dependencies:
- name: postgresql
version: 12.1.2
repository: https:https://charts.bitnami.com/bitnami
version: 12.5.6
repository: oci:https://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
appVersion: 6.2.2
version: 0.11.1
appVersion: 6.6.0
version: 0.12.0
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
# When using the list of objects option the valid supported kinds are
# added, changed, deprecated, removed, fixed, and security.
- kind: changed
description: updated HAPI FHIR JPA Server app image version to v6.2.2
description: updated HAPI FHIR JPA Server app image version to v6.6.0
- kind: changed
description: updated curl used by helm tests to version to v7.87.0
description: updated curl used by helm tests to version to v8.1.1
- kind: changed
description: updated postgresql sub-chart to v12.5.6
13 changes: 8 additions & 5 deletions charts/hapi-fhir-jpaserver/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# HAPI FHIR JPA Server Starter Helm Chart

![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.2.2](https://img.shields.io/badge/AppVersion-6.2.2-informational?style=flat-square)
![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.6.0](https://img.shields.io/badge/AppVersion-6.6.0-informational?style=flat-square)

This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment.

## Sample usage

```sh
helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/
helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
```

> ⚠ By default, the included [PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)
> auto-generates a random password for the database which may cause problems when upgrading the chart (see [here for details](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)).
## Requirements

| Repository | Name | Version |
|------------|------|---------|
| oci:https://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 |

## Values

Expand All @@ -32,7 +35,7 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas
| image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use |
| image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted |
| image.repository | string | `"hapiproject/hapi"` | the path inside the repository |
| image.tag | string | `"v6.2.2@sha256:9c4e8af94d81ac0049dbb589e4cd855bf78c9c13be6f6844e814c63d63545b44"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
| image.tag | string | `"v6.6.0@sha256:c00367865ae5dad4e171cbb68bfc1c39818854079d1565bee4c86a45e78335d0"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
| imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image |
| ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. |
| ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint |
Expand Down
5 changes: 2 additions & 3 deletions charts/hapi-fhir-jpaserver/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes e

```sh
helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/
helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
```

> ⚠ By default, the included [PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)
> auto-generates a random password for the database which may cause problems when upgrading the chart (see [here for details](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)).
{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

Expand Down
2 changes: 1 addition & 1 deletion charts/hapi-fhir-jpaserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: wait-for-db-to-be-ready
image: docker.io/bitnami/postgresql:15.1.0-debian-11-r0@sha256:27915588d5203a10a1c23624d9c81644437f33b7c224e25f79bcd9bd09bbb8e2
image: docker.io/bitnami/postgresql:15.3.0-debian-11-r7@sha256:cc301eef743685f4f69d1d719853988e8a9650c90fd9521f4742ce400b3fdf6a
imagePullPolicy: IfNotPresent
{{- with .Values.restrictedContainerSecurityContext }}
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
restartPolicy: Never
containers:
- name: test-metadata-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd
image: docker.io/curlimages/curl:8.1.2@sha256:ef501f5efa67be41da985b441bd63130ef39d4d6a4f9c035d737884357438b6c
command: ["curl", "--fail-with-body"]
args: ["https://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/metadata?_summary=true"]
{{- with .Values.restrictedContainerSecurityContext }}
Expand All @@ -32,7 +32,7 @@ spec:
exec:
command: ["true"]
- name: test-patient-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd
image: docker.io/curlimages/curl:8.1.2@sha256:ef501f5efa67be41da985b441bd63130ef39d4d6a4f9c035d737884357438b6c
command: ["curl", "--fail-with-body"]
args: ["https://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/Patient?_count=1&_summary=true"]
{{- with .Values.restrictedContainerSecurityContext }}
Expand All @@ -53,7 +53,7 @@ spec:
exec:
command: ["true"]
- name: test-metrics-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd
image: docker.io/curlimages/curl:8.1.2@sha256:ef501f5efa67be41da985b441bd63130ef39d4d6a4f9c035d737884357438b6c
command: ["curl", "--fail-with-body"]
args: ["https://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.metrics.service.port }}/actuator/prometheus"]
{{- with .Values.restrictedContainerSecurityContext }}
Expand Down
2 changes: 1 addition & 1 deletion charts/hapi-fhir-jpaserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ image:
# -- the path inside the repository
repository: hapiproject/hapi
# -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image.
tag: "v6.2.2@sha256:9c4e8af94d81ac0049dbb589e4cd855bf78c9c13be6f6844e814c63d63545b44"
tag: "v6.6.0@sha256:c00367865ae5dad4e171cbb68bfc1c39818854079d1565bee4c86a45e78335d0"
# -- image pullPolicy to use
pullPolicy: IfNotPresent

Expand Down

0 comments on commit fdcd021

Please sign in to comment.