generate_run_id = PythonOperator(
    task_id='gen-run-id',
    python_callable=af_kube_utils.generate_random_run_id,
    op_args=[run_id_prefix],
    op_kwargs={"suffix": "0000"},
    provide_context=True,
    dag=dag)

init_config = PythonOperator(
    task_id='init-config',
    python_callable=af_kube_utils.initialize_config,
    provide_context=True,
    op_args=[wrf_config, 'wrf_config_'],
    templates_dict={
        'wrf_config_start_date':
        af_docker_utils.get_start_date_template(0),
        # ** NOTE: this should change for a scheduled run
        'wrf_config_run_id':
        '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
        'wrf_config_wps_run_id':
        '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
    },
    dag=dag,
)

clean_up = PythonOperator(
    task_id='cleanup-config',
    python_callable=af_kube_utils.clean_up_wrf_run,
    provide_context=True,
    op_args=['init-config'],
    dag=dag,

generate_run_id = PythonOperator(task_id='gen-run-id',
                                 python_callable=generate_random_run_id,
                                 op_args=[run_id_prefix],
                                 provide_context=True,
                                 dag=dag)

init_config = PythonOperator(
    task_id='init-config',
    python_callable=initialize_config,
    provide_context=True,
    op_args=[airflow_vars[wrf_config_key], 'wrf_config_'],
    templates_dict={
        'wrf_config_start_date':
        airflow_docker_utils.get_start_date_template(),
        'wrf_config_run_id':
        '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
        'wrf_config_wps_run_id':
        '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
    },
    dag=dag,
)

clean_up = PythonOperator(
    task_id='cleanup-config',
    python_callable=clean_up_wrf_run,
    provide_context=True,
    op_args=['init-config'],
    dag=dag,
)
Example #3
0
generate_run_id = PythonOperator(
    task_id='gen-run-id',
    python_callable=generate_random_run_id,
    op_args=[run_id_prefix],
    provide_context=True,
    dag=dag
)

init_config = PythonOperator(
    task_id='init-config',
    python_callable=initialize_config,
    provide_context=True,
    op_args=[airflow_vars[wrf_config_key], 'wrf_config_'],
    templates_dict={
        'wrf_config_start_date': airflow_docker_utils.get_start_date_template(),
        'wrf_config_run_id': '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
        'wrf_config_wps_run_id': '{{ task_instance.xcom_pull(task_ids=\'gen-run-id\') }}',
    },
    dag=dag,
)

clean_up = PythonOperator(
    task_id='cleanup-config',
    python_callable=clean_up_wrf_run,
    provide_context=True,
    op_args=['init-config'],
    dag=dag,
)

wps = CurwDockerOperator(