From 23c9d07315b724fc7ff8e69f1fcb4930d9393755 Mon Sep 17 00:00:00 2001 From: Christina Luostarinen Date: Fri, 16 Aug 2024 14:48:53 +0100 Subject: [PATCH 1/4] PLA-1348 Configure database server details in separate env var This is to avoid requiring a new connection string env variable for each database. Database names for existing databases have been made configurable as these may have been modified from their default values in previous onsite installations. --- README.md | 7 ++++--- docker-compose.macromolecule-hub.yml | 8 ++++---- docker-compose.yml | 16 ++++++++-------- sample.env | 16 ++++++++++------ 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7376269..605ea42 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,11 @@ Here is an example of the .env file: ``` CCDC_LICENSING_CONFIGURATION=la-code;123456-123456-123456-123456-123456-123456; -CSD_DB_CONNECTIONSTRING=Server=database-server;Port=5432;Database=csd-database;User Id=postgres;Password=passwordhere -IDENTITY_DB_CONNECTIONSTRING=Server=database-server;Port=5432;Database=csd-identity;User Id=postgres;Password=passwordhere -PLATFORM_PORT=443 +DB_CONNECTIONSTRING=Server=database-server;Port=5432;User Id=postgres;Password=passwordhere +CSD_DATABASE=csd-database +IDENTITY_DATABASE=csd-identity PUBLIC_URI=https://csd-software.local +PLATFORM_PORT=443 ``` Where stated, some of these variables will be provided by CCDC; all other variables are for the user to generate and set. diff --git a/docker-compose.macromolecule-hub.yml b/docker-compose.macromolecule-hub.yml index 11925a1..9facb76 100644 --- a/docker-compose.macromolecule-hub.yml +++ b/docker-compose.macromolecule-hub.yml @@ -15,25 +15,25 @@ services: ccdc-csd-substructuresearch: environment: - - PdbReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=structure_optimisation + - PdbReadConnection=${DB_CONNECTIONSTRING};SearchPath=structure_optimisation;Database=${CSD_DATABASE} - SubstructureSearchDatabaseConfiguration__Databases__1__Name=pdb - SubstructureSearchDatabaseConfiguration__Databases__1__SettingsKey=PdbReadConnection ccdc-csd-deposition: environment: - - DepositionPdbReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=pdb_schema + - DepositionPdbReadConnection=${DB_CONNECTIONSTRING};SearchPath=pdb_schema;Database=${CSD_DATABASE} - DatabaseConfiguration__Databases__1__Name=pdb - DatabaseConfiguration__Databases__1__SettingsKey=DepositionPdbReadConnection ccdc-csd-textnumericsearch: environment: - - PdbReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=pdb_schema + - PdbReadConnection=${DB_CONNECTIONSTRING};SearchPath=pdb_schema;Database=${CSD_DATABASE} - DatabaseConfiguration__Databases__1__Name=pdb - DatabaseConfiguration__Databases__1__SettingsKey=PdbReadConnection ccdc-csd-unitcellsearch: environment: - - UnitCellPdbReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=pdb_cell_optimisation + - UnitCellPdbReadConnection=${DB_CONNECTIONSTRING};SearchPath=pdb_cell_optimisation;Database=${CSD_DATABASE} - DatabaseConfiguration__Databases__1__Name=pdb - DatabaseConfiguration__Databases__1__SettingsKey=UnitCellPdbReadConnection \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5407254..6354026 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,7 @@ services: ccdc-identity: image: ccdcrepository.azurecr.io/onsite/ccdc-identitygateway:4.0.0 environment: - - "ConnectionStrings__DefaultConnection=${IDENTITY_DB_CONNECTIONSTRING}" + - ConnectionStrings__DefaultConnection=${DB_CONNECTIONSTRING};Database=${IDENTITY_DATABASE} - "PlatformClientSettings__RedirectUri=${PUBLIC_URI}/authentication/login-callback" - "PlatformClientSettings__PostLogoutRedirectUri=${PUBLIC_URI}/authentication/logout-callback" - "WebCsdClientSettings__RedirectUri=${PUBLIC_URI}/structures/signin-oidc" @@ -74,7 +74,7 @@ services: - ccdc-csd-fingerprint - ccdc-csd-deposition environment: - - StructureSearchReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=substructure + - StructureSearchReadConnection=${DB_CONNECTIONSTRING};SearchPath=substructure;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-deposition: @@ -82,7 +82,7 @@ services: <<: *k8s-labels image: ccdcrepository.azurecr.io/onsite/ccdc-csd-deposition-api:4.0.0 environment: - - CsdDepositionReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=csd_schema + - CsdDepositionReadConnection=${DB_CONNECTIONSTRING};SearchPath=csd_schema;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-textnumericsearch: @@ -90,7 +90,7 @@ services: <<: *k8s-labels image: ccdcrepository.azurecr.io/onsite/ccdc-csd-textnumericsearch-api:4.0.0 environment: - - CsdReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=csd_schema + - CsdReadConnection=${DB_CONNECTIONSTRING};SearchPath=csd_schema;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-searchservice: @@ -120,7 +120,7 @@ services: <<: *k8s-labels image: ccdcrepository.azurecr.io/onsite/ccdc-csd-formulasearch-api:4.0.0 environment: - - FormulaSearchReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=formula + - FormulaSearchReadConnection=${DB_CONNECTIONSTRING};SearchPath=formula;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-unitcellsearch: @@ -130,7 +130,7 @@ services: - ccdc-csd-reducedcell-calculation-service image: ccdcrepository.azurecr.io/onsite/ccdc-csd-unit-cell-search:4.0.0 environment: - - UnitCellSearchReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=unitcell + - UnitCellSearchReadConnection=${DB_CONNECTIONSTRING};SearchPath=unitcell;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-resultstore: @@ -138,7 +138,7 @@ services: <<: *k8s-labels image: ccdcrepository.azurecr.io/onsite/ccdc-csd-resultstore-api:4.0.0 environment: - - ResultStoreConnectionString=${CSD_DB_CONNECTIONSTRING};SearchPath=searchstore + - ResultStoreConnectionString=${DB_CONNECTIONSTRING};SearchPath=searchstore;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-similaritysearch: @@ -148,7 +148,7 @@ services: - ccdc-csd-fingerprint image: ccdcrepository.azurecr.io/onsite/ccdc-csd-structure-similarity-search:4.0.0 environment: - - StructureSimilaritySearchReadConnection=${CSD_DB_CONNECTIONSTRING};SearchPath=similarity + - StructureSimilaritySearchReadConnection=${DB_CONNECTIONSTRING};SearchPath=similarity;Database=${CSD_DATABASE} restart: unless-stopped ccdc-csd-fingerprint: diff --git a/sample.env b/sample.env index 1d7869a..9657305 100644 --- a/sample.env +++ b/sample.env @@ -3,11 +3,15 @@ # More information can be found in section 14.8 in the release notes for the desktop CSD portfolio CCDC_LICENSING_CONFIGURATION=la-code;123456-123456-123456-123456-123456-123456; -# Password for local database -CSD_DB_CONNECTIONSTRING=Server=database-server;Port=5432;Database=csd-database;User Id=postgres;Password=passwordhere -IDENTITY_DB_CONNECTIONSTRING=Server=database-server;Port=5432;Database=csd-identity;User Id=postgres;Password=passwordhere +# Configure the server, port, user ID, and password to match your Postgres server +DB_CONNECTIONSTRING=Server=database-server;Port=5432;User Id=postgres;Password=passwordhere -#You don't need to change this unless you want to run on a different port -PLATFORM_PORT=443 +#You don't need to change these unless you've modified the default database names +CSD_DATABASE=csd-database +IDENTITY_DATABASE=csd-identity + +# Defines the base URL for the platform +PUBLIC_URI=https://csd-software.local -PUBLIC_URI=https://csd-software.local \ No newline at end of file +#You don't need to change this unless you want to run on a different port +PLATFORM_PORT=443 \ No newline at end of file From 9dc02d654ada33ff749a3cd5b37bc3301182c9a8 Mon Sep 17 00:00:00 2001 From: Thomas Pleasance Date: Mon, 19 Aug 2024 09:43:56 +0100 Subject: [PATCH 2/4] PLA-1543 Update changes for 4.1 --- docker-compose.yml | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6354026..df4fb60 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,25 +28,25 @@ services: restart: unless-stopped ccdc-identity: - image: ccdcrepository.azurecr.io/onsite/ccdc-identitygateway:4.0.0 + image: ccdcrepository.azurecr.io/onsite/ccdc-identitygateway:4.1.0 environment: - ConnectionStrings__DefaultConnection=${DB_CONNECTIONSTRING};Database=${IDENTITY_DATABASE} - - "PlatformClientSettings__RedirectUri=${PUBLIC_URI}/authentication/login-callback" - - "PlatformClientSettings__PostLogoutRedirectUri=${PUBLIC_URI}/authentication/logout-callback" - - "WebCsdClientSettings__RedirectUri=${PUBLIC_URI}/structures/signin-oidc" - - "WebCsdClientSettings__PostLogoutRedirectUri=${PUBLIC_URI}/structures/signout-oidc" + - "PlatformClientSettings__RedirectUris__0=${PUBLIC_URI}/authentication/login-callback" + - "PlatformClientSettings__PostLogoutRedirectUris__0=${PUBLIC_URI}/authentication/logout-callback" + - "WebCsdClientSettings__RedirectUris__0=${PUBLIC_URI}/structures/signin-oidc" + - "WebCsdClientSettings__PostLogoutRedirectUris__0=${PUBLIC_URI}/structures/signout-oidc" depends_on: - webcsdbackend restart: unless-stopped webcsd: environment: - - IdentityGateway__Authority=${PUBLIC_URI} + - IdentityGateway__Issuer=${PUBLIC_URI} - IdentityGateway__DisableSSLValidation=true depends_on: - ccdc-csd-searchservice - csd-request-entry - image: ccdcrepository.azurecr.io/onsite/webcsd:4.0.0 + image: ccdcrepository.azurecr.io/onsite/webcsd:4.1.0 volumes: - ./userdata:/app/OnSite labels: @@ -57,7 +57,7 @@ services: depends_on: - ccdc-csd-searchservice - csd-request-entry - image: ccdcrepository.azurecr.io/onsite/webcsdbackend:4.0.0 + image: ccdcrepository.azurecr.io/onsite/webcsdbackend:4.1.0 environment: - CCDC_LICENSING_CONFIGURATION=${CCDC_LICENSING_CONFIGURATION} labels: @@ -166,7 +166,7 @@ services: ccdc-csd-crystal-structure-export: labels: <<: *k8s-labels - image: ccdcrepository.azurecr.io/onsite/ccdc-csd-crystal-structure-export-service:4.0.0 + image: ccdcrepository.azurecr.io/onsite/ccdc-csd-crystal-structure-export-service:4.1.0 restart: unless-stopped ccdc-csd-reducedcell-calculation-service: @@ -181,4 +181,23 @@ services: image: ccdcrepository.azurecr.io/onsite/csd-theory:4.0.0 environment: - CCDC_LICENSING_CONFIGURATION=${CCDC_LICENSING_CONFIGURATION} - restart: unless-stopped \ No newline at end of file + restart: unless-stopped + + message-broker: + image: rabbitmq:3 + environment: + RABBITMQ_DEFAULT_USER: queueuser + RABBITMQ_DEFAULT_PASS: ${CCDC_LICENSING_CONFIGURATION} + restart: unless-stopped + + ccdc-file-generation: + restart: unless-stopped + image: ccdcrepository.azurecr.io/onsite/ccdc-structure-file-generation:4.1.0 + environment: + - CacheSettings__ConnectionString=${DB_CONNECTIONSTRING};Database=structure_file_cache + - MessagingProvider=RabbitMq + - MessagingOnSitePassword=${CCDC_LICENSING_CONFIGURATION} + - PlatformSecurity__Issuer=${PUBLIC_URI} + - PlatformSecurity__DisableSSLValidation=true + depends_on: + - message-broker From f023288c01b5f6c34dc19610dc5a378a04b46752 Mon Sep 17 00:00:00 2001 From: Thomas Pleasance Date: Tue, 20 Aug 2024 11:57:55 +0100 Subject: [PATCH 3/4] PLA-1543 Update example for CSD Theory config --- docker-compose.sample-csd-theory-db-config.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docker-compose.sample-csd-theory-db-config.yml b/docker-compose.sample-csd-theory-db-config.yml index 951a6ea..06cf812 100644 --- a/docker-compose.sample-csd-theory-db-config.yml +++ b/docker-compose.sample-csd-theory-db-config.yml @@ -12,13 +12,11 @@ services: webcsdbackend: volumes: - - /path/to/database-1:/csd-data/database-1 - - /path/to/database-2:/csd-data/database-2 + - /path/to/CSD-Theory Landscape Database:/csd-data/CSPLandscape.csdsqlx environment: - - ServiceSettings__Databases__2__Name=database-1 - - ServiceSettings__Databases__2__ConnectionString=/csd-data/database-1 - - ServiceSettings__Databases__3__Name=database-2 - - ServiceSettings__Databases__3__ConnectionString=/csd-data/database-2 + - ServiceSettings__Databases__2__Name=CSP Database + - ServiceSettings__Databases__2__ConnectionString=/csd-data/CSPLandscape.csdsqlx + - ServiceSettings__Databases__2__Speciality__0=CSP webcsd: volumes: From 3f7de3e7388fa199142f2a8856892f464a9c1b44 Mon Sep 17 00:00:00 2001 From: Christina Luostarinen Date: Fri, 30 Aug 2024 10:19:17 +0100 Subject: [PATCH 4/4] PLA-1538 Clarify db settings in sample.env --- sample.env | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sample.env b/sample.env index 9657305..d0d4606 100644 --- a/sample.env +++ b/sample.env @@ -6,12 +6,14 @@ CCDC_LICENSING_CONFIGURATION=la-code;123456-123456-123456-123456-123456-123456; # Configure the server, port, user ID, and password to match your Postgres server DB_CONNECTIONSTRING=Server=database-server;Port=5432;User Id=postgres;Password=passwordhere -#You don't need to change these unless you've modified the default database names +# The database the CSD backup has been restored to CSD_DATABASE=csd-database + +# Database for the v4 login system. This will be created at application startup if it doesn't already exist. IDENTITY_DATABASE=csd-identity # Defines the base URL for the platform PUBLIC_URI=https://csd-software.local #You don't need to change this unless you want to run on a different port -PLATFORM_PORT=443 \ No newline at end of file +PLATFORM_PORT=443