Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
Add template compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpatokal committed Aug 20, 2020
1 parent 5136fd2 commit d268bba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tutorials/schedule-dataflow-jobs-with-cloud-scheduler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ gcloud projects add-iam-policy-binding ${GOOGLE_CLOUD_PROJECT} --member serviceA
--role roles/storage.admin
```

Create a bucket on Google Cloud Stoeage, copy the Dataflow templates there and set up the Terraform backend.
Create a bucket on Google Cloud Stoeage and set up the Terraform backend.

```
gsutil mb -p ${GOOGLE_CLOUD_PROJECT} gs://${TF_ADMIN}
gsutil cp -R scheduler-dataflow-demo/dataflow gs://${TF_ADMIN}/templates/dataflow-demo-template
cat > backend.tf << EOF
terraform {
backend "gcs" {
Expand All @@ -122,7 +121,14 @@ terraform {
EOF
```

You are now ready to initialize and run Terraform.
Compile and upload the Dataflow template.

```
cd ../dataflow
. maven.sh
```

You are now ready to initialize and apply Terraform.

```
cd scheduler-dataflow-demo/terraform
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
PROJECT=${GOOGLE_CLOUD_PROJECT}
BUCKET=${TF_ADMIN}
mvn compile exec:java \
-Dexec.mainClass=DataflowDemoPipeline \
-Dexec.args="--runner=DataflowRunner \
--project=${PROJECT} \
--stagingLocation=gs://${BUCKET}/staging \
--gcpTempLocation=gs://${BUCKET}/temp \
--region=us-central1 \
--templateLocation=gs://${BUCKET}/templates/dataflow-demo-template"

0 comments on commit d268bba

Please sign in to comment.