From 0842f43143b0c0b52b586176e61f4c8101b4ae01 Mon Sep 17 00:00:00 2001 From: Milan Malfait Date: Wed, 6 Dec 2023 16:03:40 +0000 Subject: [PATCH 1/4] Fix env variable names in `delete_oldest_n_studies.py` These new variable names are consistent with what is set in `.env` and `test/.env.test` --- scripts/delete_oldest_n_studies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/delete_oldest_n_studies.py b/scripts/delete_oldest_n_studies.py index a51a8c0cc..ba44a692b 100644 --- a/scripts/delete_oldest_n_studies.py +++ b/scripts/delete_oldest_n_studies.py @@ -33,9 +33,9 @@ def __init__(self, uid: str): class Orthanc: def __init__( self, - url=f"http://localhost:{os.environ['ORTHANC_PORT']}", - username=os.environ["ORTHANC_USERNAME"], - password=os.environ["ORTHANC_PASSWORD"], + url=f"http://localhost:{os.environ['ORTHANC_RAW_WEB_PORT']}", + username=os.environ["ORTHANC_RAW_USERNAME"], + password=os.environ["ORTHANC_RAW_PASSWORD"], ): self._url = url.rstrip("/") self._username = username From 9e118164653ac400308ab7c6241d323a32997ebe Mon Sep 17 00:00:00 2001 From: Milan Malfait Date: Wed, 6 Dec 2023 17:50:00 +0000 Subject: [PATCH 2/4] Add MaximumStorageSize config for orthanc-raw --- .env.sample | 1 + docker-compose.yml | 1 + orthanc/orthanc-raw/config/orthanc.json | 7 +++++-- test/.env.test.sample | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index f3fee8ea7..d190fba6f 100644 --- a/.env.sample +++ b/.env.sample @@ -39,6 +39,7 @@ ORTHANC_RAW_USERNAME= ORTHANC_RAW_PASSWORD= ORTHANC_RAW_AE_TITLE= ORTHANC_AUTOROUTE_RAW_TO_ANON=true +ORTHANC_RAW_MAXIMUM_STORAGE_SIZE= # PIXL Orthanc anon instance ORTHANC_ANON_USERNAME= diff --git a/docker-compose.yml b/docker-compose.yml index cd42d1e70..57ea53e4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -165,6 +165,7 @@ services: ORTHANC_PASSWORD: ${ORTHANC_RAW_PASSWORD} ORTHANC_RAW_AE_TITLE: ${ORTHANC_RAW_AE_TITLE} ORTHANC_AUTOROUTE_RAW_TO_ANON: ${ORTHANC_AUTOROUTE_RAW_TO_ANON} + ORTHANC_RAW_MAXIMUM_STORAGE_SIZE: ${ORTHANC_RAW_MAXIMUM_STORAGE_SIZE} VNA_AE_TITLE : ${VNA_AE_TITLE} VNA_DICOM_PORT: ${VNA_DICOM_PORT} VNA_IP_ADDR: ${VNA_IP_ADDR} diff --git a/orthanc/orthanc-raw/config/orthanc.json b/orthanc/orthanc-raw/config/orthanc.json index c74334936..dd5aa3e48 100644 --- a/orthanc/orthanc-raw/config/orthanc.json +++ b/orthanc/orthanc-raw/config/orthanc.json @@ -10,8 +10,11 @@ // doubling them, or replaced by forward slashes "/". "StorageDirectory" : "/var/lib/orthanc/db", - // Limit the maximum number of instances - "MaximumPatientCount": 20000, + // Limit the maximum storage size + "MaximumPatientCount" : 0, // no limit + "MaximumStorageSize" : "${ORTHANC_RAW_MAXIMUM_STORAGE_SIZE}", // MB + "MaximumStorageMode" : "Recycle", + // Path to the directory that holds the SQLite index (if unset, the // value of StorageDirectory is used). This index could be stored on diff --git a/test/.env.test.sample b/test/.env.test.sample index 515d419d0..c2bb14ddb 100644 --- a/test/.env.test.sample +++ b/test/.env.test.sample @@ -37,6 +37,7 @@ ORTHANC_RAW_USERNAME=orthanc_raw_username ORTHANC_RAW_PASSWORD=orthanc_raw_password ORTHANC_RAW_AE_TITLE=ORTHANCRAW ORTHANC_AUTOROUTE_RAW_TO_ANON=true +ORTHANC_RAW_MAXIMUM_STORAGE_SIZE=1 # PIXL Orthanc anon instance ORTHANC_ANON_USERNAME=orthanc_anon_username From 1cdf7f09196a1faa2ae2bf8637fbba7bb604574b Mon Sep 17 00:00:00 2001 From: Milan Malfait Date: Wed, 6 Dec 2023 17:58:10 +0000 Subject: [PATCH 3/4] MaximumStorageSize needs to be an integer --- orthanc/orthanc-raw/config/orthanc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orthanc/orthanc-raw/config/orthanc.json b/orthanc/orthanc-raw/config/orthanc.json index dd5aa3e48..1fa19f7e5 100644 --- a/orthanc/orthanc-raw/config/orthanc.json +++ b/orthanc/orthanc-raw/config/orthanc.json @@ -12,7 +12,7 @@ // Limit the maximum storage size "MaximumPatientCount" : 0, // no limit - "MaximumStorageSize" : "${ORTHANC_RAW_MAXIMUM_STORAGE_SIZE}", // MB + "MaximumStorageSize" : ${ORTHANC_RAW_MAXIMUM_STORAGE_SIZE}, // MB "MaximumStorageMode" : "Recycle", From 55972d59eb45257d6f8f7c1615794b640549905c Mon Sep 17 00:00:00 2001 From: Milan Malfait Date: Thu, 7 Dec 2023 09:41:00 +0000 Subject: [PATCH 4/4] Revert "Fix env variable names in `delete_oldest_n_studies.py`" This reverts commit 0842f43143b0c0b52b586176e61f4c8101b4ae01. --- scripts/delete_oldest_n_studies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/delete_oldest_n_studies.py b/scripts/delete_oldest_n_studies.py index ba44a692b..a51a8c0cc 100644 --- a/scripts/delete_oldest_n_studies.py +++ b/scripts/delete_oldest_n_studies.py @@ -33,9 +33,9 @@ def __init__(self, uid: str): class Orthanc: def __init__( self, - url=f"http://localhost:{os.environ['ORTHANC_RAW_WEB_PORT']}", - username=os.environ["ORTHANC_RAW_USERNAME"], - password=os.environ["ORTHANC_RAW_PASSWORD"], + url=f"http://localhost:{os.environ['ORTHANC_PORT']}", + username=os.environ["ORTHANC_USERNAME"], + password=os.environ["ORTHANC_PASSWORD"], ): self._url = url.rstrip("/") self._username = username