Skip to content

Commit 9083521

Browse files
committed
Merge branch 'develop'
2 parents 04cf9f6 + 2695bf6 commit 9083521

File tree

73 files changed

+2125
-2066
lines changed

Some content is hidden

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

73 files changed

+2125
-2066
lines changed

.github/workflows/backend_docker_image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
with:
4949
tags: ${{ env.TAG }}
5050
context: .
51+
target: prod
5152
file: docker/Dockerfile.backend
5253
pull: true
5354
push: true

.github/workflows/hdfs-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ jobs:
2020
- name: Set up Docker Buildx
2121
uses: docker/setup-buildx-action@v3
2222

23-
- name: Free Disk Space (Ubuntu)
24-
uses: jlumbroso/free-disk-space@main
25-
with:
26-
# this might remove tools that are actually needed,
27-
# if set to "true" but frees about 6 GB
28-
tool-cache: false
29-
30-
# all of these default to true, but feel free to set to
31-
# "false" if necessary for your workflow
32-
large-packages: true
33-
docker-images: true
34-
swap-storage: true
35-
3623
- name: Cache jars
3724
uses: actions/cache@v4
3825
with:
@@ -66,6 +53,13 @@ jobs:
6653
run: |
6754
docker compose -f ./docker-compose.test.yml exec -T worker coverage run -m pytest -vvv -s -m "worker and hdfs"
6855
56+
- name: Dump worker logs on failure
57+
if: failure()
58+
uses: jwalton/gh-docker-logs@v2
59+
with:
60+
images: mtsrus/syncmaster-worker
61+
dest: ./logs
62+
6963
- name: Shutdown
7064
if: always()
7165
run: |
@@ -76,3 +70,10 @@ jobs:
7670
with:
7771
name: hdfs-tests
7872
path: reports/*
73+
74+
- name: Upload worker logs
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: hdfs-worker-logs
79+
path: logs/*

.github/workflows/hive-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ jobs:
2020
- name: Set up Docker Buildx
2121
uses: docker/setup-buildx-action@v3
2222

23-
- name: Free Disk Space (Ubuntu)
24-
uses: jlumbroso/free-disk-space@main
25-
with:
26-
# this might remove tools that are actually needed,
27-
# if set to "true" but frees about 6 GB
28-
tool-cache: false
29-
30-
# all of these default to true, but feel free to set to
31-
# "false" if necessary for your workflow
32-
large-packages: true
33-
docker-images: true
34-
swap-storage: true
35-
3623
- name: Cache jars
3724
uses: actions/cache@v4
3825
with:
@@ -66,6 +53,13 @@ jobs:
6653
run: |
6754
docker compose -f ./docker-compose.test.yml exec -T worker coverage run -m pytest -vvv -s -m "worker and hive"
6855
56+
- name: Dump worker logs on failure
57+
if: failure()
58+
uses: jwalton/gh-docker-logs@v2
59+
with:
60+
images: mtsrus/syncmaster-worker
61+
dest: ./logs
62+
6963
- name: Shutdown
7064
if: always()
7165
run: |
@@ -76,3 +70,10 @@ jobs:
7670
with:
7771
name: hive-tests
7872
path: reports/*
73+
74+
- name: Upload worker logs
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: hive-worker-logs
79+
path: logs/*

.github/workflows/oracle-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ jobs:
2020
- name: Set up Docker Buildx
2121
uses: docker/setup-buildx-action@v3
2222

23-
- name: Free Disk Space (Ubuntu)
24-
uses: jlumbroso/free-disk-space@main
25-
with:
26-
# this might remove tools that are actually needed,
27-
# if set to "true" but frees about 6 GB
28-
tool-cache: false
29-
30-
# all of these default to true, but feel free to set to
31-
# "false" if necessary for your workflow
32-
large-packages: true
33-
docker-images: true
34-
swap-storage: true
35-
3623
- name: Cache jars
3724
uses: actions/cache@v4
3825
with:
@@ -66,6 +53,13 @@ jobs:
6653
run: |
6754
docker compose -f ./docker-compose.test.yml exec -T worker coverage run -m pytest -vvv -s -m "worker and oracle"
6855
56+
- name: Dump worker logs on failure
57+
if: failure()
58+
uses: jwalton/gh-docker-logs@v2
59+
with:
60+
images: mtsrus/syncmaster-worker
61+
dest: ./logs
62+
6963
- name: Shutdown
7064
if: always()
7165
run: |
@@ -76,3 +70,10 @@ jobs:
7670
with:
7771
name: oracle-tests
7872
path: reports/*
73+
74+
- name: Upload worker logs
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: oracle-worker-logs
79+
path: logs/*

.github/workflows/s3-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ jobs:
2020
- name: Set up Docker Buildx
2121
uses: docker/setup-buildx-action@v3
2222

23-
- name: Free Disk Space (Ubuntu)
24-
uses: jlumbroso/free-disk-space@main
25-
with:
26-
# this might remove tools that are actually needed,
27-
# if set to "true" but frees about 6 GB
28-
tool-cache: false
29-
30-
# all of these default to true, but feel free to set to
31-
# "false" if necessary for your workflow
32-
large-packages: true
33-
docker-images: true
34-
swap-storage: true
35-
3623
- name: Cache jars
3724
uses: actions/cache@v4
3825
with:
@@ -65,6 +52,13 @@ jobs:
6552
run: |
6653
docker compose -f ./docker-compose.test.yml exec -T worker coverage run -m pytest -vvv -s -m "worker and s3"
6754
55+
- name: Dump worker logs on failure
56+
if: failure()
57+
uses: jwalton/gh-docker-logs@v2
58+
with:
59+
images: mtsrus/syncmaster-worker
60+
dest: ./logs
61+
6862
# This is important, as coverage is exported after receiving SIGTERM
6963
- name: Shutdown
7064
if: always()
@@ -76,3 +70,10 @@ jobs:
7670
with:
7771
name: s3-tests
7872
path: reports/*
73+
74+
- name: Upload worker logs
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: s3-worker-logs
79+
path: logs/*

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
name: Oracle tests
2121
uses: ./.github/workflows/oracle-tests.yml
2222

23+
hdfs_tests:
24+
name: HDFS tests
25+
uses: ./.github/workflows/hdfs-tests.yml
26+
2327
hive_tests:
2428
name: Hive tests
2529
uses: ./.github/workflows/hive-tests.yml

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
- --ignore-init-module-imports
7474

7575
- repo: https://github.com/psf/black-pre-commit-mirror
76-
rev: 24.3.0
76+
rev: 24.4.0
7777
hooks:
7878
- id: black
7979
language_version: python3.11

docker-compose.test.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.8'
22
services:
33
db:
4-
image: postgres:15
4+
image: postgres
55
restart: unless-stopped
66
env_file: .env.docker
77
ports:
@@ -26,6 +26,7 @@ services:
2626
command: --loglevel=info -Q test_queue
2727
env_file: .env.docker
2828
volumes:
29+
- ./syncmaster:/app/syncmaster
2930
- ./cached_jars:/root/.ivy2
3031
- ./reports:/app/reports
3132
- ./tests:/app/tests
@@ -35,14 +36,6 @@ services:
3536
condition: service_healthy
3637
rabbitmq:
3738
condition: service_healthy
38-
test-oracle:
39-
condition: service_started # Oracle image does not have healthcheck
40-
test-postgres:
41-
condition: service_healthy
42-
test-hive:
43-
condition: service_healthy
44-
test-s3:
45-
condition: service_healthy
4639

4740
backend:
4841
image: mtsrus/syncmaster-backend::${BACKEND_IMAGE_TAG:-test}
@@ -56,6 +49,7 @@ services:
5649
ports:
5750
- 8000:8000
5851
volumes:
52+
- ./syncmaster:/app/syncmaster
5953
- ./cached_jars:/root/.ivy2
6054
- ./reports:/app/reports
6155
- ./tests:/app/tests
@@ -96,7 +90,7 @@ services:
9690
retries: 3
9791

9892
test-postgres:
99-
image: postgres:15
93+
image: postgres
10094
restart: unless-stopped
10195
ports:
10296
- 5433:5432
@@ -121,7 +115,7 @@ services:
121115
APP_USER_PASSWORD: test_password
122116

123117
metastore-hive:
124-
image: postgres:15
118+
image: postgres
125119
restart: unless-stopped
126120
environment:
127121
POSTGRES_DB: metastore

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.8'
22
services:
33
db:
4-
image: postgres:15
4+
image: postgres
55
restart: unless-stopped
66
env_file: .env.docker
77
ports:
@@ -16,7 +16,7 @@ services:
1616
retries: 3
1717

1818
worker:
19-
image: syncmaster_worker
19+
image: mtsrus/syncmaster-worker
2020
restart: unless-stopped
2121
build:
2222
dockerfile: docker/Dockerfile.worker
@@ -25,7 +25,7 @@ services:
2525
env_file: .env.docker
2626

2727
backend:
28-
image: syncmaster_back
28+
image: mtsrus/syncmaster-backend
2929
restart: unless-stopped
3030
build:
3131
dockerfile: docker/Dockerfile.backend

docker/Dockerfile.backend

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG BASE_IMAGE=python:3.11-slim
2-
FROM $BASE_IMAGE AS prod
2+
FROM $BASE_IMAGE AS base
33

44
RUN apt-get update && apt-get install -y \
55
libssl-dev \
@@ -14,20 +14,23 @@ RUN pip install --no-cache-dir --timeout 3 --retries 3 poetry \
1414
&& poetry config virtualenvs.create false
1515

1616
WORKDIR /app
17+
ENV PYTHONPATH=/app
1718

1819
COPY ./pyproject.toml ./poetry.lock* /app/
1920

2021
RUN pip install --upgrade pip setuptools wheel packaging
21-
RUN poetry install --no-root --extras "backend"
22-
23-
COPY ./syncmaster/ /app/syncmaster/
24-
ENV PYTHONPATH=/app
22+
RUN poetry install --no-root --extras "backend" --without test,docs,dev
2523

2624
COPY ./docker/entrypoint_backend.sh /app/entrypoint.sh
2725
ENTRYPOINT ["/app/entrypoint.sh"]
2826

2927

30-
FROM prod as test
28+
FROM base AS prod
29+
30+
COPY ./syncmaster/ /app/syncmaster/
31+
32+
33+
FROM base as test
3134

32-
RUN poetry install --no-root --extras "backend" --with test
35+
RUN poetry install --no-root --extras "backend" --with test --without docs,dev
3336
RUN sed -i 's/python -m/coverage run -m/g' /app/entrypoint.sh

0 commit comments

Comments
 (0)