From b8b81b1242f97ad8b7206224953f478eefd3514e Mon Sep 17 00:00:00 2001 From: DavidCroftDKFZ <46788708+DavidCroftDKFZ@users.noreply.github.com> Date: Thu, 15 Aug 2024 09:17:34 +0200 Subject: [PATCH 1/5] Fixed environment variable passing for Directory sync There were problems with the passing of environment variables from bbmri.conf to the Directory synce container: * The Directory password variable was misspellt. * Some useful variables were missing. Additionally, a delay was added before launching Directory sync, to give Blaze time to start up. --- bbmri/modules/directory-sync-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 60998f3..0a58cd1 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -6,7 +6,11 @@ services: environment: DS_DIRECTORY_URL: ${DS_DIRECTORY_URL} DS_DIRECTORY_USER_NAME: ${DS_DIRECTORY_USER_NAME} - DS_DIRECTORY_PASS_CODE: ${DS_DIRECTORY_PASS_CODE} + DS_DIRECTORY_USER_PASS: ${DS_DIRECTORY_USER_PASS} DS_TIMER_CRON: ${DS_TIMER_CRON} # It is recommended to check the enabling of this flag with your local data protection group DS_DIRECTORY_ALLOW_STAR_MODEL: ${DS_DIRECTORY_ALLOW_STAR_MODEL} + DS_DIRECTORY_MOCK: ${DS_DIRECTORY_MOCK} + DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID} + DS_DIRECTORY_COUNTRY: ${DS_DIRECTORY_COUNTRY} + command: sh -c "sleep 90 && java -jar directory_sync_service.jar" # Wait for Blaze before start From 95574f38befffe81c796178098d4c98704d6dad0 Mon Sep 17 00:00:00 2001 From: DavidCroftDKFZ <46788708+DavidCroftDKFZ@users.noreply.github.com> Date: Thu, 15 Aug 2024 10:33:28 +0200 Subject: [PATCH 2/5] Included Blaze dependency --- bbmri/modules/directory-sync-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 0a58cd1..17929cc 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -14,3 +14,5 @@ services: DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID} DS_DIRECTORY_COUNTRY: ${DS_DIRECTORY_COUNTRY} command: sh -c "sleep 90 && java -jar directory_sync_service.jar" # Wait for Blaze before start + depends_on: + - "blaze" From 3496fa7a0f0669f891aee1af0914a8e248398440 Mon Sep 17 00:00:00 2001 From: DavidCroftDKFZ <46788708+DavidCroftDKFZ@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:36:57 +0200 Subject: [PATCH 3/5] Let Directory sync handle connection with Blaze Remove the delayed start, because Directory sync will automatically keep trying to connect to Blaze if not initially present. --- bbmri/modules/directory-sync-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 17929cc..1afc46a 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -13,6 +13,5 @@ services: DS_DIRECTORY_MOCK: ${DS_DIRECTORY_MOCK} DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID} DS_DIRECTORY_COUNTRY: ${DS_DIRECTORY_COUNTRY} - command: sh -c "sleep 90 && java -jar directory_sync_service.jar" # Wait for Blaze before start depends_on: - "blaze" From de847f309c52ba5604d6f8768bb237440b47db90 Mon Sep 17 00:00:00 2001 From: lablans Date: Thu, 15 Aug 2024 11:40:02 +0000 Subject: [PATCH 4/5] Provide defaults --- README.md | 9 +++------ bbmri/modules/directory-sync-compose.yml | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6c0e480..12984d1 100644 --- a/README.md +++ b/README.md @@ -306,15 +306,12 @@ Full details can be found in [directory_sync_service](https://github.com/samply/ To enable it, you will need to set these variables to the ```bbmri.conf``` file of your GitLab repository. Here is an example config: ``` -DS_DIRECTORY_URL=https://directory.bbmri-eric.eu DS_DIRECTORY_USER_NAME=your_directory_username -DS_DIRECTORY_USER_PASS=qwdnqwswdvqHBVGFR9887 -DS_DIRECTORY_ALLOW_STAR_MODEL=true -DS_TIMER_CRON="0 22 * * *" +DS_DIRECTORY_USER_PASS=your_directory_password ``` -You must contact the Directory team for your national node to find the URL, and to register as a user. +Please contact your National Node to obtain this information. -Additionally, you should choose when you want Directory sync to run. In the example above, this is set to happen at 10 pm every evening. You can modify this to suit your requirements. The timer specification should follow the [cron](https://crontab.guru) convention. +Optionally, you **may** change when you want Directory sync to run by specifying a [cron](https://crontab.guru) expression, e.g. `DS_TIMER_CRON="0 22 * * *"` for 10 pm every evening. Once you edited the gitlab config, the bridgehead will autoupdate the config with the values and will sync the data. diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 1afc46a..215acd4 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -4,12 +4,12 @@ services: directory_sync_service: image: "docker.verbis.dkfz.de/cache/samply/directory_sync_service" environment: - DS_DIRECTORY_URL: ${DS_DIRECTORY_URL} + DS_DIRECTORY_URL: ${DS_DIRECTORY_URL:-https://directory.bbmri-eric.eu} DS_DIRECTORY_USER_NAME: ${DS_DIRECTORY_USER_NAME} DS_DIRECTORY_USER_PASS: ${DS_DIRECTORY_USER_PASS} - DS_TIMER_CRON: ${DS_TIMER_CRON} + DS_TIMER_CRON: ${DS_TIMER_CRON:-0 22 * * *} # It is recommended to check the enabling of this flag with your local data protection group - DS_DIRECTORY_ALLOW_STAR_MODEL: ${DS_DIRECTORY_ALLOW_STAR_MODEL} + DS_DIRECTORY_ALLOW_STAR_MODEL: ${DS_DIRECTORY_ALLOW_STAR_MODEL:-true} DS_DIRECTORY_MOCK: ${DS_DIRECTORY_MOCK} DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID} DS_DIRECTORY_COUNTRY: ${DS_DIRECTORY_COUNTRY} From 18c9e1bb308f62c1a74cb11eadf3fba0953494aa Mon Sep 17 00:00:00 2001 From: lablans Date: Thu, 15 Aug 2024 11:43:14 +0000 Subject: [PATCH 5/5] Remove DP statement already present in readme. --- bbmri/modules/directory-sync-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bbmri/modules/directory-sync-compose.yml b/bbmri/modules/directory-sync-compose.yml index 215acd4..33a7d31 100644 --- a/bbmri/modules/directory-sync-compose.yml +++ b/bbmri/modules/directory-sync-compose.yml @@ -8,7 +8,6 @@ services: DS_DIRECTORY_USER_NAME: ${DS_DIRECTORY_USER_NAME} DS_DIRECTORY_USER_PASS: ${DS_DIRECTORY_USER_PASS} DS_TIMER_CRON: ${DS_TIMER_CRON:-0 22 * * *} - # It is recommended to check the enabling of this flag with your local data protection group DS_DIRECTORY_ALLOW_STAR_MODEL: ${DS_DIRECTORY_ALLOW_STAR_MODEL:-true} DS_DIRECTORY_MOCK: ${DS_DIRECTORY_MOCK} DS_DIRECTORY_DEFAULT_COLLECTION_ID: ${DS_DIRECTORY_DEFAULT_COLLECTION_ID}