Skip to content

Commit

Permalink
将 dev 分支对齐 v3 大版本
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Jun 23, 2024
2 parents 73d373b + de783b8 commit 579d366
Show file tree
Hide file tree
Showing 49 changed files with 4,117 additions and 1,802 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/.git/
**/.github/
**/.ruff_cache/
**/__pycache__/
**/pyproject.toml
**/poetry.lock
**/requirements-dev.txt
**/config.yaml
22 changes: 22 additions & 0 deletions .github/workflows/static-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Static Check

on:
push:

jobs:
static-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "poetry"
- name: Install Dependencies
run: poetry install --all-extras
- name: Lint With Ruff
run: poetry run ruff check --output-format=github .
- name: Type checking with Pyright
run: poetry run pyright --warnings .
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
__pycache__/
.mypy_cache/
**/__pycache__
config.yaml
34 changes: 16 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
FROM python:3.10.8-slim

WORKDIR /app

ENV TZ Asia/Shanghai

COPY requirements.txt .

RUN pip install \
-r requirements.txt \
--no-cache-dir \
--no-compile \
--disable-pip-version-check \
--quiet

COPY . .

CMD ["python", "main.py"]
FROM python:3.10-slim

ENV TZ Asia/Shanghai

WORKDIR /app

COPY requirements.txt .
RUN pip install \
-r requirements.txt \
--no-cache-dir \
--no-compile \
--disable-pip-version-check

COPY . .

CMD ["python", "main.py"]
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# JFetcher
12 changes: 12 additions & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: v3.0.0
mongodb:
host: localhost
port: 27017
database: jfetcher
log:
save_level: DEBUG
print_level: DEBUG
feishu_notification:
enabled: false
webhook_url: <webhook-url>
failure_card_id: <card-id>
14 changes: 0 additions & 14 deletions constants.py

This file was deleted.

53 changes: 27 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
version: "3"

networks:
mongodb:
external: true

services:
main:
image: jfetcher:2.7.4
build: .
volumes:
- "./config.yaml:/app/config.yaml:ro"
networks:
- mongodb
environment:
- PYTHONUNBUFFERED=1
deploy:
resources:
limits:
cpus: "0.30"
memory: 96M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
stop_grace_period: 1s
networks:
mongodb:
external: true
prefect:
external: true

services:
main:
image: jfetcher:3.0.0
container_name: jfetcher-v3
build: .
volumes:
- ./config.yaml:/app/config.yaml:ro
networks:
- mongodb
- prefect
environment:
- PYTHONUNBUFFERED=1
- PREFECT_API_URL=http://prefect:4200/api
deploy:
resources:
limits:
memory: 512M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
59 changes: 0 additions & 59 deletions event_callbacks.py

This file was deleted.

124 changes: 0 additions & 124 deletions fetchers/JPEP_FTN_macket.py

This file was deleted.

Loading

0 comments on commit 579d366

Please sign in to comment.