gixen
gixen

Reputation: 309

Beam template for dataflow will not upload to bucket

I've followed all the quickstarts/documentation for creating Java-based dataflow templates. The steps I've found and done is:

1) Create the project:

mvn archetype:generate \
      -DarchetypeGroupId=org.apache.beam \
      -DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
      -DarchetypeVersion=2.22.0 \
      -DgroupId=com.example \
      -DartifactId=JsonToBucket \
      -Dversion="0.1" \
      -Dpackage=com.example.dataflow \
      -DinteractiveMode=false

2) mvn clean && mvn compile

This reports build success

3) Compile and upload to bucket

mvn compile exec:java -Pdataflow-runner \                      
-Dexec.mainClass=com.example.dataflow.JsonToBucket -Dexec.cleanupDaemonThreads=false  \   
-Dexec.args="--runner=DataflowRunner \
--project=PROJECT \
--stagingLocation=gs://some-bucket/staging \
--templateLocation=gs://some-bucket/beam_templates/DisruptivePubSubToBucket"

The output of this is:

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< com.example:jsonToBucket >----------------------
[INFO] Building jsonToBucket 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jsonToBucket ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /somepath/jsonToBucket/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ jsonToBucket ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /somepath/jsonToBucket/target/classes
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ jsonToBucket ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.161 s
[INFO] Finished at: 2020-06-19T14:05:52+02:00
[INFO] ------------------------------------------------------------------------

No files are uploaded to the bucket set in step 3.

What could be wrong?

Upvotes: 1

Views: 366

Answers (1)

Tlaquetzal
Tlaquetzal

Reputation: 2850

The issue was with the run() method. Taken from @gixen comment:

The problem was a real small thing, the run() method was never triggered

Upvotes: 1

Related Questions