Skip to content

Commit 27e79e7

Browse files
Merge branch 'develop' into feature/DOP-21350
2 parents 441d362 + af13e94 commit 27e79e7

File tree

71 files changed

+1597
-188
lines changed

Some content is hidden

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

71 files changed

+1597
-188
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ repos:
4040
- id: chmod
4141
args: ['644']
4242
exclude_types: [shell]
43-
exclude: ^(.*__main__\.py)$
43+
exclude: ^(.*__main__\.py|syncmaster/backend/export_openapi_schema\.py)$
4444
- id: chmod
4545
args: ['755']
4646
types: [shell]
4747
- id: chmod
4848
args: ['755']
49-
files: ^(.*__main__\.py)$
49+
files: ^(.*__main__\.py|syncmaster/backend/export_openapi_schema\.py)$
5050
- id: insert-license
5151
files: .*\.py$
5252
exclude: ^(syncmaster/backend/dependencies/stub.py|docs/.*\.py|tests/.*\.py)$

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ venv: venv-cleanup venv-install##@Env Init venv and install poetry dependencies
2929

3030
venv-cleanup: ##@Env Cleanup venv
3131
@rm -rf .venv || true
32-
python3.12 -m venv .venv
32+
python -m venv .venv
3333
${PIP} install -U setuptools wheel pip
3434
${PIP} install poetry
35+
${PIP} install -U flake8-commas
36+
${PIP} install --no-deps sphinx-plantuml
3537

3638
venv-install: ##@Env Install requirements to venv
3739
${POETRY} config virtualenvs.create false

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ Data.SyncMaster is as low-code ETL tool for transfering data between databases a
3333
List of currently supported connections:
3434

3535
* Apache Hive
36+
* Clickhouse
3637
* Postgres
3738
* Oracle
39+
* MSSQL
40+
* MySQL
3841
* HDFS
3942
* S3
4043

docker-compose.test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ services:
8080
command: --loglevel=info -Q test_queue
8181
entrypoint: [python, -m, celery, -A, tests.test_integration.celery_test, worker, --max-tasks-per-child=1]
8282
env_file: .env.docker
83+
environment:
84+
# CI runs tests in the worker container, so we need to turn off interaction with static files for it
85+
- SYNCMASTER__SERVER__STATIC_FILES__ENABLED=false
8386
volumes:
8487
- ./syncmaster:/app/syncmaster
8588
- ./cached_jars:/root/.ivy2

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ services:
3636
context: .
3737
ports:
3838
- 8000:8000
39+
# PROMETHEUS_MULTIPROC_DIR is required for multiple workers, see:
40+
# https://prometheus.github.io/client_python/multiprocess/
41+
environment:
42+
PROMETHEUS_MULTIPROC_DIR: /tmp/prometheus-metrics
43+
# tmpfs dir is cleaned up each container restart
44+
tmpfs:
45+
- /tmp/prometheus-metrics
3946
env_file: .env.docker
4047
depends_on:
4148
db:

docker/Dockerfile.backend

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ ENTRYPOINT ["/app/entrypoint.sh"]
1919
FROM base AS prod
2020

2121
COPY ./syncmaster/ /app/syncmaster/
22+
# add this when logo will be ready
23+
# COPY ./docs/_static/*.svg ./syncmaster/backend/static/
24+
25+
# Swagger UI
26+
ADD https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui-bundle.js /app/syncmaster/backend/static/swagger/swagger-ui-bundle.js
27+
ADD https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui.css /app/syncmaster/backend/static/swagger/swagger-ui.css
28+
29+
# Redoc
30+
ADD https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js /app/syncmaster/backend/static/redoc/redoc.standalone.js
31+
32+
ENV SYNCMASTER__SERVER__OPENAPI__SWAGGER__JS_URL=/static/swagger/swagger-ui-bundle.js \
33+
SYNCMASTER__SERVER__OPENAPI__SWAGGER__CSS_URL=/static/swagger/swagger-ui.css \
34+
SYNCMASTER__SERVER__OPENAPI__REDOC__JS_URL=/static/redoc/redoc.standalone.js \
35+
SYNCMASTER__SERVER__STATIC_FILES__DIRECTORY=/app/syncmaster/backend/static
2236

2337

2438
FROM base as test

docs/backend/configuration/cors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _backend-configuration-cors:
1+
.. _backend-configuration-server-cors:
22

33
CORS settings
44
=============

docs/backend/configuration/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Configuration
1313
logging
1414
cors
1515
debug
16+
monitoring
17+
static_files
18+
openapi
1619

1720
.. autopydantic_settings:: syncmaster.settings.Settings
1821
.. autopydantic_settings:: syncmaster.settings.server.ServerSettings

docs/backend/configuration/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _configuration-logging:
1+
.. _backend-configuration-logging:
22

33
Logging settings
44
================
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. _backend-configuration-server-monitoring:
2+
3+
Server monitoring
4+
=================
5+
6+
REST API server provides the following endpoints with Prometheus compatible metrics:
7+
8+
* ``GET /monitoring/metrics`` - server metrics, like number of requests per path and response status, CPU and RAM usage, and so on.
9+
10+
.. dropdown:: Example
11+
12+
.. literalinclude:: ../../_static/metrics.prom
13+
14+
These endpoints are enabled and configured using settings below:
15+
16+
.. autopydantic_model:: syncmaster.settings.server.monitoring.MonitoringSettings

0 commit comments

Comments
 (0)