我正在尝试运行需要在现有 Conda 环境中执行的任务列表(这里正在运行气流,但实际上可能是任何东西)。
我想做这些任务:
- name: activate conda environment
# does not work, just for the sake of understanding
command: source activate my_conda_env
- name: initialize the database
command: airflow initdb
- name: start the web server
command: 'airflow webserver -p {{ airflow_webserver_port }}'
- name: start the scheduler
command: airflow scheduler
当然,这不起作用,因为每个任务都是独立的,并且conda environment
第一个任务中的激活被以下任务忽略。
我想如果使用 apython virtualenv
而不是conda
.
如何实现在 Conda 环境中运行的每项任务?