Skip to content

Commit d570433

Browse files
Merge pull request #30 from MobileTeleSystems/develop
Release 0.1.1
2 parents 5728243 + 1ab1d45 commit d570433

File tree

301 files changed

+27517
-0
lines changed

Some content is hidden

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

301 files changed

+27517
-0
lines changed

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
__pycache__/
2+
*.py[cod]
3+
*.envx
4+
*.cover
5+
.coverage
6+
.coverage.*
7+
.cache
8+
*.log
9+
.git
10+
.mypy_cache
11+
.pytest_cache
12+
.idea
13+
.vscode
14+
.venv/
15+
venv/
16+
cached_jars/

.env.docker

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
TZ=UTC
2+
3+
# Postgres
4+
POSTGRES_HOST=db
5+
POSTGRES_PORT=5432
6+
POSTGRES_DB=syncmaster
7+
POSTGRES_USER=user
8+
POSTGRES_PASSWORD=secret
9+
10+
# RabbitMQ
11+
RABBITMQ_HOST=rabbitmq
12+
RABBITMQ_PORT=5672
13+
RABBITMQ_USER=guest
14+
RABBITMQ_PASSWORD=guest
15+
16+
# HDFS
17+
HDFS_HOST=test-hive
18+
HDFS_WEBHDFS_PORT=9870
19+
HDFS_IPC_PORT=9820
20+
21+
# S3
22+
MINIO_ACCESS_KEY=syncmaster
23+
MINIO_ROOT_USER=syncmaster
24+
MINIO_SECRET_KEY=a2b6ad842d16f47beaa077b0e50c217a3bded54c
25+
MINIO_ROOT_PASSWORD=a2b6ad842d16f47beaa077b0e50c217a3bded54c
26+
27+
TEST_S3_HOST=test-s3
28+
TEST_S3_PORT=9000
29+
TEST_S3_ACCESS_KEY=syncmaster
30+
TEST_S3_SECRET_KEY=a2b6ad842d16f47beaa077b0e50c217a3bded54c
31+
TEST_S3_BUCKET=syncmaster
32+
33+
TEST_POSTGRES_HOST=test-postgres
34+
TEST_POSTGRES_PORT=5432
35+
TEST_POSTGRES_USER=user
36+
TEST_POSTGRES_PASSWORD=secret
37+
TEST_POSTGRES_DB=syncmaster
38+
39+
TEST_ORACLE_HOST=test-oracle
40+
TEST_ORACLE_PORT=1521
41+
TEST_ORACLE_USER=test_user
42+
TEST_ORACLE_PASSWORD=test_password
43+
TEST_ORACLE_SERVICE_NAME=XEPDB1
44+
45+
TEST_HIVE_CLUSTER=test-hive
46+
TEST_HIVE_USER=hive_user
47+
TEST_HIVE_PASSWORD=hive_password
48+
49+
ENV=LOCAL
50+
51+
SPARK_CONF_DIR=/app/tests/spark/hive/conf/
52+
HADOOP_CONF_DIR=/app/tests/spark/hadoop/
53+
HIVE_CONF_DIR=/app/tests/spark/hive/conf/

.env.local

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
export TZ=UTC
2+
3+
# Postgres
4+
export POSTGRES_HOST=localhost
5+
export POSTGRES_PORT=5432
6+
export POSTGRES_DB=syncmaster
7+
export POSTGRES_USER=user
8+
export POSTGRES_PASSWORD=secret
9+
10+
# RabbitMQ
11+
export RABBITMQ_HOST=localhost
12+
export RABBITMQ_PORT=5672
13+
export RABBITMQ_USER=guest
14+
export RABBITMQ_PASSWORD=guest
15+
16+
# HDFS
17+
export HDFS_HOST=localhost
18+
export HDFS_WEBHDFS_PORT=9870
19+
export HDFS_IPC_PORT=9820
20+
21+
# S3
22+
export MINIO_ACCESS_KEY=syncmaster
23+
export MINIO_ROOT_USER=syncmaster
24+
export MINIO_SECRET_KEY=a2b6ad842d16f47beaa077b0e50c217a3bded54c
25+
export MINIO_ROOT_PASSWORD=a2b6ad842d16f47beaa077b0e50c217a3bded54c
26+
27+
export TEST_S3_HOST=localhost
28+
export TEST_S3_PORT=9010
29+
export TEST_S3_ACCESS_KEY=syncmaster
30+
export TEST_S3_SECRET_KEY=a2b6ad842d16f47beaa077b0e50c217a3bded54c
31+
export TEST_S3_BUCKET=syncmaster
32+
33+
export TEST_POSTGRES_HOST=localhost
34+
export TEST_POSTGRES_PORT=5433
35+
export TEST_POSTGRES_USER=user
36+
export TEST_POSTGRES_PASSWORD=secret
37+
export TEST_POSTGRES_DB=syncmaster
38+
39+
export TEST_ORACLE_HOST=localhost
40+
export TEST_ORACLE_PORT=1522
41+
export TEST_ORACLE_USER=test_user
42+
export TEST_ORACLE_PASSWORD=test_password
43+
export TEST_ORACLE_SERVICE_NAME=XEPDB1
44+
45+
export TEST_HIVE_CLUSTER=test-hive
46+
export TEST_HIVE_USER=hive_user
47+
export TEST_HIVE_PASSWORD=hive_password
48+
49+
export ENV=LOCAL
50+
51+
export SPARK_CONF_DIR=./app/tests/spark/hive/conf/
52+
export HADOOP_CONF_DIR=./app/tests/spark/hadoop/
53+
export HIVE_CONF_DIR=./app/tests/spark/hive/conf/

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Thank you for your contribution! -->
2+
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->
3+
<!-- See https://github.com/MobileTeleSystems/syncmaster/blob/develop/CONTRIBUTING.rst for help on Contributing -->
4+
<!-- PLEASE DO **NOT** put issue ids in the PR title! Instead, add a descriptive title and put ids in the body -->
5+
6+
## Change Summary
7+
8+
<!-- Please give a short summary of the changes. -->
9+
10+
## Related issue number
11+
12+
<!-- Are there any issues opened that will be resolved by merging this change? -->
13+
<!-- WARNING: please use "fix #123" style references so the issue is closed when this PR is merged. -->
14+
15+
## Checklist
16+
17+
* [ ] Commit message and PR title is comprehensive
18+
* [ ] Keep the change as small as possible
19+
* [ ] Unit and integration tests for the changes exist
20+
* [ ] Tests pass on CI and coverage does not decrease
21+
* [ ] Documentation reflects the changes where applicable
22+
* [ ] `docs/changelog/next_release/<pull request or issue id>.<change type>.rst` file added describing change
23+
(see [CONTRIBUTING.rst](https://github.com/MobileTeleSystems/syncmaster/blob/develop/CONTRIBUTING.rst) for details.)
24+
* [ ] My PR is ready to review.

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: weekly
9+
labels:
10+
- type:ci
11+
# https://til.simonwillison.net/github/dependabot-python-setup
12+
groups:
13+
github-actions:
14+
patterns:
15+
- '*'
16+
- package-ecosystem: pip
17+
directory: /
18+
schedule:
19+
interval: weekly
20+
labels:
21+
- type:dependency
22+
# https://til.simonwillison.net/github/dependabot-python-setup
23+
groups:
24+
python-packages:
25+
patterns:
26+
- '*'

.github/labels.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# config for https://github.com/marketplace/actions/github-labeler
2+
3+
- name: attention:help wanted
4+
description: Extra attention is needed
5+
color: bfdadc
6+
from_name: help wanted
7+
8+
- name: attention:invalid
9+
description: This doesn't seem right
10+
color: ea2357
11+
from_name: invalid
12+
13+
- name: ci:skip-changelog
14+
description: Add this label to skip changelog file check
15+
color: 04990f
16+
17+
- name: component:backend
18+
description: Backend-related changes
19+
color: '5319e7'
20+
21+
- name: component:worker
22+
description: Worker-related changes
23+
color: 75f526
24+
25+
- name: kind:bug
26+
description: Something isn't working
27+
color: d73a4a
28+
from_name: bug
29+
30+
- name: kind:feature
31+
description: New feature or request
32+
color: 389a3f
33+
34+
- name: kind:improvement
35+
description: Improvement of some existing feature
36+
color: 1a92c2
37+
from_name: enhancement
38+
39+
- name: kind:question
40+
description: Further information is requested
41+
color: 0e857c
42+
from_name: question
43+
44+
- name: resolution:duplicate
45+
description: This issue or pull request already exists
46+
color: cfd3d7
47+
from_name: duplicate
48+
49+
- name: resolution:wontfix
50+
description: This will not be worked on
51+
color: ec103b
52+
from_name: wontfix
53+
54+
- name: type:ci
55+
description: CI-related changes
56+
color: cdb0bd
57+
58+
- name: type:dependency
59+
description: Dependency-related changes
60+
color: 214efe
61+
62+
- name: type:documentation
63+
description: Improvements or additions to documentation
64+
color: 6b9f54
65+
from_name: documentation
66+
67+
- name: type:tests
68+
description: Tests-related changes
69+
color: 5cca5b

.github/workflows/automerge.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Automerge
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
automerge:
8+
name: Enable pull request automerge
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]'
11+
12+
steps:
13+
- uses: alexwilson/[email protected]
14+
with:
15+
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
16+
merge-method: REBASE
17+
18+
autoapprove:
19+
name: Automatically approve pull request
20+
needs: [automerge]
21+
runs-on: ubuntu-latest
22+
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]'
23+
24+
steps:
25+
- uses: hmarr/auto-approve-action@v4
26+
with:
27+
github-token: ${{ secrets.AUTOMERGE_TOKEN }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Backend docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+'
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
release:
17+
name: Build & push backend image to Dockerhub
18+
runs-on: ubuntu-latest
19+
if: github.repository == 'MobileTeleSystems/syncmaster' # prevent running on forks
20+
21+
steps:
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to Docker Hub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Set tag
38+
id: set_tag
39+
run: |
40+
if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "develop" ]]; then
41+
echo "TAG=mtsrus/syncmaster-backend:develop" >> $GITHUB_ENV
42+
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
43+
echo "TAG=mtsrus/syncmaster-backend:latest,mtsrus/syncmaster-backend:${{ github.ref_name }}" >> $GITHUB_ENV
44+
fi
45+
46+
- name: Build Backend image
47+
uses: docker/build-push-action@v5
48+
with:
49+
tags: ${{ env.TAG }}
50+
context: .
51+
file: docker/backend.dockerfile
52+
pull: true
53+
push: true
54+
cache-to: type=gha,mode=max
55+
cache-from: type=gha
56+
platforms: |
57+
linux/amd64
58+
linux/arm64/v8
59+
provenance: mode=max
60+
61+
- name: Convert README to Markdown
62+
uses: docker://pandoc/core:2.9
63+
with:
64+
args: >-
65+
--output=README.md
66+
--from=rst
67+
--to=gfm
68+
--wrap=none
69+
README.rst
70+
71+
- name: Update DockerHub Description
72+
uses: peter-evans/dockerhub-description@v4
73+
if: github.ref_type == 'tag'
74+
with:
75+
username: ${{ secrets.DOCKERHUB_USERNAME }}
76+
# this requires token with read+write+delete permissions. read+write is not enough!
77+
password: ${{ secrets.DOCKERHUB_TOKEN }}
78+
repository: mtsrus/syncmaster-backend
79+
short-description: ${{ github.event.repository.description }}
80+
enable-url-completion: true

0 commit comments

Comments
 (0)