Skip to content

Commit e5440a5

Browse files
author
maxim-lixakov
committed
[DOP-19933] - update worker, scheduler, keycloak documentation
1 parent 950fb35 commit e5440a5

29 files changed

+452
-156
lines changed

.env.docker

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ ENV=LOCAL
55
SYNCMASTER__SERVER__DEBUG=true
66
SYNCMASTER__SERVER__LOG_URL_TEMPLATE=https://grafana.example.com?correlation_id={{ correlation_id }}&run_id={{ run.id }}
77

8+
# Session
9+
SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key
10+
11+
# Postgres
12+
SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@db:5432/syncmaster
13+
14+
# RabbitMQ
15+
SYNCMASTER__BROKER__URL=amqp://guest:guest@rabbitmq:5672/
16+
817
# Logging
918
SYNCMASTER__LOGGING__SETUP=True
1019
SYNCMASTER__LOGGING__PRESET=colored
@@ -15,13 +24,6 @@ SYNCMASTER__ENCRYPTION__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
1524
# Scheduler settings
1625
SYNCMASTER__SCHEDULER__TRANSFER_FETCHING_TIMEOUT_SECONDS=200
1726

18-
# Session
19-
SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key
20-
21-
# Postgres
22-
SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@db:5432/syncmaster
23-
24-
# TODO: add to KeycloakAuthProvider documentation about creating new realms, add users, etc.
2527
# KEYCLOAK Auth
2628
SYNCMASTER__AUTH__KEYCLOAK__SERVER_URL=http://keycloak:8080
2729
SYNCMASTER__AUTH__KEYCLOAK__REALM_NAME=manually_created
@@ -36,9 +38,6 @@ SYNCMASTER__AUTH__PROVIDER=syncmaster.backend.providers.auth.keycloak_provider.K
3638
SYNCMASTER__AUTH__PROVIDER=syncmaster.backend.providers.auth.dummy_provider.DummyAuthProvider
3739
SYNCMASTER__AUTH__ACCESS_TOKEN__SECRET_KEY=secret
3840

39-
# RabbitMQ
40-
SYNCMASTER__BROKER__URL=amqp://guest:guest@rabbitmq:5672/
41-
4241
# S3
4342
MINIO_ACCESS_KEY=syncmaster
4443
MINIO_SECRET_KEY=changeme

.env.local

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ export ENV=LOCAL
33

44
# Server Settngs
55
export SYNCMASTER__SERVER__DEBUG=true
6-
export SYNCMASTER__SERVER__LOG_URL_TEMPLATE="https://grafana.example.com?correlation_id={{ correlation_id }}&run_id={{ run.id }}"
6+
export SYNCMASTER__SERVER__LOG_URL_TEMPLATE=https://grafana.example.com?correlation_id={{ correlation_id }}&run_id={{ run.id }}
7+
8+
# Session
9+
export SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key
10+
11+
# Postgres
12+
export SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@db:5432/syncmaster
13+
14+
# RabbitMQ
15+
export SYNCMASTER__BROKER__URL=amqp://guest:guest@rabbitmq:5672/
716

817
# Logging
918
export SYNCMASTER__LOGGING__SETUP=True
1019
export SYNCMASTER__LOGGING__PRESET=colored
1120

12-
# Scheduler settings
13-
export SYNCMASTER__SCHEDULER__TRANSFER_FETCHING_TIMEOUT_SECONDS=200
14-
15-
# Session
16-
export SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key
17-
1821
# Encrypt / Decrypt credentials data
1922
export SYNCMASTER__ENCRYPTION__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
2023

21-
# Postgres
22-
export SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@localhost:5432/syncmaster
24+
# Scheduler settings
25+
export SYNCMASTER__SCHEDULER__TRANSFER_FETCHING_TIMEOUT_SECONDS=200
2326

2427
# Keycloack Auth
2528
export SYNCMASTER__AUTH__KEYCLOAK__SERVER_URL=http://keycloak:8080

docker-compose.test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ services:
5353
profiles: [backend, all]
5454

5555
scheduler:
56-
image: mtsrus/syncmaster-backend:${BACKEND_IMAGE_TAG:-test}
56+
image: mtsrus/syncmaster-scheduler:${SCHEDULER_IMAGE_TAG:-test}
5757
restart: unless-stopped
5858
build:
59-
dockerfile: docker/Dockerfile.backend
59+
dockerfile: docker/Dockerfile.scheduler
6060
context: .
6161
target: test
6262
env_file: .env.docker
6363
volumes:
6464
- ./syncmaster:/app/syncmaster
65+
- ./tests:/app/tests
66+
- ./reports:/app/reports
6567
- ./pyproject.toml:/app/pyproject.toml
6668
depends_on:
6769
db:

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ services:
6565
rabbitmq:
6666
condition: service_healthy
6767

68+
scheduler:
69+
image: mtsrus/syncmaster-scheduler:${TAG:-develop}
70+
restart: unless-stopped
71+
build:
72+
dockerfile: docker/Dockerfile.scheduler
73+
context: .
74+
env_file: .env.docker
75+
volumes:
76+
- ./syncmaster:/app/syncmaster
77+
- ./pyproject.toml:/app/pyproject.toml
78+
depends_on:
79+
db:
80+
condition: service_healthy
81+
rabbitmq:
82+
condition: service_healthy
83+
entrypoint: [python, -m, syncmaster.scheduler]
84+
6885
volumes:
6986
postgres_data:
7087
rabbitmq_data:

docker/Dockerfile.backend

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
ARG BASE_IMAGE=python:3.12-slim
22
FROM $BASE_IMAGE AS base
33

4-
RUN pip install --no-cache-dir --timeout 3 --retries 3 poetry \
4+
RUN apt-get update && apt-get install -y curl \
5+
&& rm -rf /var/lib/apt/lists/*
6+
7+
RUN curl -sSL https://install.python-poetry.org | python3 - \
8+
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry \
59
&& poetry config virtualenvs.create false
610

711
WORKDIR /app

docker/Dockerfile.scheduler

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.12-slim AS base
2+
3+
RUN apt-get update && apt-get install -y curl \
4+
&& rm -rf /var/lib/apt/lists/*
5+
6+
RUN curl -sSL https://install.python-poetry.org | python3 - \
7+
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry \
8+
&& poetry config virtualenvs.create false
9+
10+
WORKDIR /app
11+
ENV PYTHONPATH=/app
12+
13+
COPY ./pyproject.toml ./poetry.lock* /app/
14+
15+
RUN pip install --upgrade pip setuptools wheel packaging
16+
RUN poetry install --no-root --extras "scheduler" --without test,docs,dev
17+
18+
FROM base AS prod
19+
20+
COPY ./syncmaster/ /app/syncmaster/
21+
22+
FROM base as test
23+
24+
RUN poetry install --no-root --all-extras --with test --without docs,dev

docker/Dockerfile.worker

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ RUN apt-get update && apt-get install -y \
1717
libffi-dev \
1818
&& rm -rf /var/lib/apt/lists/*
1919

20-
RUN pip install --no-cache-dir --timeout 3 --retries 3 poetry && poetry config virtualenvs.create false
20+
RUN apt-get update && apt-get install -y curl \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
RUN curl -sSL https://install.python-poetry.org | python3 - \
24+
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry \
25+
&& poetry config virtualenvs.create false
2126

2227
WORKDIR /app
2328
ENV PYTHONPATH=/app

docs/_static/architecture.png

-30.3 KB
Loading

docs/backend/auth/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Syncmaster supports different auth provider implementations. You can change impl
1212
:caption: Auth providers
1313

1414
dummy
15-
keycloak
15+
keycloak/index
1616

1717
.. toctree::
1818
:maxdepth: 2
127 KB
Loading

0 commit comments

Comments
 (0)