Skip to content

Commit

Permalink
Update with upstream branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rehammuzzamil committed Nov 28, 2023
2 parents 48274b9 + f147c83 commit dbe5572
Show file tree
Hide file tree
Showing 71 changed files with 1,901 additions and 631 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
27 changes: 15 additions & 12 deletions .github/workflows/chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ 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
env:
HELM_DOCS_URL: https://github.com/norwoodj/helm-docs/releases/download/v1.11.0/helm-docs_1.11.0_Linux_x86_64.tar.gz
HELM_DOCS_URL: https://github.com/norwoodj/helm-docs/releases/download/v1.11.3/helm-docs_1.11.3_Linux_x86_64.tar.gz
run: |
curl -LSs $HELM_DOCS_URL | tar xz && \
mv ./helm-docs /usr/local/bin/helm-docs && \
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

Expand All @@ -34,20 +38,20 @@ jobs:
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 +62,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' }}
7 changes: 4 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file pom.xml verify
41 changes: 41 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will build the Java project with Maven and peform IntelliJ smoke tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Smoke Tests

on:
push:
branches:
- '**'
paths-ignore:
- "charts/**"
pull_request:
branches: [ master ]
paths-ignore:
- "charts/**"

jobs:
build_and_smoke_test:

runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
- name: Docker Pull HTTP client
run: docker pull jetbrains/intellij-http-client
- name: Start server with jetty
run: |
mvn jetty:run & export JPA_PROCESS=$!
sleep 80
- name: Execute smoke tests
run: docker run --rm -v $PWD:/workdir --add-host host.docker.internal:host-gateway jetbrains/intellij-http-client -D src/test/smoketest/plain_server.http --env-file src/test/smoketest/http-client.env.json --env default


14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"configurations": [
{
"type": "java",
"name": "Spring Boot-Application<hapi-fhir-jpaserver-starter>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "ca.uhn.fhir.jpa.starter.Application",
"projectName": "hapi-fhir-jpaserver-starter",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
}
},
"java.compile.nullAnalysis.mode": "disabled"
}
12 changes: 6 additions & 6 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.4-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.31.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 All @@ -12,13 +12,13 @@ COPY src/ /tmp/hapi-fhir-jpaserver-starter/src/
RUN mvn clean install -DskipTests -Djdk.lang.Process.launchMechanism=vfork

FROM build-hapi AS build-distroless
RUN mvn package spring-boot:repackage -Pboot
RUN mvn package -DskipTests spring-boot:repackage -Pboot
RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.war


########### bitnami tomcat version is suitable for debugging and comes with a shell
########### it can be built using eg. `docker build --target tomcat .`
FROM bitnami/tomcat:9.0 as tomcat
FROM bitnami/tomcat:9.0 AS tomcat

RUN rm -rf /opt/bitnami/tomcat/webapps/ROOT && \
mkdir -p /opt/bitnami/hapi/data/hapi/lucenefiles && \
Expand All @@ -36,7 +36,7 @@ COPY --from=build-hapi --chown=1001:1001 /tmp/hapi-fhir-jpaserver-starter/opente
ENV ALLOW_EMPTY_PASSWORD=yes

########### distroless brings focus on security and runs on plain spring boot - this is the default image
FROM gcr.io/distroless/java17-debian11:nonroot as default
FROM gcr.io/distroless/java17-debian11:nonroot AS default
# 65532 is the nonroot user's uid
# used here instead of the name to allow Kubernetes to easily detect that the container
# is running as a non-root (uid != 0) user.
Expand All @@ -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

CMD ["/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"]
Loading

0 comments on commit dbe5572

Please sign in to comment.