Skip to content

Commit 4e6a547

Browse files
authored
Merge pull request #78 from ccdc-opensource/step_by_step_docs
Step by step docs
2 parents d4f991a + ddc5f61 commit 4e6a547

File tree

1 file changed

+121
-70
lines changed

1 file changed

+121
-70
lines changed

README.md

+121-70
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.
13+
## Prerequisites and Setup
2014

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.
26-
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,37 +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-
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.
48+
49+
### Docker Installation
5650

57-
Provided within the installation are sample databases which can be found in the sample-data folder in the root of the installation.
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/).
5854

59-
To enable these databases follow:
55+
CHECK: Test your Docker installation as described at the above links. Also verify that you can log into the CCDC
56+
container registry.
6057

61-
1. Copy and rename the file `docker-compose.sample-On-Site-only-db-config.yml` to `docker-compose.db-config.yml`
62-
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.
58+
```sh
59+
docker login -u <user> -p <password> ccdcrepository.azurecr.io
6360

64-
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.
61+
# or to be prompted for the password
62+
docker login -u <user> --password-stdin ccdcrepository.azurecr.io
63+
```
64+
65+
### PostgreSQL Server Installation
6566

66-
## CSD-Theory Web Database Configuration
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.
70+
71+
CHECK: Can you connect to the database from Docker containers? These commands should run without errors.
72+
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
82+
```
6783

68-
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)
84+
## Basic Configuration And Installation
6985

70-
## SSL Configuration
86+
### SSL Configuration
7187

7288
Connecting to your WebCSD server via https is now required.
7389
To configure this you will need an SSL certificate and private key.
7490
Ask your local IT staff to set these up for you.
7591

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

81-
## Installation
96+
### WebCSD Basic Installation
97+
98+
Please download and unpack the latest version from the release tab <https://github.com/ccdc-opensource/on-site-webcsd/releases>.
8299

83-
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`.
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`.
84101
Then open the `.env` file and populate with suitable values.
85102

86103
```console
@@ -90,15 +107,15 @@ cp sample.env .env
90107

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

95112
```console
96113
CCDC_LICENSING_CONFIGURATION=la-code;123456-123456-123456-123456-123456-123456;
97114
DB_CONNECTIONSTRING=Server=database-server;Port=5432;User Id=postgres;Password=passwordhere
98-
CSD_DATABASE=csd-database
99-
IDENTITY_DATABASE=csd-identity
100115
PUBLIC_URI=https://csd-software.local
101116
PLATFORM_PORT=443
117+
CSD_DATABASE=csd-database
118+
IDENTITY_DATABASE=csd-identity
102119
```
103120

104121
Where stated, some of these variables will be provided by CCDC; all other variables are for the user to generate and set.
@@ -118,28 +135,80 @@ sudo adduser ccdc --uid=1397
118135
sudo usermod -u 1397 ccdc
119136

120137
# You will also need to ensure the user "ccdc" has read access to any in-house or CSP databases.
121-
# E.g. if these are in the userdata directory:
122-
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/
123140

124-
# 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.
125144

126-
#Use this command if you have no in-house databases and don't want to use macromolecule hub
127-
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
128147

129-
#Use this command if you have in-house databases and don't want to use macromolecule hub
130-
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+
```
131151

132-
#Use this command if you have in-house databases and want macromolecule hub
133-
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:
134153

135-
#Use this command if you have no in-house databases and want macromolecule hub
136-
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
137156
```
138157

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+
On-Site Lattice and WebCSD can be configured to read from in-house databases.
186+
187+
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.
188+
189+
To enable in-house databases:
190+
191+
1. Copy and rename the file `docker-compose.sample-On-Site-only-db-config.yml` to `docker-compose.db-config.yml`
192+
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.
193+
194+
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.
195+
196+
### CSD-Theory Web Database Configuration
197+
198+
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).
199+
200+
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,
201+
along with a blank `CSPDatabase.db` CSD-Theory metadata database.
202+
203+
### Other customisations
204+
205+
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).
206+
139207
## Updates
140208

141-
When you have been notified when there is an update available you can download the newest release from the github repository.
142-
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.
209+
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.
210+
Once you have downloaded the new release, ensure any customisations have been copied to the new release directory.
211+
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.
143212

144213
Once the latest installation files have been obtained, to update the software, pull the latest images, and restart the stack.
145214
The latest images can be pulled whilst the stack is running and changes will only come into effect upon restarting the stack.
@@ -163,24 +232,6 @@ docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f
163232
docker compose -f docker-compose.yml -f docker-compose.macromolecule-hub.yml -f docker-compose.ssl.yml up -d
164233
```
165234

166-
## Verifying the Installation/Update
167-
168-
To check that the install or update has completed and that all the services are running, run:
169-
170-
```sh
171-
docker compose ps
172-
```
173-
174-
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.
175-
176-
For more information see the [Docker volumes documentation](https://docs.docker.com/compose/compose-file/#volumes).
177-
178-
## Usage
179-
180-
To access the On-Site Lattice and WebCSD service locally go to <https://full.server.hostname> in a browser,
181-
replacing `full.server.hostname` by the full hostname of your Docker host. `PUBLIC_URI` should also be set to this
182-
URL in `.env` for authentication to work correctly.
183-
184-
## Contact support
235+
## Contacting support
185236

186237
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)