Reputation: 79
I'm new to GCP and trying to gain a better understanding of ETL services offered by Google Cloud. I'm trying to do a POC where a dataflow job runs whenever a file arrives at a specified location in GCS, I want to utilize Cloud Composer for the same.
How can I utilize different airflow operators (one to watch for file in GCS and other to trigger dataflow job) in a DAG?
Upvotes: 0
Views: 1337
Reputation: 2217
DataflowCreateJavaJobOperator
if you are using Java SDKDataflowCreatePythonJobOperator
if you are using Python SDKMore details here : https://airflow.apache.org/docs/apache-airflow-providers-google/2.1.0/operators/cloud/dataflow.html
That was the answer to your question about composer, but you should consider replacing Composer by Cloud Workflows, and rather than using an airflow dataflow operator, you can use Cloud Workflows dataflow connector, and you can code your cloud function to trigger a Cloud Workflows execution. There are many clients library in different languages to do that. Here the link to choose your library: https://cloud.google.com/workflows/docs/reference/libraries
Finally Cloud Workflows pros compared to Composer.
it's serverless: you don't have to bother about machine types, network, ...
you use yaml to describe your workflow in easy and fast way, so you don't have to worry about learning airflow
it's way cheaper than composer
...
Upvotes: 0