优化
This commit is contained in:
@@ -10,10 +10,14 @@ with DAG(
|
|||||||
description="小区自动化入库"
|
description="小区自动化入库"
|
||||||
) as dag:
|
) as dag:
|
||||||
t1 = DockerOperator(
|
t1 = DockerOperator(
|
||||||
|
# 刚才定义的conn id
|
||||||
docker_conn_id="docker_repo",
|
docker_conn_id="docker_repo",
|
||||||
api_version="auto",
|
api_version="auto",
|
||||||
image='192.168.0.19:9012/comm-add:1.0.1',
|
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'
|
task_id='comm_add'
|
||||||
)
|
)
|
||||||
t1
|
t1
|
||||||
Reference in New Issue
Block a user