Skip to content

Commit df6ecad

Browse files
authored
Integrate MS Health Check Service (#130)
* Update health check API * Integrate MS health check service * Enable overriding configurations with env vars Signed-off-by: Victor Chang <[email protected]>
1 parent 64264fc commit df6ecad

24 files changed

+255
-197
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RUN apt-get clean \
3535
libssl1.1 \
3636
openssl \
3737
sqlite3 \
38+
curl \
3839
&& rm -rf /var/lib/apt/lists
3940

4041
WORKDIR /opt/monai/ig
@@ -48,6 +49,8 @@ EXPOSE 104
4849
EXPOSE 2575
4950
EXPOSE 5000
5051

52+
HEALTHCHECK --interval=10s --retries=10 CMD curl --fail http://localhost:5000/health || exit 1
53+
5154
RUN ls -lR /opt/monai/ig
5255
ENV PATH="/opt/dotnetcore-tools:${PATH}"
5356

doc/dependency_decisions.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,8 @@
1818
- :who: mocsharp
1919
:why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt)
2020
:versions:
21-
- 3.7.12
22-
:when: 2022-08-16 23:05:22.203089302 Z
23-
- - :approve
24-
- AWSSDK.Core
25-
- :who: mocsharp
26-
:why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt)
27-
:versions:
28-
- 3.7.12
29-
:when: 2022-08-16 23:05:27.554306178 Z
30-
- - :approve
31-
- AWSSDK.Core
32-
- :who: mocsharp
33-
:why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt)
34-
:versions:
35-
- 3.7.12.21
36-
:when: 2022-08-16 23:05:27.995041369 Z
21+
- 3.7.12.26
22+
:when: 2022-09-01 23:05:22.203089302 Z
3723
- - :approve
3824
- AWSSDK.S3
3925
- :who: mocsharp
@@ -46,15 +32,8 @@
4632
- :who: mocsharp
4733
:why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt)
4834
:versions:
49-
- 3.7.1.165
50-
:when: 2022-08-16 23:05:28.920368903 Z
51-
- - :approve
52-
- AWSSDK.SecurityToken
53-
- :who: mocsharp
54-
:why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt)
55-
:versions:
56-
- 3.7.1.185
57-
:when: 2022-08-16 23:05:29.352541363 Z
35+
- 3.7.1.190
36+
:when: 2022-09-01 23:05:28.920368903 Z
5837
- - :approve
5938
- BoDi
6039
- :who: mocsharp
@@ -109,15 +88,15 @@
10988
- :who: mocsharp
11089
:why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE)
11190
:versions:
112-
- 4.7.0
113-
:when: 2022-08-16 23:05:32.857032968 Z
91+
- 4.7.1
92+
:when: 2022-09-01 23:05:32.857032968 Z
11493
- - :approve
11594
- DotNext.Threading
11695
- :who: mocsharp
11796
:why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE)
11897
:versions:
119-
- 4.7.0
120-
:when: 2022-08-16 23:05:33.298402277 Z
98+
- 4.7.1
99+
:when: 2022-09-01 23:05:33.298402277 Z
121100
- - :approve
122101
- FluentAssertions
123102
- :who: mocsharp
@@ -368,8 +347,8 @@
368347
- :who: mocsharp
369348
:why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE)
370349
:versions:
371-
- 17.3.0
372-
:when: 2022-08-16 23:05:49.229587689 Z
350+
- 17.3.1
351+
:when: 2022-09-01 23:05:49.229587689 Z
373352
- - :approve
374353
- Microsoft.Data.Sqlite.Core
375354
- :who: mocsharp
@@ -566,6 +545,27 @@
566545
:versions:
567546
- 6.0.0
568547
:when: 2022-08-16 23:06:02.270628975 Z
548+
- - :approve
549+
- Microsoft.Extensions.Diagnostics.HealthChecks
550+
- :who: mocsharp
551+
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
552+
:versions:
553+
- 6.0.8
554+
:when: 2022-08-29 18:11:22.090772006 Z
555+
- - :approve
556+
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions
557+
- :who: mocsharp
558+
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
559+
:versions:
560+
- 6.0.8
561+
:when: 2022-08-29 18:11:22.090772006 Z
562+
- - :approve
563+
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore
564+
- :who: mocsharp
565+
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
566+
:versions:
567+
- 6.0.8
568+
:when: 2022-08-29 18:11:22.090772006 Z
569569
- - :approve
570570
- Microsoft.Extensions.FileProviders.Abstractions
571571
- :who: mocsharp
@@ -732,8 +732,8 @@
732732
- :who: mocsharp
733733
:why: MIT ( https://aka.ms/deprecateLicenseUrl)
734734
:versions:
735-
- 17.3.0
736-
:when: 2022-08-16 23:06:13.008314524 Z
735+
- 17.3.1
736+
:when: 2022-09-01 23:06:13.008314524 Z
737737
- - :approve
738738
- Microsoft.NETCore.Platforms
739739
- :who: mocsharp
@@ -793,10 +793,10 @@
793793
- - :approve
794794
- Microsoft.TestPlatform.ObjectModel
795795
- :who: mocsharp
796-
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
796+
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE)
797797
:versions:
798-
- 17.3.0
799-
:when: 2022-08-16 23:06:17.198633634 Z
798+
- 17.3.1
799+
:when: 2022-09-01 23:06:17.198633634 Z
800800
- - :approve
801801
- Microsoft.TestPlatform.TestHost
802802
- :who: mocsharp
@@ -814,10 +814,10 @@
814814
- - :approve
815815
- Microsoft.TestPlatform.TestHost
816816
- :who: mocsharp
817-
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE)
817+
:why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE)
818818
:versions:
819-
- 17.3.0
820-
:when: 2022-08-16 23:06:18.619013325 Z
819+
- 17.3.1
820+
:when: 2022-09-01 23:06:18.619013325 Z
821821
- - :approve
822822
- Microsoft.Win32.Primitives
823823
- :who: mocsharp
@@ -851,35 +851,35 @@
851851
- :who: mocsharp
852852
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
853853
:versions:
854-
- 0.1.3
854+
- 0.1.4
855855
:when: 2022-08-16 23:06:21.051573547 Z
856856
- - :approve
857857
- Monai.Deploy.Messaging.RabbitMQ
858858
- :who: mocsharp
859859
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
860860
:versions:
861-
- 0.1.3
861+
- 0.1.4
862862
:when: 2022-08-16 23:06:21.511789690 Z
863863
- - :approve
864864
- Monai.Deploy.Storage
865865
- :who: mocsharp
866866
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE)
867867
:versions:
868-
- 0.2.0
868+
- 0.2.5
869869
:when: 2022-08-16 23:06:21.988183476 Z
870870
- - :approve
871871
- Monai.Deploy.Storage.MinIO
872872
- :who: mocsharp
873873
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE)
874874
:versions:
875-
- 0.2.0
875+
- 0.2.5
876876
:when: 2022-08-16 23:06:22.426838304 Z
877877
- - :approve
878878
- Monai.Deploy.Storage.S3Policy
879879
- :who: mocsharp
880880
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE)
881881
:versions:
882-
- 0.2.0
882+
- 0.2.5
883883
:when: 2022-08-16 23:06:22.881956546 Z
884884
- - :approve
885885
- Moq

docs/api/rest/health.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,79 +18,105 @@
1818

1919
The _health_ endpoint provides the following APIs to get the status of the internals of the Informatics Gateway.
2020

21-
## GET /health/status
2221

23-
Returns the MONAI Informatics Gateway service status:
2422

25-
- Active DICOM DIMSE associations
26-
- Internal service status
23+
## GET /health/
24+
25+
Returns the MONAI Deploy Informatics Gateway service readiness and liveness.
2726

2827
### Parameters
2928

3029
N/A
3130

3231
### Responses
3332

34-
Response Content Type: JSON - [HealthStatusResponse](xref:Monai.Deploy.InformaticsGateway.Api.Rest.HealthStatusResponse).
33+
Response Content Type: JSON
34+
35+
- `Healthy`: All services are running.
36+
- `Unhealthy`: One or more services have stopped or crashed.
3537

3638
| Code | Description |
3739
| ---- | --------------------------------------------------------------------------------------------------------------------------------------- |
38-
| 200 | Status is available. |
40+
| 200 | Service is healthy. |
41+
| 503 | Service is unhealthy. |
3942
| 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. |
4043

4144
### Example Request
4245

4346
```bash
44-
curl --location --request GET 'http://localhost:5000/health/status'
47+
curl --location --request GET 'http://localhost:5000/health'
4548
```
4649

4750
### Example Response
4851

4952
```json
5053
{
51-
"activeDimseConnections": 8,
52-
"services": {
53-
"Space Reclaimer Service": "Running",
54-
"DICOM SCP Service": "Running",
55-
"DICOMweb Export Service": "Running",
56-
"DICOM Export Service": "Running",
57-
"Data Retrieval Service": "Running",
58-
"Workload Manager Notification Service": "Running"
59-
}
54+
"status": "Healthy",
55+
"checks": [
56+
{
57+
"check": "Informatics Gateway Services",
58+
"result": "Healthy"
59+
},
60+
{
61+
"check": "InformaticsGatewayContext",
62+
"result": "Healthy"
63+
},
64+
{
65+
"check": "minio",
66+
"result": "Healthy"
67+
},
68+
{
69+
"check": "Rabbit MQ Subscriber",
70+
"result": "Healthy"
71+
},
72+
{
73+
"check": "Rabbit MQ Publisher",
74+
"result": "Healthy"
75+
}
76+
]
6077
}
6178
```
6279

6380
---
6481

65-
## GET /health/ready & GET /health/live
82+
## GET /health/status
83+
84+
Returns the MONAI Informatics Gateway service status:
6685

67-
Returns the MONAI Deploy Informatics Gateway service readiness and liveness.
86+
- Active DICOM DIMSE associations
87+
- Internal service status
6888

6989
### Parameters
7090

7191
N/A
7292

7393
### Responses
7494

75-
Response Content Type: JSON
76-
77-
- `Healthy`: All services are running.
78-
- `Unhealthy`: One or more services have stopped or crashed.
95+
Response Content Type: JSON - [HealthStatusResponse](xref:Monai.Deploy.InformaticsGateway.Api.Rest.HealthStatusResponse).
7996

8097
| Code | Description |
8198
| ---- | --------------------------------------------------------------------------------------------------------------------------------------- |
82-
| 200 | Service is healthy. |
83-
| 503 | Service is unhealthy. |
99+
| 200 | Status is available. |
84100
| 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. |
85101

86102
### Example Request
87103

88104
```bash
89-
curl --location --request GET 'http://localhost:5000/health/live'
105+
curl --location --request GET 'http://localhost:5000/health/status'
90106
```
91107

92108
### Example Response
93109

94110
```json
95-
"Healthy"
111+
{
112+
"activeDimseConnections": 8,
113+
"services": {
114+
"Space Reclaimer Service": "Running",
115+
"DICOM SCP Service": "Running",
116+
"DICOMweb Export Service": "Running",
117+
"DICOM Export Service": "Running",
118+
"Data Retrieval Service": "Running",
119+
"Workload Manager Notification Service": "Running"
120+
}
121+
}
96122
```

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
[GitHub Milestone 0.3.0](https://github.com/Project-MONAI/monai-deploy-informatics-gateway/milestone/3)
2222

2323
- Adds a basic [FHIR service](api/rest/config.md) to accept any versions of FHIR.
24+
- Updates [Health Check API](api/rest/health.md) to replace `/health/live` and `/health/ready` APIs with `/health` API.
2425

2526
## 0.2.0
2627

src/Api/Monai.Deploy.InformaticsGateway.Api.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
</PackageReference>
3131
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
3232
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.8" />
33-
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.3" />
34-
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.0" />
33+
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.4" />
34+
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.5" />
3535
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
3636
</ItemGroup>
3737

src/Api/Test/Monai.Deploy.InformaticsGateway.Api.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>
35-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
35+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3636
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.1.1" />
3737
<PackageReference Include="xRetry" Version="1.8.0" />
3838
<PackageReference Include="xunit" Version="2.4.2" />

src/CLI/Test/Monai.Deploy.InformaticsGateway.CLI.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>
35-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
35+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3636
<PackageReference Include="Moq" Version="4.18.2" />
3737
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
3838
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.1.1" />

src/Client.Common/Test/Monai.Deploy.InformaticsGateway.Client.Common.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
33+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3434
<PackageReference Include="xRetry" Version="1.8.0" />
3535
<PackageReference Include="xunit" Version="2.4.2" />
3636
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">

src/Client/Test/Monai.Deploy.InformaticsGateway.Client.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>
35-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
35+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3636
<PackageReference Include="xunit" Version="2.4.2" />
3737
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/Common/Test/Monai.Deploy.InformaticsGateway.Common.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<PrivateAssets>all</PrivateAssets>
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
</PackageReference>
31-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
31+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3232
<PackageReference Include="Moq" Version="4.18.2" />
3333
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.1.1" />
3434
<PackageReference Include="xunit" Version="2.4.2" />

0 commit comments

Comments
 (0)