Skip to content

Commit 84ddd7b

Browse files
committed
[DOP-29496] Load settings from config.yml
1 parent 7918c19 commit 84ddd7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2038
-1668
lines changed

.env.docker

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

.env.local

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

.github/workflows/release.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
5555
- name: Generate OpenAPI Schema
5656
run: |
57-
source .env.local
5857
poetry run python -m syncmaster.server.scripts.export_openapi_schema docs/_static/openapi.json
5958
6059
- name: Fix logo in Readme

.github/workflows/unit-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
6666
- name: Run Unit Tests
6767
run: |
68-
source .env.local
6968
source .env.local.test
7069
poetry run coverage run -m pytest -vvv -s -k "test_unit or test_database"
7170

CONTRIBUTING.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Then start development server:
101101
102102
And open http://localhost:8000/docs
103103

104-
Settings are stored in ``.env.local`` file.
104+
Settings are stored in ``config.yml`` file.
105105

106106
To start development worker, open a new terminal window/tab, and run:
107107

@@ -181,6 +181,7 @@ To run specific integration tests:
181181
make test-integration-hdfs
182182
183183
This starts database, broker & worker containers, and also HDFS container. Then it runs only HDFS-related integration tests.
184+
DB/filesystem addresses and credentials are stored in ``.env.local`` file.
184185

185186
To run full test suite:
186187

@@ -219,7 +220,7 @@ And then start all necessary services:
219220
220221
Then open http://localhost:8000/docs
221222

222-
Settings are stored in ``.env.docker`` file.
223+
Settings are stored in ``config.yml`` file.
223224

224225
Build documentation
225226
~~~~~~~~~~~~~~~~~~~

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!make
22

3-
include .env.local
43
include .env.local.test
54

65
VERSION = develop

config.docker.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
database:
2+
url: postgresql+asyncpg://syncmaster:changeme@db:5432/syncmaster
3+
4+
broker:
5+
url: amqp://guest:guest@broker:5672
6+
7+
encryption:
8+
# Encrypt / Decrypt credentials data using this Fernet key.
9+
# !!! GENERATE YOUR OWN COPY FOR PRODUCTION USAGE !!!
10+
secret_key: UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
11+
12+
13+
auth:
14+
# Dummy Auth
15+
provider: syncmaster.server.providers.auth.dummy_provider.DummyAuthProvider
16+
access_token:
17+
secret_key: generate_another_random_string
18+
19+
# Keycloak Auth
20+
# provider: syncmaster.server.providers.auth.keycloak_provider.KeycloakAuthProvider
21+
# server_url: http://keycloak:8080
22+
# realm_name: manually_created
23+
# client_id: manually_created
24+
# client_secret: generated_by_keycloak
25+
# redirect_uri: http://localhost:3000/auth/callback
26+
# scope: email
27+
# verify_ssl: False
28+
29+
30+
ui:
31+
api_browser_url: http://localhost:8000
32+
auth_provider: dummyAuth
33+
# auth_provider: keycloakAuth
34+
35+
36+
server:
37+
debug: true # !!! NEVER USE ON PRODUCTION !!!
38+
39+
session:
40+
secret_key: generate_some_random_string
41+
max_age: 86400
42+
43+
cors:
44+
enabled: true
45+
46+
allow_origins: [http://localhost:3000]
47+
allow_credentials: true
48+
allow_methods: ['*']
49+
allow_headers: ['*']
50+
expose_headers: [X-Request-ID, Location, Access-Control-Allow-Credentials]
51+
52+
53+
54+
scheduler:
55+
transfer_fetching_timeout_seconds: 200
56+
57+
58+
worker:
59+
log_url_template: https://logs.location.example.com/syncmaster-worker?correlation_id={{ correlation_id }}&run_id={{ run.id }}
60+
61+
62+
hwm_store:
63+
enabled: true
64+
type: horizon
65+
url: http://horizon:8020
66+
namespace: syncmaster_namespace
67+
user: admin
68+
password: 123UsedForTestOnly@!

config.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
database:
2+
url: postgresql+asyncpg://syncmaster:changeme@localhost:5432/syncmaster
3+
4+
broker:
5+
url: amqp://guest:guest@localhost:5672
6+
7+
encryption:
8+
# Encrypt / Decrypt credentials data using this Fernet key.
9+
# !!! GENERATE YOUR OWN COPY FOR PRODUCTION USAGE !!!
10+
secret_key: UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
11+
12+
13+
auth:
14+
# Dummy Auth
15+
provider: syncmaster.server.providers.auth.dummy_provider.DummyAuthProvider
16+
access_token:
17+
secret_key: generate_another_random_string
18+
19+
# Keycloak Auth
20+
# provider: syncmaster.server.providers.auth.keycloak_provider.KeycloakAuthProvider
21+
# server_url: http://localhost:8080
22+
# realm_name: manually_created
23+
# client_id: manually_created
24+
# client_secret: generated_by_keycloak
25+
# redirect_uri: http://localhost:3000/auth/callback
26+
# scope: email
27+
# verify_ssl: False
28+
29+
30+
ui:
31+
api_browser_url: http://localhost:8000
32+
auth_provider: dummyAuth
33+
# auth_provider: keycloakAuth
34+
35+
36+
server:
37+
debug: true # !!! NEVER USE ON PRODUCTION !!!
38+
39+
session:
40+
secret_key: generate_some_random_string
41+
max_age: 86400
42+
43+
cors:
44+
enabled: true
45+
allow_origins: [http://localhost:3000]
46+
allow_credentials: true
47+
allow_methods: ['*']
48+
allow_headers: ['*']
49+
expose_headers: [X-Request-ID, Location, Access-Control-Allow-Credentials]
50+
51+
52+
53+
scheduler:
54+
transfer_fetching_timeout_seconds: 200
55+
56+
57+
worker:
58+
log_url_template: https://logs.location.example.com/syncmaster-worker?correlation_id={{ correlation_id }}&run_id={{ run.id }}
59+
60+
61+
hwm_store:
62+
enabled: true
63+
type: horizon
64+
url: http://localhost:8020
65+
namespace: syncmaster_namespace
66+
user: admin
67+
password: 123UsedForTestOnly@!
68+
69+
70+
superusers:
71+
- admin

docker-compose.test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ services:
4242
context: .
4343
target: test
4444
volumes:
45+
- ./config.docker.yml:/app/config.yml
4546
- ./syncmaster:/app/syncmaster
4647
- ./tests:/app/tests
4748
entrypoint: [python, -m, syncmaster.db.migrations, upgrade, head]
48-
env_file: .env.docker
4949
depends_on:
5050
db:
5151
condition: service_healthy
@@ -57,10 +57,10 @@ services:
5757
dockerfile: docker/Dockerfile.server
5858
context: .
5959
target: test
60-
env_file: .env.docker
6160
ports:
6261
- 8000:8000
6362
volumes:
63+
- ./config.docker.yml:/app/config.yml
6464
- ./syncmaster:/app/syncmaster
6565
- ./docs/_static:/app/docs/_static
6666
- ./reports:/app/reports
@@ -82,8 +82,8 @@ services:
8282
dockerfile: docker/Dockerfile.scheduler
8383
context: .
8484
target: test
85-
env_file: .env.docker
8685
volumes:
86+
- ./config.docker.yml:/app/config.yml
8787
- ./syncmaster:/app/syncmaster
8888
- ./tests:/app/tests
8989
- ./reports:/app/reports
@@ -106,13 +106,12 @@ services:
106106
target: test
107107
command: --loglevel=info -Q 123-test_queue
108108
entrypoint: [coverage, run, -m, celery, -A, tests.test_integration.celery_test, worker, --max-tasks-per-child=1]
109-
env_file:
110-
- .env.docker
111-
- .env.docker.test
109+
env_file: .env.docker.test
112110
environment:
113111
# CI runs tests in the worker container, so we need to turn off interaction with static files for it
114112
- SYNCMASTER__SERVER__STATIC_FILES__ENABLED=false
115113
volumes:
114+
- ./config.docker.yml:/app/config.yml
116115
- ./syncmaster:/app/syncmaster
117116
- ./reports:/app/reports
118117
- ./tests:/app/tests

0 commit comments

Comments
 (0)