This commit is contained in:
Jian Shen
2023-05-09 21:28:13 +08:00
parent 3c2884bee9
commit 19ff0909f5
+5 -1
View File
@@ -10,10 +10,14 @@ with DAG(
description="小区自动化入库"
) as dag:
t1 = DockerOperator(
# 刚才定义的conn id
docker_conn_id="docker_repo",
api_version="auto",
image='192.168.0.19:9012/comm-add:1.0.1',
command='python main.py --city 临沂',
# 临沂为我们的传参,python代码中, 镜像中部分代码
# @ click.command()
# @ click.option('--city', default="all", help='要计算的城市')
command='python main.py --city {{dag_run.conf["city"] if "city" in dag_run.conf}} else all',
task_id='comm_add'
)
t1