Skip to content

Instantly share code, notes, and snippets.

@allanbatista
Last active October 30, 2018 18:08
Show Gist options
  • Select an option

  • Save allanbatista/3c5c617bf4fa11bfda3ca65652898e07 to your computer and use it in GitHub Desktop.

Select an option

Save allanbatista/3c5c617bf4fa11bfda3ca65652898e07 to your computer and use it in GitHub Desktop.
Create new Custom Template and Dataflow JOB from DataflowTemplates git repository
mvn compile exec:java \
-Dexec.mainClass=com.google.cloud.teleport.templates.PubSubToBigQuery \
-Dexec.cleanupDaemonThreads=false \
-Dexec.args=" \
--project=XXXXXXX \
--stagingLocation=gs://GPS_NAME/staging \
--tempLocation=gs://GPS_NAME/tmp \
--templateLocation=gs://GPS_NAME/PubSubToBigQuery.json \
--runner=DataflowRunner \
--subnetwork=https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/us-east1/subnetworks/NETWORK_NAME \
--workerMachineType=n1-standard-1"
gcloud dataflow jobs run skyhub-messages-monitor-$(date +'%Y%m%d-%H%M') \
--gcs-location=gs://GPS_NAME/PubSubToBigQuery.json \
--max-workers=1 \
--region=us-east1 \
--zone=us-east1-b \
--staging-location=gs://GPS_NAME/staging \
--parameters "inputTopic=projects/PROJECT_NAME/topics/PUBSUB_TOPIC,outputTableSpec=PROJECT_NAME:dataset_name.table_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment