Skip to content

Commit

Permalink
flex template fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuthan committed Oct 23, 2023
1 parent 005bb57 commit d5d2bf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
11 changes: 3 additions & 8 deletions .github/actions/build-flex-template/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inputs:
image_gcr:
description: Google Artifact Registry location to store the flex template image to be built
required: true
artifact_name:
description: Artifact name
jar:
description: Local path to your dataflow pipeline jar file
required: true
main_class:
description: Main class
Expand All @@ -18,18 +18,13 @@ inputs:
runs:
using: composite
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}

- uses: "google-github-actions/setup-gcloud@v1"

- name: Flex template build
shell: bash
run: |
gcloud dataflow flex-template build ${{ inputs.template_file }} \
--image-gcr-path "${{ image_gcr }}" \
--sdk-language "JAVA" \
--flex-template-base-image JAVA17 \
--jar "${{ inputs.artifact_name }}" \
--jar "${{ inputs.jar }}" \
--env FLEX_TEMPLATE_JAVA_MAIN_CLASS="${{ inputs.main_class }}" \
11 changes: 6 additions & 5 deletions .github/workflows/flex-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,39 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: sbt tollApplication/assembly
- run: sbt 'set assemblyOutputPath in assembly := new File("./app.jar")' tollApplication/assembly
- uses: actions/upload-artifact@v3
with:
name: assembly
path: stream-processing/toll-application/target/scala-2.13/tollApplication-assembly*.jar"
path: ./app.jar

build-batch:
runs-on: ubuntu-latest
needs: [assembly]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
- uses: ./.github/actions/build-flex-template
with:
template_file: gs://playground-272019-toll-application/templates/toll-application-batch.json
image_gcr: europe-west1-docker.pkg.dev/playground-272019/toll-application/toll-application-batch:latest
artifact_name: assembly
jar: ./app.jar
main_class: org.mkuthan.streamprocessing.toll.application.batch.TollBatchJob

build-streaming:
runs-on: ubuntu-latest
needs: [assembly]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
- uses: ./.github/actions/build-flex-template
with:
template_file: gs://playground-272019-toll-application/templates/toll-application-streaming.json
image_gcr: europe-west1-docker.pkg.dev/playground-272019/toll-application/toll-application-streaming:latest
artifact_name: assembly
jar: ./app.jar
main_class: org.mkuthan.streamprocessing.toll.application.streaming.TollStreamingJob

0 comments on commit d5d2bf1

Please sign in to comment.