Skip to content

Commit f8ef012

Browse files
committed
Rework composition files
1 parent 75fecad commit f8ef012

File tree

9 files changed

+105
-43
lines changed

9 files changed

+105
-43
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- name: build
15-
run: docker compose -f docker-compose-ci.yml build check
15+
run: docker compose -f docker-compose-dev.yml build check
1616

1717
- name: check
18-
run: docker compose -f docker-compose-ci.yml run --rm check
18+
run: docker compose -f docker-compose-dev.yml run --rm check
1919

2020
- name: test
21-
run: docker compose -f docker-compose-ci.yml run --rm check pytest --cov=maelstro tests/
21+
run: docker compose -f docker-compose-dev.yml run --rm check pytest --cov=maelstro tests/
2222

2323
frontend-check:
2424
runs-on: ubuntu-22.04
@@ -62,7 +62,7 @@ jobs:
6262
- uses: actions/checkout@v4
6363

6464
- name: Build
65-
run: docker compose build maelstro-back maelstro-front
65+
run: docker compose -f docker-compose-dev.yml build maelstro-back maelstro-front
6666

6767
- name: Login to Docker Hub
6868
uses: docker/login-action@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,4 @@ cython_debug/
172172

173173
# Custom for this repo
174174
.envs-database
175+
docker-compose.override.yml

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,42 @@
33
geOrchestra Maelstro is an application which helps synchronise geonetwork and geoserver instances
44

55
## Docker deploy
6+
7+
### Solo quick start (without included geOrchestra composition)
8+
9+
Maelstro can be used outside geOrchestra.
10+
11+
First select the `docker-compose-solo.yml` file as current composition:
12+
13+
```bash
14+
ln -s docker-compose-solo.yml docker-compose.yml
15+
```
16+
17+
The start the compositon:
18+
19+
```bash
20+
docker compose up
21+
```
22+
23+
Open : http://127.0.0.1:8080/maelstro/
24+
There is no authentication to access the page but if needed it can be done with basic auth in the [nginx config](./config/nginx-solo.conf) (or another way)
25+
626
### Quick start with geOrchestra
727

28+
First select the `docker-compose-geOrchestra.yml` file as current composition:
29+
30+
```bash
31+
ln -s docker-compose-geOrchestra.yml docker-compose.yml
32+
```
33+
834
Before starting development you need to setup some geOrchestra configurations.
935

1036
See commands documented here: [georchestra/README.md](georchestra/README.md)
1137

1238
Now you can run the Docker composition:
1339

1440
```bash
15-
docker compose -f docker-compose-geOrchestra.yml up -d
41+
docker compose up -d
1642
```
1743

1844
Then application should be available at:
@@ -25,18 +51,20 @@ With credentials:
2551
- testadmin:testadmin
2652
- tmaelstro:tmaelstro
2753

28-
### Solo quick start
29-
Maelstro can be used outside geOrchestra.
54+
### Development
3055

56+
For development purpose, you may need to use `docker-compose-dev.yml` instead:
57+
58+
```bash
59+
rm -f docker-compose.yml
60+
ln -s docker-compose-dev.yml docker-compose.yml
3161
```
32-
docker compose up
33-
```
34-
Open : http://127.0.0.1:8080/maelstro/
35-
There is no authentication to access the page but if needed it can be done with basic auth in the [nginx config](./config/nginx-solo.conf) (or another way)
3662

37-
### Development
63+
And maybe add overrides for debugging:
3864

39-
If you want to develop, rename the file [docker-compose-dev.yml.override.sample](docker-compose-dev.yml.override.sample) to `docker-compose-dev.yml.override` to apply its configuration and mounts the sources of both apps.
65+
```bash
66+
cp docker-compose.override.sampl.yml docker-compose.override.yml
67+
```
4068

4169
## Kubernetes deploy
4270

@@ -59,6 +87,7 @@ The configuration is based on a YAML file containing connection information abou
5987
For dev use of the platform, there is a sample config in the backend folder: [dev_config.yaml](backend/dev_config.yaml). This config is used by default in the docker compo.
6088

6189
The file has 4 distict parts:
90+
6291
- sources
6392
- destinations
6493
- db_logging
@@ -75,6 +104,7 @@ The file has 4 distict parts:
75104
#### DB logging
76105

77106
The section db_logging contains all connection information to reach a writable postgres DB to use for writing and reading operation logs:
107+
78108
- host (default: database)
79109
- port (default: 5432)
80110
- login (default: georchestra)
@@ -90,13 +120,16 @@ Substitution of credentials (login and password) can be done for the DB configur
90120
The `transformations` section conatains a list of xsl transformations which can be applied to the xml metadata of source or destination servers.
91121

92122
Each named `transformation` item must conatain
123+
93124
- `xslt_path`: local path on the server to an xsl file in which the trasformation is defind (typically in the datadir)
94125
- `description`: Details of the transformation content to easily identify which transformation is applied
95126

96127
For each geonetwork item of the source and destination servers, a specific key is added to the configuration file:
128+
97129
- transformations: list of xslt keys to be applied to the metadata of the corresponding geonetwork server
98130

99131
If a list of transformations is defined for both the source and destination server, the copy operation is executed in the way described below:
132+
100133
- read metadata from source
101134
- apply all source transformations
102135
- apply all destination transformations
@@ -116,7 +149,6 @@ The logics for credentials is by decreasing order of importance:
116149
4. Then constant login/password keys are read
117150
5. If still either "login" or "password" is not defined, the credentials are considered invalid and anonymous acces is used for the instance without authentication
118151

119-
120152
#### Example
121153

122154
(see [doc_sample_config.yaml](backend/tests/doc_sample_config.yaml)):

docker-compose-ci.yml

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

docker-compose-dev.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This composition add minimal development overrides over geOrchestra composition
2+
3+
include:
4+
- georchestra/geor-compose.yml
5+
- georchestra/geor-compose.override.yml
6+
7+
services:
8+
maelstro-front:
9+
extends:
10+
file: docker-compose-geOrchestra.yml
11+
service: maelstro-front
12+
build:
13+
context: ./frontend
14+
15+
maelstro-back:
16+
extends:
17+
file: docker-compose-geOrchestra.yml
18+
service: maelstro-back
19+
build:
20+
context: ./backend
21+
target: server
22+
volumes:
23+
- ./backend:/app
24+
- ./config/:/etc/maelstro/:ro
25+
environment:
26+
MAELSTRO_CONFIG: /app/dev_config.yaml
27+
DEBUG: true
28+
ports:
29+
- 8000:8000 # Used for frontend development
30+
31+
check:
32+
profiles:
33+
- check
34+
build:
35+
context: ./backend
36+
target: check
37+
environment:
38+
MAELSTRO_CONFIG: /app/tests/test_config.yaml
39+
LOCAL_LOGIN: testadmin
40+
LOCAL_PASSWORD: testadmin
41+
volumes:
42+
- ./backend:/app

docker-compose-dev.yml.override.sample

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

docker-compose-geOrchestra.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This is an example of production ready composition for geOrchestra
2+
13
include:
24
- georchestra/geor-compose.yml
35
- georchestra/geor-compose.override.yml
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# This is an example of production ready standalone composition (without included geOrchestra)
12

23
volumes:
3-
postgresql_data:
4+
postgresql_data:
45

56
services:
67
database:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Here are example of some overrides for debugging
2+
3+
services:
4+
malestro-back:
5+
{}
6+
# For debugging with VS Code
7+
# command: >
8+
# python -m debugpy --listen 0.0.0.0:5678
9+
# /usr/local/bin/fastapi dev --host 0.0.0.0 --port 8000 --reload
10+
# maelstro/main.py
11+
# ports:
12+
# - 5678:5678

0 commit comments

Comments
 (0)