Example #1
0
def create_EMR_cluster(cluster_name, emr_version, subnet_ids):
    cluster_id = EmrClusterController.create_cluster_job_execution(cluster_name, emr_version, subnet_ids)
    print("Waiting for Cluster: ", cluster_id)
    xcom_return = {"clusterId": cluster_id}

    with open("/airflow/xcom/return.json", "w") as file:
        json.dump(xcom_return, file)

    return EmrClusterController.wait_for_cluster_creation(cluster_id)
Example #2
0
def wait_for_cluster(**kwargs):
    ti = kwargs['ti']
    cluster_id = ti.xcom_pull(task_ids='create_cluster')
    EmrClusterController.wait_for_cluster_creation(cluster_id)