You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 5, 2022. It is now read-only.
OpenCDMS server uses Python FastAPI to expose a web interface for `opencdms-app` and other supported CDMSs.
4
4
@@ -13,68 +13,63 @@ The root directory has two main directories:
13
13
-`src` : Contains all the applications/CDMS wrappers
14
14
-`tests` : Contains all the tests
15
15
16
-
Apart from these two directories we also have a docker-compose file contianing:
16
+
Apart from these two directories we also have three docker-compose files:
17
17
18
-
-`auth-db` service which is used for authentication
19
-
-`climsoft-db` service which should be used for storing Climsoft CDMS data
20
-
-`surface-db` service which should be used for storing Surface CDMS data
21
-
-`opencdms-server` is the application we are developing
18
+
-`docker-compose.yml` For development
19
+
-`docker-compose.prod.yml` For production deployment (contains traefik config for https)
20
+
-`docker-compose.test.yml` For testing
22
21
23
-
There is also a `Dockerfile` where we have defined the docker image for `opencdms-server` service
22
+
These docker-compose files have all the necessary services to run `opencdms-api`
23
+
24
+
There is also a `dockerfile` where we have defined the docker image for `opencdms-api` service
24
25
25
26
*Project root*
26
27
```
27
28
.
29
+
├── create_mch_english_basic_tables.sql
30
+
├── docker-compose.prod.yml
31
+
├── docker-compose.test.yml
28
32
├── docker-compose.yml
29
-
├── Dockerfile
30
-
├── LICENSE
33
+
├── dockerfile
34
+
├── entrypoint.sh
35
+
├── init_climsoft_db.py
36
+
├── makefile
37
+
├── mch.dbn
38
+
├── mch.dockerfile
39
+
├── MCHtablasycampos.def
40
+
├── poetry.lock
41
+
├── pyproject.toml
31
42
├── README.md
43
+
├── requirements-old.txt
32
44
├── requirements.txt
45
+
├── scripts
46
+
│ └── load_initial_surface_data.sh
33
47
├── src
34
-
│ ├── apps
35
-
│ ├── db
36
-
│ ├── main.py
37
-
│ └── utils
38
-
└── tests
39
-
├── app-name
40
-
├── ...other apps...
41
-
├── conftest.py
42
-
└── datagen
43
-
44
-
```
48
+
│ └── opencdms_api
49
+
│ ├── config.py
50
+
│ ├── db.py
51
+
│ ├── deps.py
52
+
│ ├── __init__.py
53
+
│ ├── main.py
54
+
│ ├── middelware.py
55
+
│ ├── models.py
56
+
│ ├── router.py
57
+
│ ├── schema.py
58
+
│ └── templates
59
+
├── tests
60
+
│ ├── conftest.py
61
+
│ ├── __init__.py
62
+
│ └── test_router.py
63
+
└── traefik
64
+
└── traefik.toml
45
65
46
-
In the app specific directory, the file structure is like below
47
-
48
-
*App root*
49
-
50
-
```
51
-
.
52
-
├── controllers
53
-
├── db
54
-
├── schemas
55
-
└── services
56
66
57
67
```
58
68
59
-
Controllers directory holds all the routes that we define. Routes are meant to handle application logic, i.e. authorization, data validation etc.
60
-
61
-
DB directory contains the DB configuration for respective app
62
-
63
-
Schemas directory contains all the DTOs defined as Pydantic Model
64
-
65
-
Services directory contains the business logic
66
-
67
69
### Running Development Server
68
70
69
71
The easiest way to go is running `docker-compose up -d --build`
70
72
71
-
The MCH database cannot be populated automatically. To populate the MCH database, do the following:
72
-
73
-
```bash
74
-
$ docker exec -it mchdb bash
75
-
$ mysql -u root -p mch < /scripts/create_mch_english_basic_tables.sql
76
-
```
77
-
78
73
Also, you can do the following:
79
74
80
75
```bash
@@ -92,26 +87,6 @@ Note: You have to run database instance separately. Go to this repository for de
92
87
93
88
Each master release should pass all the To check if the tests are as expected or to add new feature or to fix some issue, you can run the tests on your own.
94
89
95
-
Follow these steps:
96
-
97
-
```bash
98
-
$ pip3 install virtualenv
99
-
$ virtualenv venv
100
-
$ source venv/bin/activate
101
-
$ pip install -r requirements.txt
102
-
$ docker-compose down -v
103
-
$ docker-compose up -d --build
104
-
$ pytest tests/integration
105
-
```
106
-
107
-
Additionally, you can run snapshot We have collected a subset of data from production climsoft instance and we will run query on them to check if we are getting expected result.
108
-
109
-
- From outside your project, run `git clone https://github.com/opencdms/opencdms-test-data`
0 commit comments