优化动态安装
This commit is contained in:
+8
-9
@@ -10,21 +10,20 @@ default_args = {
|
|||||||
'retry_delay': timedelta(minutes=5),
|
'retry_delay': timedelta(minutes=5),
|
||||||
}
|
}
|
||||||
|
|
||||||
dag = DAG('install_python_deps', default_args=default_args, schedule_interval=timedelta(days=1))
|
dag = DAG('install_dag', default_args=default_args, schedule_interval=None)
|
||||||
|
|
||||||
def install_python_deps():
|
|
||||||
# Use pip to install dependencies
|
|
||||||
pass
|
|
||||||
|
|
||||||
with dag:
|
with dag:
|
||||||
t1 = KubernetesPodOperator(
|
t1 = KubernetesPodOperator(
|
||||||
task_id='install-python-deps',
|
task_id='install',
|
||||||
name='install-python-deps',
|
name='install',
|
||||||
|
# 注意修改命名空间,否则无权限
|
||||||
namespace='airflow-plus',
|
namespace='airflow-plus',
|
||||||
image='python:3.8',
|
image='python:3.8',
|
||||||
cmds=['bash', '-cx'],
|
cmds=['bash', '-cx'],
|
||||||
arguments=['pip install -I goojia_utils -i https://repo.fangjia.com/repository/pypi-public/simple/'],
|
# 安装依赖项目
|
||||||
labels={"app": "airflow"},
|
arguments=['pip install elasticsearch==7.11.0 transbigdata==0.4.15 pykalman==0.9.5 -i https://repo.fangjia.com/repository/pypi-public/simple/',
|
||||||
|
'pip install -I goojia_utils -i https://repo.fangjia.com/repository/pypi-public/simple/'],
|
||||||
|
labels={"release": "airflow"},
|
||||||
volumes=[],
|
volumes=[],
|
||||||
volume_mounts=[],
|
volume_mounts=[],
|
||||||
is_delete_operator_pod=True,
|
is_delete_operator_pod=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user