Skip to content

Commit 694fa7b

Browse files
committed
MMH-124 Merge branch 'main' into MMH-124_MMHub_In_House_Dbs
2 parents c61a7fd + 4e6a547 commit 694fa7b

File tree

1 file changed

+140
-89
lines changed

1 file changed

+140
-89
lines changed

README.md

+140-89
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
# On-Site Lattice and WebCSD
22

3+
## Introduction
4+
35
On-Site Lattice and WebCSD is currently only available to CCDC industrial customers and other invited groups.
46

57
This readme contains information required for installation and updates of On-Site Lattice and WebCSD.
68

7-
Please use the latest version from the release tab <https://github.com/ccdc-opensource/on-site-webcsd/releases>.
8-
9-
Terms and conditions can be found in the license.md file.
9+
Terms and conditions can be found in the `license.md` file.
1010

1111
Additional information including user configuration and troubleshooting can be found in the wiki at <https://github.com/ccdc-opensource/on-site-webcsd/wiki>.
1212

13-
## Prerequisites
14-
15-
A standard [Docker Server](https://docs.docker.com/engine/install/#server) and [Docker Compose](https://docs.docker.com/compose/install/) installation is required for installation.
16-
We recommend installing the latest version of Docker from these links.
17-
This will run on [Docker Desktop](https://docs.docker.com/engine/install/#desktop), however this is not recommended and may [require a license](https://www.docker.com/legal/docker-subscription-service-agreement/).
18-
19-
Access to the CCDC container registry will require a username and password, to get them please contact CCDC Support.
20-
21-
For version 4.0 onwards, a postgres server is required for CSD and Identity databases. The postgres CSD database will be provided via a download link, to get it, please contact CCDC Support.
22-
Once you have the download link please follow the instructions at [Setting Up Your PostgreSQL Server](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Setting-up-your-PostgreSQL-server) to restore
23-
the database into your environment.
24-
25-
A valid license key will be required to use the software.
13+
## Prerequisites and Setup
2614

27-
A download of the desired [release](https://github.com/ccdc-opensource/on-site-webcsd/releases).
28-
Click on the release you want to use, and download the source code zip and unpack.
15+
### System Requirements
2916

30-
## Initial recommended specification
17+
For version 4.0 onwards, a postgres server is required for CSD and Identity databases.
18+
This will typically be installed on a separate machine from the one hosting the WebCSD
19+
Docker containers.
3120

32-
Recommended requirements for postgres server without Macromolecule Hub:
21+
Recommended requirements for postgres server without Macromolecule Hub (PDB protein data):
3322

3423
- Postgres version 14 or newer
3524
- 100GB free hd space
@@ -39,7 +28,7 @@ Recommended requirements for postgres server including Macromolecule Hub:
3928
- Postgres version 14 or newer
4029
- 200GB free hd space
4130

42-
Recommended requirements for On-Site Lattice and WebCSD containers:
31+
Recommended requirements for Docker server hosting On-Site Lattice and WebCSD containers:
4332

4433
- 30GB free hd space, 16GB RAM, 8 core CPU.
4534

@@ -50,61 +39,65 @@ Note that these match the 2024.2 Desktop release.
5039
- Rocky Linux 8 and 9
5140
- Ubuntu LTS 22 and 24
5241

53-
## In-house Database Configuration
42+
### Authentication
5443

55-
:warning: **OnSite WebCSD assumes structure identifiers are unique across all registered in-house databases.
56-
You will likely encounter unexpected behaviour if this is not the case.**
57-
58-
On-Site Lattice and WebCSD can be configured to read from in-house databases.
44+
- A valid CCDC activation key will be required to use the software.
45+
- Access to the CCDC docker container registry will require a username and password, to get them please contact CCDC Support.
46+
- The postgres CSD database will be provided via a download link. To obtain this, please contact CCDC Support
47+
and specify whether you want the database with or without Macromolecule Hub.
5948

60-
Provided within the installation are sample databases which can be found in the sample-data folder in the root of the installation.
49+
### Docker Installation
6150

62-
To enable these databases follow:
51+
A standard [Docker Server](https://docs.docker.com/engine/install/#server) and [Docker Compose](https://docs.docker.com/compose/install/) installation is required for installation of WebCSD.
52+
We recommend installing the latest version of Docker from these links.
53+
WebCSD will run on [Docker Desktop](https://docs.docker.com/engine/install/#desktop), however this is not recommended and may [require a license](https://www.docker.com/legal/docker-subscription-service-agreement/).
6354

64-
1. Copy and rename the file `docker-compose.sample-On-Site-only-db-config.yml` to `docker-compose.db-config.yml`
65-
2. Edit the `volumes` section of that file to point to any in-house databases and edit the `environment` section to configure the application to recognise these databases.
55+
CHECK: Test your Docker installation as described at the above links. Also verify that you can log into the CCDC
56+
container registry.
6657

67-
More information is given in the notes & example sections of the sample file. This acts as an [override file](https://docs.docker.com/compose/extends/) which you will have to include in the startup command.
58+
```sh
59+
docker login -u <user> -p <password> ccdcrepository.azurecr.io
6860

69-
### In-house Protein Database Creation and Configuration
61+
# or to be prompted for the password
62+
docker login -u <user> --password-stdin ccdcrepository.azurecr.io
63+
```
7064

71-
If you have a Macromolecule Hub licence, you can also create and register in-house protein databases for use within OnSite WebCSD.
65+
### PostgreSQL Server Installation
7266

73-
To create an In-house Protein Database, you will need the Python Utilities. These can be downloaded from the [CCDC Downloads page](https://www.ccdc.cam.ac.uk/support-and-resources/csdsdownloads/)
74-
under `CSD Python API > Python CSD Python API Utilities`. If you do not see the CSD Python API listed in the available downloads, you may need to sign in.
75-
The relevant script can be found under `ccdc > utitities > create_protein_database`.
76-
You can run the script using the CSD Python API version 3.3.0 or later.
67+
Once you have downloaded the postgres CSD database, please follow the instructions at
68+
[Setting Up Your PostgreSQL Server](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Setting-up-your-PostgreSQL-server) to restore
69+
the database into your environment.
7770

78-
Once you have created your protein database, you can register it by adding to your `docker-compose.db-config.yml` file following the instructions above.
79-
You must then mark the database as a protein database. Your database config should look something like this:
71+
CHECK: Can you connect to the database from Docker containers? These commands should run without errors.
8072

81-
```yml
82-
volumes:
83-
- /path/to/ExampleProteinDb.csdsqlx:/csd-data/ExampleProteinDb.csdsqlx
84-
environment:
85-
- ServiceSettings__Databases__2__Name=Example Protein DB
86-
- ServiceSettings__Databases__2__ConnectionString=/csd-data/ExampleProteinDb.csdsqlx
87-
- ServiceSettings__Databases__2__Speciality__0=Protein
73+
```sh
74+
# Pull postgres image
75+
docker pull postgres:14.13
76+
# Run container
77+
docker run --name debug-postgres -e POSTGRES_PASSWORD=passwordhere -d postgres:14.13
78+
# Shell into container
79+
docker exec -it debug-postgres sh
80+
# Attempt to establish a connection to the database server
81+
psql -h database.server.name -p 5432 -U postgres -d csd_database
8882
```
8983

90-
## CSD-Theory Web Database Configuration
84+
## Basic Configuration And Installation
9185

92-
Instructions on setting up CSD-Theory Web can be found in the [wiki](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Setting-up-CSD%E2%80%90Theory-Web)
93-
94-
## SSL Configuration
86+
### SSL Configuration
9587

9688
Connecting to your WebCSD server via https is now required.
9789
To configure this you will need an SSL certificate and private key.
9890
Ask your local IT staff to set these up for you.
9991

100-
Please follow the instructions at [Configuring SSL](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Configuring-SSL) to configure SSL.
101-
92+
Please follow the instructions at [Configuring SSL](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Configuring-SSL).
10293
If the WebCSD server is run without configuring SSL a built-in self-signed certificate will be used.
10394
This is not recommended as it is insecure.
10495

105-
## Installation
96+
### WebCSD Basic Installation
10697

107-
After unpacking the release source code onto the server on which the software will be installed you will need to go into the on-site-webcsd directory and copy the environment file `sample.env` as `.env`.
98+
Please download and unpack the latest version from the release tab <https://github.com/ccdc-opensource/on-site-webcsd/releases>.
99+
100+
After unpacking the release source code onto the server on which the software will be installed you will need to go into the on-site-webcsd directory and copy the environment file `sample.env` to `.env`.
108101
Then open the `.env` file and populate with suitable values.
109102

110103
```console
@@ -114,15 +107,15 @@ cp sample.env .env
114107

115108
You will need to update the `.env` file with your licence key, your database server details and
116109
the URL you will use for your WebCSD server.
117-
Here is an example of the `.env` file:
110+
Here is an example of the `.env` file with comments removed:
118111

119112
```console
120113
CCDC_LICENSING_CONFIGURATION=la-code;123456-123456-123456-123456-123456-123456;
121114
DB_CONNECTIONSTRING=Server=database-server;Port=5432;User Id=postgres;Password=passwordhere
122-
CSD_DATABASE=csd-database
123-
IDENTITY_DATABASE=csd-identity
124115
PUBLIC_URI=https://csd-software.local
125116
PLATFORM_PORT=443
117+
CSD_DATABASE=csd-database
118+
IDENTITY_DATABASE=csd-identity
126119
```
127120

128121
Where stated, some of these variables will be provided by CCDC; all other variables are for the user to generate and set.
@@ -142,28 +135,104 @@ sudo adduser ccdc --uid=1397
142135
sudo usermod -u 1397 ccdc
143136

144137
# You will also need to ensure the user "ccdc" has read access to any in-house or CSP databases.
145-
# E.g. if these are in the userdata directory:
146-
sudo chown -R ccdc:ccdc userdata/
138+
# E.g. if these are in the csd-data directory:
139+
sudo chown -R ccdc:ccdc csd-data/
147140

148-
# Use one of the following commands
141+
# For testing use one of the following commands.
142+
# These do not load in-house databases and the user access control is disabled.
143+
# These features will be configured later.
149144

150-
#Use this command if you have no in-house databases and don't want to use macromolecule hub
151-
docker compose -f docker-compose.yml -f docker-compose.ssl.yml up -d
145+
# If you are not using Macromolecule Hub
146+
docker compose -f docker-compose.yml -f docker-compose.ssl.yml -f docker-compose.disable-user-access.yml up -d
152147

153-
#Use this command if you have in-house databases and don't want to use macromolecule hub
154-
docker compose -f docker-compose.yml -f docker-compose.db-config.yml -f docker-compose.ssl.yml up -d
148+
# If you are using Macromolecule Hub
149+
docker compose -f docker-compose.yml -f docker-compose.ssl.yml -f docker-compose.disable-user-access.yml -f docker-compose.macromolecule-hub.yml up -d
150+
```
155151

156-
#Use this command if you have in-house databases and want macromolecule hub
157-
docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f docker-compose.db-config.yml -f docker-compose.ssl.yml up -d
152+
CHECK: To check that the install has completed and that all the services are running, run:
158153

159-
#Use this command if you have no in-house databases and want macromolecule hub
160-
docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f docker-compose.ssl.yml up -d
154+
```sh
155+
docker compose ps
161156
```
162157

158+
which should show the state of the services to all be `Up`. If any services have the state `Up (unhealthy)` or `Exit` then restart the stack (`docker compose down` then repeat
159+
the `docker compose ... up -d` command run earlier). If the issues persist then please contact CCDC Support.
160+
161+
For more information see the [Docker volumes documentation](https://docs.docker.com/compose/compose-file/#volumes).
162+
163+
To access the On-Site Lattice and WebCSD service locally go to <https://full.server.hostname> in a browser,
164+
replacing `full.server.hostname` by the full hostname of your Docker host. Check that you can search the CSD.
165+
If you have problems check that `PUBLIC_URI` has been set to <https://full.server.hostname> in `.env`.
166+
167+
## Further Configuration
168+
169+
Your On-Site WebCSD server is now up and running but you will probably need to configure user access control
170+
and in-house databases. This is done via docker compose files
171+
(see [WebCSD Configuration Files](https://github.com/ccdc-opensource/on-site-webcsd/wiki/WebCSD-configuration-files) in the wiki).
172+
After making any changes to these files, restart the stack as described above, adding any docker compose files
173+
which you have customised into the `docker compose ... up -d` command.
174+
175+
### User Access Control
176+
177+
User access control can be managed via local accounts or Single Sign-On (SSO).
178+
Unless it is explicitly disabled via `docker-compose.disable-user-access.yml`, you must configure roles to allow
179+
access to in-house databases.
180+
181+
For details please see [Access Control To In-House Databases](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Access-control-to-in-house-databases).
182+
183+
### In-house Database Configuration
184+
185+
:warning: **OnSite WebCSD assumes structure identifiers are unique across all registered in-house databases.
186+
You will likely encounter unexpected behaviour if this is not the case.**
187+
188+
On-Site Lattice and WebCSD can be configured to read from in-house databases.
189+
190+
Provided within the installation is a sample database `teaching-subset.csdsql` which can be found in the `sample-data` folder in the root of the installation.
191+
192+
To enable in-house databases:
193+
194+
1. Copy and rename the file `docker-compose.sample-On-Site-only-db-config.yml` to `docker-compose.db-config.yml`
195+
2. Edit the `volumes` section of that file to point to any in-house databases and edit the `environment` section to configure the application to recognise these databases.
196+
197+
More information is given in the notes & example sections of the sample file. This acts as an [override file](https://docs.docker.com/compose/extends/) which you will have to include in the startup command.
198+
199+
### In-house Protein Database Creation and Configuration
200+
201+
If you have a Macromolecule Hub licence, you can also create and register in-house protein databases for use within OnSite WebCSD.
202+
203+
To create an In-house Protein Database, you will need the Python Utilities. These can be downloaded from the [CCDC Downloads page](https://www.ccdc.cam.ac.uk/support-and-resources/csdsdownloads/)
204+
under `CSD Python API > Python CSD Python API Utilities`. If you do not see the CSD Python API listed in the available downloads, you may need to sign in.
205+
The relevant script can be found under `ccdc > utitities > create_protein_database`.
206+
You can run the script using the CSD Python API version 3.3.0 or later.
207+
208+
Once you have created your protein database, you can register it by adding to your `docker-compose.db-config.yml` file following the instructions above.
209+
You must then mark the database as a protein database. Your database config should look something like this:
210+
211+
```yml
212+
volumes:
213+
- /path/to/ExampleProteinDb.csdsqlx:/csd-data/ExampleProteinDb.csdsqlx
214+
environment:
215+
- ServiceSettings__Databases__2__Name=Example Protein DB
216+
- ServiceSettings__Databases__2__ConnectionString=/csd-data/ExampleProteinDb.csdsqlx
217+
- ServiceSettings__Databases__2__Speciality__0=Protein
218+
```
219+
220+
### CSD-Theory Web Database Configuration
221+
222+
Instructions on setting up CSD-Theory Web can be found in the [wiki](https://github.com/ccdc-opensource/on-site-webcsd/wiki/Setting-up-CSD%E2%80%90Theory-Web).
223+
224+
Provided within the installation is a sample CSD-Theory landscape database `CSPLandscape.csdsqlx` which can be found in the `sample-data` folder in the root of the installation,
225+
along with a blank `CSPDatabase.db` CSD-Theory metadata database.
226+
227+
### Other customisations
228+
229+
For other optional customisations to your WebCSD server please see [WebCSD Configuration and Customisation](https://github.com/ccdc-opensource/on-site-webcsd/wiki/WebCSD-Configuration-&-Customisation).
230+
163231
## Updates
164232

165-
When you have been notified when there is an update available you can download the newest release from the github repository.
166-
Once you have downloaded the new release, ensure the default old files have been removed and any custom configuration files have been moved to the new release directory.
233+
When you have been notified that there is an update available you can [download the newest release](https://github.com/ccdc-opensource/on-site-webcsd/releases) from the github repository.
234+
Once you have downloaded the new release, ensure any customisations have been copied to the new release directory.
235+
You may need to customise the new versions of the config files (particularly `.env`) rather than copying the old versions - check the website above for breaking changes.
167236

168237
Once the latest installation files have been obtained, to update the software, pull the latest images, and restart the stack.
169238
The latest images can be pulled whilst the stack is running and changes will only come into effect upon restarting the stack.
@@ -187,24 +256,6 @@ docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f
187256
docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f docker-compose.ssl.yml up -d
188257
```
189258

190-
## Verifying the Installation/Update
191-
192-
To check that the install or update has completed and that all the services are running, run:
193-
194-
```sh
195-
docker compose ps
196-
```
197-
198-
which should show the state of the services to all be `Up`. If any services have the state `Up (unhealthy)` or `Exit` then restart the stack. If the issues persist then please contact CCDC Support.
199-
200-
For more information see the [Docker volumes documentation](https://docs.docker.com/compose/compose-file/#volumes).
201-
202-
## Usage
203-
204-
To access the On-Site Lattice and WebCSD service locally go to <https://full.server.hostname> in a browser,
205-
replacing `full.server.hostname` by the full hostname of your Docker host. `PUBLIC_URI` should also be set to this
206-
URL in `.env` for authentication to work correctly.
207-
208-
## Contact support
259+
## Contacting support
209260

210261
If you experience any difficulties with installing or using On-Site Lattice and WebCSD, please contact our support team at <support@ccdc.cam.ac.uk> who will be happy to assist you.

0 commit comments

Comments
 (0)