调整为热加载
This commit is contained in:
@@ -61,12 +61,27 @@ cd /Users/idss/YXT_Project/gmv-analytics
|
|||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
开启热加载监听:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /Users/idss/YXT_Project/gmv-analytics
|
||||||
|
docker compose watch
|
||||||
|
```
|
||||||
|
|
||||||
停止:
|
停止:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose down
|
docker compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
|
热加载规则是:
|
||||||
|
|
||||||
|
- 修改 `.py`、`.env`、Excel 映射表等项目内容:
|
||||||
|
- 自动同步到容器
|
||||||
|
- 并自动重启服务
|
||||||
|
- 修改 `Dockerfile`、`pyproject.toml`、`supervisord.conf`、`docker-compose.yaml`、`requirements-docker.txt`:
|
||||||
|
- 自动触发 rebuild
|
||||||
|
|
||||||
## 3. 注册 Prefect 调度
|
## 3. 注册 Prefect 调度
|
||||||
|
|
||||||
推荐方式是使用 [prefect.yaml](/Users/idss/YXT_Project/gmv-analytics/prefect.yaml) 注册 deployment:
|
推荐方式是使用 [prefect.yaml](/Users/idss/YXT_Project/gmv-analytics/prefect.yaml) 注册 deployment:
|
||||||
|
|||||||
+29
-3
@@ -1,13 +1,39 @@
|
|||||||
services:
|
services:
|
||||||
gmv-prefect-scheduler:
|
prefect-gmv-worker:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
image: gmv-analytics-prefect:0.1.0
|
image: gmv-analytics-prefect:0.1.0
|
||||||
container_name: gmv-prefect-scheduler
|
container_name: prefect-gmv-worker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
PROJECT_MAPPING_FILE: /app/店铺映射表.xlsx
|
PROJECT_MAPPING_FILE: /app/店铺映射表.xlsx
|
||||||
command: ["python", "prefect_gmv_scheduler.py", "--serve"]
|
develop:
|
||||||
|
watch:
|
||||||
|
- action: sync+restart
|
||||||
|
path: .
|
||||||
|
target: /app
|
||||||
|
ignore:
|
||||||
|
- .git/
|
||||||
|
- .venv/
|
||||||
|
- __pycache__/
|
||||||
|
- .pytest_cache/
|
||||||
|
- logs/
|
||||||
|
- "*.pyc"
|
||||||
|
- "Dockerfile"
|
||||||
|
- "docker-compose.yaml"
|
||||||
|
- "pyproject.toml"
|
||||||
|
- "supervisord.conf"
|
||||||
|
- "requirements-docker.txt"
|
||||||
|
- action: rebuild
|
||||||
|
path: Dockerfile
|
||||||
|
- action: rebuild
|
||||||
|
path: docker-compose.yaml
|
||||||
|
- action: rebuild
|
||||||
|
path: pyproject.toml
|
||||||
|
- action: rebuild
|
||||||
|
path: supervisord.conf
|
||||||
|
- action: rebuild
|
||||||
|
path: requirements-docker.txt
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ deployments:
|
|||||||
- bitable
|
- bitable
|
||||||
- sync
|
- sync
|
||||||
schedules:
|
schedules:
|
||||||
- cron: "0 17 10 * *"
|
- cron: "0 17 30 * *"
|
||||||
timezone: "Asia/Shanghai"
|
timezone: "Asia/Shanghai"
|
||||||
active: true
|
active: true
|
||||||
work_pool:
|
work_pool:
|
||||||
@@ -43,7 +43,7 @@ deployments:
|
|||||||
- feishu
|
- feishu
|
||||||
- notify
|
- notify
|
||||||
schedules:
|
schedules:
|
||||||
- cron: "0 17 50 * *"
|
- cron: "0 18 10 * *"
|
||||||
timezone: "Asia/Shanghai"
|
timezone: "Asia/Shanghai"
|
||||||
active: true
|
active: true
|
||||||
work_pool:
|
work_pool:
|
||||||
|
|||||||
@@ -261,14 +261,12 @@ def main() -> None:
|
|||||||
gmv_daily_data_sync_flow.serve(
|
gmv_daily_data_sync_flow.serve(
|
||||||
name="gmv-daily-data-sync-8am",
|
name="gmv-daily-data-sync-8am",
|
||||||
cron="0 8 * * *",
|
cron="0 8 * * *",
|
||||||
timezone="Asia/Shanghai",
|
|
||||||
parameters=flow_kwargs,
|
parameters=flow_kwargs,
|
||||||
tags=["gmv", "feishu", "bitable"],
|
tags=["gmv", "feishu", "bitable"],
|
||||||
)
|
)
|
||||||
gmv_daily_notify_flow.serve(
|
gmv_daily_notify_flow.serve(
|
||||||
name="gmv-daily-notify-9am",
|
name="gmv-daily-notify-9am",
|
||||||
cron="0 9 * * *",
|
cron="0 9 * * *",
|
||||||
timezone="Asia/Shanghai",
|
|
||||||
parameters=flow_kwargs,
|
parameters=flow_kwargs,
|
||||||
tags=["gmv", "feishu", "notify"],
|
tags=["gmv", "feishu", "notify"],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user