Skip to content

Commit 1d3342d

Browse files
committed
Merge branch 'master' into rel_7_1_tracking
2 parents 70da0dc + 9a9cc8b commit 1d3342d

File tree

11 files changed

+132
-31
lines changed

11 files changed

+132
-31
lines changed

.github/workflows/chart-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install helm-docs
1616
working-directory: /tmp
1717
env:
18-
HELM_DOCS_URL: https://github.com/norwoodj/helm-docs/releases/download/v1.11.3/helm-docs_1.11.3_Linux_x86_64.tar.gz
18+
HELM_DOCS_URL: https://github.com/norwoodj/helm-docs/releases/download/v1.13.0/helm-docs_1.13.0_Linux_x86_64.tar.gz
1919
run: |
2020
curl -LSs $HELM_DOCS_URL | tar xz && \
2121
mv ./helm-docs /usr/local/bin/helm-docs && \

.github/workflows/stale.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v9
11+
with:
12+
stale-issue-message: 'This issue is stale because it has been open 730 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
13+
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
14+
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
15+
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
16+
days-before-issue-stale: 730
17+
days-before-pr-stale: 45
18+
days-before-issue-close: 5
19+
days-before-pr-close: 10

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,32 @@ public class YourInterceptor
189189

190190
## Running locally
191191

192-
The easiest way to run this server entirely depends on your environment requirements. At least, the following 4 ways are supported:
192+
The easiest way to run this server entirely depends on your environment requirements. The following ways are supported:
193193

194194
### Using jetty
195195
```bash
196-
mvn -Pjetty jetty:run
196+
mvn -Pjetty spring-boot:run
197197
```
198198

199+
The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata.
199200

200-
If you need to run this server on a different port (using Maven), you can change the port in the run command as follows:
201-
201+
### Using Spring Boot
202202
```bash
203-
mvn -Pjetty -Djetty.port=8888 jetty:run
203+
mvn spring-boot:run
204+
```
205+
206+
The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata.
207+
208+
If you want to run this server on a different port, you can change the port in the `src/main/resources/application.yaml` file as follows:
209+
210+
```yaml
211+
server:
212+
# servlet:
213+
# context-path: /example/path
214+
port: 8888
204215
```
205216
206-
Server will then be accessible at http://localhost:8888/ and eg. http://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg.
217+
The Server will then be accessible at http://localhost:8888/fhir and the CapabilityStatement will be found at http://localhost:8888/fhir/metadata. Remember to adjust your overlay configuration in the `application.yaml` file to the following:
207218

208219
```yaml
209220
tester:
@@ -219,7 +230,7 @@ Server will then be accessible at http://localhost:8888/ and eg. http://localhos
219230
```bash
220231
mvn clean spring-boot:run -Pboot
221232
```
222-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg.
233+
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following:
223234

224235
```yaml
225236
tester:
@@ -235,7 +246,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
235246
```bash
236247
mvn clean package spring-boot:repackage -Pboot && java -jar target/ROOT.war
237248
```
238-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
249+
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
239250

240251
```yaml
241252
tester:
@@ -250,7 +261,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
250261
```bash
251262
mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 distroless-hapi
252263
```
253-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
264+
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
254265

255266
```yaml
256267
tester:
@@ -266,7 +277,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
266277
```bash
267278
./build-docker-image.sh && docker run -p 8080:8080 hapi-fhir/hapi-fhir-jpaserver-starter:latest
268279
```
269-
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
280+
Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:
270281

271282
```yaml
272283
tester:

charts/hapi-fhir-jpaserver/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: postgresql
33
repository: oci://registry-1.docker.io/bitnamicharts
4-
version: 13.2.27
5-
digest: sha256:6374f6f32d32adbe6763c48e2d817d85ec20a1784b2aea1fb0312c658f8e58e9
6-
generated: "2024-01-10T17:56:36.521957926+01:00"
4+
version: 14.3.1
5+
digest: sha256:fb1d56a00b544bb2ad5691553cadf6384f499652acb9ff5ad625ef36a1b8979e
6+
generated: "2024-03-10T14:43:22.395381351+01:00"

charts/hapi-fhir-jpaserver/Chart.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ sources:
77
- https://github.com/hapifhir/hapi-fhir-jpaserver-starter
88
dependencies:
99
- name: postgresql
10-
version: 13.2.27
10+
version: 14.3.1
1111
repository: oci://registry-1.docker.io/bitnamicharts
1212
condition: postgresql.enabled
13-
appVersion: 6.10.1
14-
version: 0.15.0
13+
appVersion: 7.0.3
14+
version: 0.16.0
1515
annotations:
1616
artifacthub.io/license: Apache-2.0
1717
artifacthub.io/containsSecurityUpdates: "false"
@@ -24,8 +24,8 @@ annotations:
2424
# When using the list of objects option the valid supported kinds are
2525
# added, changed, deprecated, removed, fixed, and security.
2626
- kind: changed
27-
description: updated starter image to 6.10.1
27+
description: updated starter image to v7.0.3
2828
- kind: changed
29-
description: updated curlimages/curl to 8.5.0
29+
description: updated curlimages/curl to 8.6.0
3030
- kind: changed
31-
description: "updated postgresql sub-chart to 13.2.27. ⚠️: this updates the used PostgreSQL image from v15 to v16."
31+
description: "updated postgresql sub-chart to 14.3.1."

charts/hapi-fhir-jpaserver/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HAPI FHIR JPA Server Starter Helm Chart
22

3-
![Version: 0.15.0](https://img.shields.io/badge/Version-0.15.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.10.1](https://img.shields.io/badge/AppVersion-6.10.1-informational?style=flat-square)
3+
![Version: 0.16.0](https://img.shields.io/badge/Version-0.16.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.0.3](https://img.shields.io/badge/AppVersion-7.0.3-informational?style=flat-square)
44

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

@@ -15,7 +15,7 @@ helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
1515

1616
| Repository | Name | Version |
1717
|------------|------|---------|
18-
| oci://registry-1.docker.io/bitnamicharts | postgresql | 13.2.27 |
18+
| oci://registry-1.docker.io/bitnamicharts | postgresql | 14.3.1 |
1919

2020
## Values
2121

@@ -36,7 +36,7 @@ helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
3636
| image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use |
3737
| image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted |
3838
| image.repository | string | `"hapiproject/hapi"` | the path inside the repository |
39-
| image.tag | string | `"v6.10.1@sha256:4eac1b3481180b028616d1fab7e657e368538063d75f7ed3be2032e34c657dd4"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
39+
| image.tag | string | `"v7.0.3@sha256:73ff82fec42e5cbb7e66338d47af09ba91c140e98beeaee41a5459572d5ae1ce"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
4040
| imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image |
4141
| ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. |
4242
| ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint |
@@ -57,6 +57,7 @@ helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
5757
| postgresql.auth.database | string | `"fhir"` | name for a custom database to create |
5858
| postgresql.auth.existingSecret | string | `""` | Name of existing secret to use for PostgreSQL credentials `auth.postgresPassword`, `auth.password`, and `auth.replicationPassword` will be ignored and picked up from this secret The secret must contain the keys `postgres-password` (which is the password for "postgres" admin user), `password` (which is the password for the custom user to create when `auth.username` is set), and `replication-password` (which is the password for replication user). The secret might also contains the key `ldap-password` if LDAP is enabled. `ldap.bind_password` will be ignored and picked from this secret in this case. The value is evaluated as a template. |
5959
| postgresql.enabled | bool | `true` | enable an included PostgreSQL DB. see <https://github.com/bitnami/charts/tree/master/bitnami/postgresql> for details if set to `false`, the values under `externalDatabase` are used |
60+
| postgresql.primary.containerSecurityContext.readOnlyRootFilesystem | bool | `true` | |
6061
| replicaCount | int | `1` | number of replicas to deploy |
6162
| resources | object | `{}` | configure the FHIR server's resource requests and limits |
6263
| securityContext.allowPrivilegeEscalation | bool | `false` | |
@@ -139,4 +140,4 @@ kubectl port-forward -n observability service/simplest-query 16686:16686
139140
and opening <http://localhost:16686/> in your browser.
140141

141142
----------------------------------------------
142-
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
143+
Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0)

charts/hapi-fhir-jpaserver/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3232
initContainers:
3333
- name: wait-for-db-to-be-ready
34-
image: docker.io/bitnami/postgresql:16.1.0-debian-11-r18@sha256:06f1f2297f6241a02bd8e8c025b31625254ca66784ac75a4a62e945fa611d045
34+
image: docker.io/bitnami/postgresql:16.2.0-debian-12-r6@sha256:ea55532b6f75afbc97f617d91ec5efae17609c8eb825a31845fa9cb9e4aa13e1
3535
imagePullPolicy: IfNotPresent
3636
{{- with .Values.restrictedContainerSecurityContext }}
3737
securityContext:

charts/hapi-fhir-jpaserver/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ image:
77
# -- the path inside the repository
88
repository: hapiproject/hapi
99
# -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image.
10-
tag: "v6.10.1@sha256:4eac1b3481180b028616d1fab7e657e368538063d75f7ed3be2032e34c657dd4"
10+
tag: "v7.0.3@sha256:73ff82fec42e5cbb7e66338d47af09ba91c140e98beeaee41a5459572d5ae1ce"
1111
# -- image pullPolicy to use
1212
pullPolicy: IfNotPresent
1313

@@ -109,6 +109,9 @@ postgresql:
109109
# see <https://github.com/bitnami/charts/tree/master/bitnami/postgresql> for details
110110
# if set to `false`, the values under `externalDatabase` are used
111111
enabled: true
112+
primary:
113+
containerSecurityContext:
114+
readOnlyRootFilesystem: true
112115
auth:
113116
# -- name for a custom database to create
114117
database: "fhir"

pom.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,20 @@
596596
</dependency>
597597
</dependencies>
598598
</profile>
599-
<!-- examples of how to start the server using the default profile-->
600-
<!-- mvn clean package jetty:run -->
601-
<!-- java -jar jetty-runner.jar target/hapi-fhir-jpaserver.war -->
599+
<!-- -->
600+
<!-- Examples of how to run the server: -->
601+
<!-- -->
602+
<!-- For Spring Boot use: -->
603+
<!-- mvn spring-boot:run -->
604+
<!-- -->
605+
<!-- For JETTY use: -->
606+
<!-- mvn -Pjetty spring-boot:run -->
607+
<!-- -->
608+
<!-- For the Tomcat WAR approach use: -->
609+
<!-- mvn clean package -DskipTests && java -jar ./target/ROOT.war -->
610+
<!-- -->
611+
<!-- NEXT: Browse to http://localhost:8080/fhir -->
612+
<!-- -->
602613
<profile>
603614
<id>jetty</id>
604615
<dependencies>
@@ -676,5 +687,18 @@
676687
</plugins>
677688
</build>
678689
</profile>
690+
<!-- For connecting to GCP CloudSQL Postgres instances:
691+
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/main/docs/jdbc.md#postgres-1
692+
Needs 'boot' profile as well. -->
693+
<profile>
694+
<id>cloudsql-postgres</id>
695+
<dependencies>
696+
<dependency>
697+
<groupId>com.google.cloud.sql</groupId>
698+
<artifactId>postgres-socket-factory</artifactId>
699+
<version>1.17.0</version>
700+
</dependency>
701+
</dependencies>
702+
</profile>
679703
</profiles>
680704
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package ca.uhn.fhir.jpa.starter.web;
2+
3+
import ca.uhn.fhir.batch2.api.IJobCoordinator;
4+
import ca.uhn.fhir.batch2.api.JobOperationResultJson;
5+
import ca.uhn.fhir.batch2.model.JobInstance;
6+
import ca.uhn.fhir.batch2.model.StatusEnum;
7+
import ca.uhn.fhir.batch2.models.JobInstanceFetchRequest;
8+
import jakarta.validation.constraints.Min;
9+
import org.springframework.data.domain.Sort;
10+
import org.springframework.http.MediaType;
11+
import org.springframework.web.bind.annotation.*;
12+
13+
import java.util.List;
14+
15+
@RestController
16+
@RequestMapping("control")
17+
public class JobController {
18+
private final IJobCoordinator theJobCoordinator;
19+
20+
public JobController(IJobCoordinator theJobCoordinator) {
21+
this.theJobCoordinator = theJobCoordinator;
22+
}
23+
24+
@RequestMapping(value = JobController.JOBS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
25+
public List<JobInstance> getAllJobs(@RequestParam(name = "pageStart") @Min(0) int pageStart, @RequestParam(name = "batchSize") int batchSize, @RequestParam(name = "jobStatus", required = false) StatusEnum jobStatus) {
26+
JobInstanceFetchRequest jobInstanceFetchRequest = new JobInstanceFetchRequest();
27+
jobInstanceFetchRequest.setPageStart(pageStart);
28+
jobInstanceFetchRequest.setBatchSize(batchSize);
29+
jobInstanceFetchRequest.setJobStatus(jobStatus != null ? jobStatus.toString() : "");
30+
jobInstanceFetchRequest.setSort(Sort.by(Sort.Direction.DESC, JobController.MY_CREATE_TIME));
31+
32+
return theJobCoordinator.fetchAllJobInstances(jobInstanceFetchRequest).getContent();
33+
}
34+
35+
@RequestMapping(value = JobController.JOBS, method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
36+
public JobOperationResultJson cancelInstance(@RequestParam(name = "instanceId") String instanceId) {
37+
return theJobCoordinator.cancelInstance(instanceId);
38+
}
39+
40+
public static final String JOBS = "jobs";
41+
public static final String MY_CREATE_TIME = "myCreateTime";
42+
}

0 commit comments

Comments
 (0)