Deploy procedure for new dags
<p>I need some advice on how to restart all airflow services on deploy without killing the workers in the middle of a task.</p>

<p>I've written a deployment procedure for my DAGs which installs airflow and any other pip dependencies in a virtualenv.  Once my release directory is ready, I:</p>

<ol>
<li>stop airflow-flower, airflow-worker, airflow-scheduler, and airflow-webserver</li>
<li>Update the "current" simlink to point to my new release</li>
<li>Start airflow-flower, airflow-worker, airflow-scheduler, and airflow-webserver</li>
</ol>

<p>The problem with this deploy procedure is that the workers get killed immediately. I'd like to add some sort of monitoring to the script to pause all DAGs, wait for the workers to idle, then restart the services, but the airflow CLI has no way to learn which dags are enabled nor whether the workers are idle.</p>

<p>I understand that many of the airflow services can auto-detect changes in the dags folder, but I want each deployment to have its own virtualenv. If I don't restart all services then a new deployment won't pick up a new line in my requirements.txt file.</p>