Skip to content

Commit 2428d4a

Browse files
committed
[DOP-25282] Sync documentation structure with Data.Rentgen
1 parent 16a2347 commit 2428d4a

Some content is hidden

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

54 files changed

+550
-273
lines changed

docs/index.rst

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,15 @@
1111

1212
.. toctree::
1313
:maxdepth: 2
14-
:caption: Server
14+
:caption: Reference
1515
:hidden:
1616

17-
server/install
18-
server/architecture
19-
server/auth/index
20-
server/configuration/index
21-
server/openapi
22-
23-
24-
.. toctree::
25-
:maxdepth: 2
26-
:caption: Worker
27-
:hidden:
28-
29-
worker/install
30-
worker/log_url
31-
worker/configuration/index
32-
33-
34-
.. toctree::
35-
:maxdepth: 2
36-
:caption: Scheduler
37-
:hidden:
38-
39-
scheduler/install
40-
scheduler/configuration/index
17+
reference/architecture
18+
reference/database/index
19+
reference/broker/index
20+
reference/server/index
21+
reference/worker/index
22+
reference/scheduler/index
4123

4224
.. toctree::
4325
:maxdepth: 2

docs/reference/architecture.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _architecture:
2+
3+
Architecture
4+
============
5+
6+
Components
7+
----------
8+
9+
SyncMaster contains the following components:
10+
11+
* :ref:`frontend`, main user interface.
12+
* :ref:`server`, providing REST API for fetching and manipulating entities.
13+
* :ref:`worker`, performing actual transfer work (ETL processes).
14+
* :ref:`scheduler`, scheduling transfers to be executed in future.
15+
* :ref:`database` for storing internal data.
16+
* :ref:`message-broker` for communications between Server/Scheduler and Worker.
17+
18+
Architecture diagram
19+
--------------------
20+
21+
.. image:: ../_static/architecture.png

docs/reference/broker/index.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _message-broker:
2+
3+
Message Broker
4+
==============
5+
6+
Message broker is componen used by :ref:`server`/:ref:`scheduler` to communicate with :ref:`worker`.
7+
8+
SyncMaster can work virtually with any broker supported by `Celery <https://docs.celeryq.dev>`_.
9+
But the only broker we tested is `RabbitMQ <https://www.rabbitmq.com/>`_.
10+
11+
Requirements
12+
------------
13+
14+
* RabbitMQ 4.x. It is recommended to use latest RabbitMQ version.
15+
16+
Setup
17+
~~~~~
18+
19+
With Docker
20+
^^^^^^^^^^^
21+
22+
* Install `Docker <https://docs.docker.com/engine/install/>`_
23+
* Install `docker-compose <https://github.com/docker/compose/releases/>`_
24+
* Run the following command:
25+
26+
.. code:: console
27+
28+
$ docker compose --profile broker up -d --wait
29+
30+
``docker-compose`` will download RabbitMQ image, create container and volume, and then start container.
31+
Image entrypoint will create database if volume is empty.
32+
33+
Options can be set via ``.env`` file or ``environment`` section in ``docker-compose.yml``
34+
35+
.. dropdown:: ``docker-compose.yml``
36+
37+
.. literalinclude:: ../../../docker-compose.yml
38+
:emphasize-lines: 33-45,144
39+
40+
.. dropdown:: ``.env.docker``
41+
42+
.. literalinclude:: ../../../.env.docker
43+
:emphasize-lines: 15-16
44+
45+
Without Docker
46+
^^^^^^^^^^^^^^
47+
48+
Please follow `RabbitMQ installation instruction <https://www.rabbitmq.com/docs/download>`_.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _configuration-database:
2+
3+
Database settings
4+
=================
5+
6+
.. autopydantic_model:: syncmaster.settings.DatabaseSettings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _configuration-credentials-encryption:
2+
3+
Credentials encryption
4+
======================
5+
6+
.. autopydantic_model:: syncmaster.settings.credentials.CredentialsEncryptionSettings

docs/reference/database/index.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
.. _database:
2+
3+
Relation Database
4+
=================
5+
6+
SyncMaster requires relational database for storing internal data.
7+
8+
Currently, SyncMaster supports only `PostgreSQL <https://www.postgresql.org/>`_ as storage for lineage entities and relations.
9+
10+
Migrations
11+
------------
12+
13+
After a database is started, it is required to run migration script.
14+
For empty database, it creates all the required tables and indexes.
15+
For non-empty database, it will perform database structure upgrade, using `Alembic <https://alembic.sqlalchemy.org/>`_.
16+
17+
.. warning::
18+
19+
Other containers (server, scheduler, worker) should be stopped while running migrations, to prevent interference.
20+
21+
Requirements
22+
------------
23+
24+
* PostgreSQL 12 or higher. It is recommended to use latest Postgres version.
25+
26+
Install & run
27+
-------------
28+
29+
With Docker
30+
~~~~~~~~~~~
31+
32+
* Install `Docker <https://docs.docker.com/engine/install/>`_
33+
* Install `docker-compose <https://github.com/docker/compose/releases/>`_
34+
35+
* Run the following command:
36+
37+
.. code:: console
38+
39+
$ docker compose up -d db db-migrations
40+
41+
``docker-compose`` will download PostgreSQL image, create container and volume, and then start container.
42+
Image entrypoint will create database if volume is empty.
43+
44+
After that, one-off container with migrations script will run.
45+
46+
Options can be set via ``.env`` file or ``environment`` section in ``docker-compose.yml``
47+
48+
.. dropdown:: ``docker-compose.yml``
49+
50+
.. literalinclude:: ../../../docker-compose.yml
51+
:emphasize-lines: 1-31,142
52+
53+
.. dropdown:: ``.env.docker``
54+
55+
.. literalinclude:: ../../../.env.docker
56+
:emphasize-lines: 8-9
57+
58+
Without Docker
59+
~~~~~~~~~~~~~~
60+
61+
* For installing PostgreSQL, please follow `installation instruction <https://www.postgresql.org/download/>`_.
62+
* Install Python 3.11 or above
63+
* Create virtual environment
64+
65+
.. code-block:: console
66+
67+
$ python -m venv /some/.venv
68+
$ source /some/.venv/activate
69+
70+
* Install ``syncmaster`` package with following *extra* dependencies:
71+
72+
.. code-block:: console
73+
74+
$ pip install syncmaster[postgres]
75+
76+
* Configure :ref:`Database connection <configuration-database>` using environment variables, e.g. by creating ``.env`` file:
77+
78+
.. code-block:: console
79+
:caption: /some/.env
80+
81+
$ export SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@db:5432/syncmaster
82+
83+
And then read values from this file:
84+
85+
.. code:: console
86+
87+
$ source /some/.env
88+
89+
* Run migrations:
90+
91+
.. code:: console
92+
93+
$ python -m syncmaster.db.migrations upgrade head
94+
95+
This is a thin wrapper around `alembic cli <https://alembic.sqlalchemy.org/en/latest/tutorial.html#running-our-first-migration>`_,
96+
options and commands are just the same.
97+
98+
.. note::
99+
100+
This command should be executed after each upgrade to new Data.Rentgen version.
101+
102+
See also
103+
--------
104+
105+
.. toctree::
106+
:maxdepth: 1
107+
108+
configuration
109+
credentials_encryption
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)