Skip to content

Commit 89fc06c

Browse files
authored
Move service specific containers to relative dir (#157)
* Move service specific containers to relative dir * Fix references after file renaming
1 parent bdf02cc commit 89fc06c

30 files changed

+32
-23
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SciCat with docker compose.
1717

1818
By running `docker compose up -d` these steps take place:
1919
1. a [mongodb](./services/mongodb/) container is created with some initial data.
20-
2. the SciCat [backend v4](./services/backendv4/) container is created and connected to (1).
20+
2. the SciCat [backend v4](./services/backend/v4/) container is created and connected to (1).
2121
3. the SciCat [frontend](./services/frontend/) container is created and connected to (2).
2222
4. a reverse [proxy](./services/proxy) container is created and routes traffic to (2) and (3) through localhost subdomains, in the form: `http://${service}.localhost`. The frontend is available at simply `http://localhost`.
2323

@@ -38,7 +38,7 @@ They are used when adding new services or grouping services together (and do not
3838
| Type | Env key | Value: Service/Feature | Default | Backend Compatibility | Description | Other impacted services |
3939
|---------|--------------------|---------------------------------------------------------------------------------|---------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
4040
| profile | `COMPOSE_PROFILES` | <li>`analysis`: jupyter<li>`search`: searchapi<li>`'*'`: jupyter,searchapi</li> | `''` | * | <li>analysis: enables additional jupyter notebook with python SciCat SDK installed and example notebooks<li>search: enables a SciCat interface for standardised search | |
41-
| env | `BE_VERSION` | <li>`v3`: backendv3<li>`v4`: backendv4 | `v4` | as set | Sets the be version to use in (2) of [default setup](#default-setup) to v3 | mongodb,frontend |
41+
| env | `BE_VERSION` | <li>`v3`: backend/v3<li>`v4`: backend/v4 | `v4` | as set | Sets the be version to use in (2) of [default setup](#default-setup) to v3 | mongodb,frontend |
4242
| env | `JOBS_ENABLED` | `true`: rabbitmq,archivemock,jobs feature | `''` | v3 | Creates a rabbitmq message broker which the be posts to and the archivemock listens to. It emulates the data long-term archive/retrieve workflow | |
4343
| env | `ELASTIC_ENABLED` | `true`: elastic,elastic feature | `''` | v4 | Creates an elastic search service and sets the be to use it for full-text searches | |
4444

@@ -108,12 +108,12 @@ Make sure to check the [backend compatibility](#docker-compose-profiles-and-env-
108108

109109
## Add a new service
110110

111-
To add a new service (see the [backend v4](./services/backendv4/) for an extensive example):
111+
To add a new service (see the [backend v4](./services/backend/v4/) for an extensive example):
112112
1. create a dedicated folder in the [services](./services/) one
113113
2. name it as the service
114114
3. create the `compose.yaml` file with the required dependencies (if any)
115-
4. eventually, include any service in (3) which is specific to the service and not shared across the global setup
116-
5. eventually, add additional configurable logic (e.g. [BE_VERSION dependency](./services/frontend/compose.yaml#L14) and [JOBS_ENABLED dependency](./services/backendv3/compose.yaml))
115+
4. eventually, include any service in (2) and (3) which is specific to the service and not shared across the global setup
116+
5. eventually, add additional configurable logic (e.g. [BE_VERSION dependency](./services/frontend/compose.yaml#L14) and [JOBS_ENABLED dependency](./services/backend/v3/compose.yaml))
117117
6. eventually, add the platform field, as described [here](#supported-os-architectures)
118118
7. eventually, create a `config` folder if it requires configuration
119119
8. eventually, add a `README.md` file in the service

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
include:
33
- ./services/mongodb/compose.yaml
4-
- ./services/backend${BE_VERSION:-v4}/compose.yaml
4+
- ./services/backend/compose.yaml
55
- ./services/frontend/compose.yaml
66
- ./services/searchapi/compose.yaml
77
- ./services/proxy/compose.yaml

services/backend/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Backend service
2+
3+
The SciCat backend HTTP service.
4+
5+
## Dependency on `BE_VERSION`
6+
7+
The `BE_VERSION` value controls which version of the backend should be started, either [v3](./services/v3) or [v4](./services/v4) (default).

services/backend/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- ./services/${BE_VERSION:-v4}/compose.yaml
File renamed without changes.

services/backendv3/compose.jobs.yaml renamed to services/backend/services/v3/compose.jobs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include:
2-
- ../rabbitmq/compose.yaml
3-
- ../archivemock/compose.yaml
2+
- ./services/rabbitmq/compose.yaml
3+
- ./services/archivemock/compose.yaml
44

55
services:
66
backend:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include:
2+
- path:
3+
- ./compose.base.yaml
4+
- ../../..${JOBS_ENABLED:+/backend/services/v3}/compose${JOBS_ENABLED:+.jobs}.yaml

services/archivemock/README.md renamed to services/backend/services/v3/services/archivemock/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ The Archive Mock simulates the interactions of an archival mock with SciCat.
44

55
## Service Requirements
66
- [RabbitMQ](../rabbitmq/)
7-
- [backend v3](../backendv3/) (configured to use the RabbitMQ instance above for jobs)
7+
- [backend v3](../backend/v3/) (configured to use the RabbitMQ instance above for jobs)
88

99
## [Config](./config/.env) - Environment Variables
1010

1111
The container uses [environment variables](https://github.com/SwissOpenEM/ScicatArchiveMock?tab=readme-ov-file#utility-scripts) for configuration.
1212

1313
## Default configuraiton
1414

15-
By default, it is configured to connect to the [backend v3](../backendv3/) container with the `admin` account, and to the [RabbitMQ](../rabbitmq/) container with the `guest` account. It will then handle all archival and retrieval jobs posted to RabbitMQ, and update the corresponding Datasets accordingly in Scicat.
15+
By default, it is configured to connect to the [backend v3](../backend/v3/) container with the `admin` account, and to the [RabbitMQ](../rabbitmq/) container with the `guest` account. It will then handle all archival and retrieval jobs posted to RabbitMQ, and update the corresponding Datasets accordingly in Scicat.
File renamed without changes.

services/backendv4/compose.elastic.yaml renamed to services/backend/services/v4/compose.elastic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include:
2-
- ../elastic/compose.yaml
2+
- ./services/elastic/compose.yaml
33

44
services:
55
backend:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include:
2+
- path:
3+
- ./compose.base.yaml
4+
- ../../..${ELASTIC_ENABLED:+/backend/services/v4}/compose${ELASTIC_ENABLED:+.elastic}.yaml

services/backendv3/compose.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

services/backendv4/compose.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

services/frontend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For an extensive list of available options see [here](https://scicatproject.gith
1212

1313
## Default configuration
1414

15-
In the default configuration [config](./config/), the frontend is set to call the `backend service` available at `backend.localhost` (either [v4](../backendv4/), by default, or [v3](../backendv3/) if specified otherwise by setting `BE_VERSION`).
15+
In the default configuration [config](./config/), the frontend is set to call the `backend service` available at `backend.localhost` (either [v4](../backend/v4/), by default, or [v3](../backend/v3/) if specified otherwise by setting `BE_VERSION`).
1616

1717
For an explanation of how setting `BE_VERSION` changes the environment creation see [here](../../README.md#docker-compose-profiles-and-env-variables-configuration-options).
1818

services/mongodb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ These files are ingested into the database using mongo funcionalities and bypass
1414

1515
## Default configuration
1616

17-
In the default configuration [init.js](./config/init.js), the seeding creates data in the mongodb database used by the `backend` service (either [v4](../backendv4/), by default, or [v3](../backendv3/) if specified otherwise by setting `BE_VERSION`).
17+
In the default configuration [init.js](./config/init.js), the seeding creates data in the mongodb database used by the `backend` service (either [v4](../backend/v4/), by default, or [v3](../backend/v3/) if specified otherwise by setting `BE_VERSION`).
1818

1919
For an explanation of how setting `BE_VERSION` changes the environment creation see [here](../../README.md#docker-compose-profiles-and-env-variables-configuration-options).
2020

2121
## Dependency on `BE_VERSION`
2222

23-
Since [v3](../backendv3/) and [v4](../backendv4/) connect to two different DBs, the [BE_VERSION](./compose.yaml#L9) environment variable controls [which DB](./config/init.js#L1) should be seeded (`dacat` for [v3](../backendv3/) and `dacat-next` for [v4](../backendv4/)).
23+
Since [v3](../backend/v3/) and [v4](../backend/v4/) connect to two different DBs, the [BE_VERSION](./compose.yaml#L9) environment variable controls [which DB](./config/init.js#L1) should be seeded (`dacat` for [v3](../backend/v3/) and `dacat-next` for [v4](../backend/v4/)).

services/searchapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ The searchapi configuration is set by the [.env file](./config/.env). For an ext
88

99
## Default configuration
1010

11-
In the default configuration [.env file](./config/.env), the searchapi is set to call the `backend service` available at `backend.localhost` (either [v4](../backendv4/), by default, or [v3](../backendv3/) if specified otherwise by setting `BE_VERSION`).
11+
In the default configuration [.env file](./config/.env), the searchapi is set to call the `backend service` available at `backend.localhost` (either [v4](../backend/v4/), by default, or [v3](../backend/v3/) if specified otherwise by setting `BE_VERSION`).
1212

1313
For an explanation of how setting `BE_VERSION` changes the environment creation see [here](../../README.md#docker-compose-profiles-and-env-variables-configuration-options).

0 commit comments

Comments
 (0)