-
Notifications
You must be signed in to change notification settings - Fork 34
Bump version to 0.3.1-SNAPSHOT and update documentation #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,13 +4,17 @@ OPERATION=$1 | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if [ "$OPERATION" == "deploy" ]; then | ||||||||||||||||||||||||
| echo "Deploying Dataflow Flex Template..." | ||||||||||||||||||||||||
| # Find the JAR file using wildcard | ||||||||||||||||||||||||
| JAR_FILE=$(ls target/differ-bundled-*.jar | head -n 1) | ||||||||||||||||||||||||
| echo "Found JAR: ${JAR_FILE}" | ||||||||||||||||||||||||
|
Comment on lines
+7
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| gcloud dataflow flex-template build \ | ||||||||||||||||||||||||
| "gs://datcom-templates/templates/flex/differ.json" \ | ||||||||||||||||||||||||
| --image-gcr-path "gcr.io/datcom-ci/dataflow-templates/differ:latest" \ | ||||||||||||||||||||||||
| --sdk-language "JAVA" \ | ||||||||||||||||||||||||
| --flex-template-base-image JAVA17 \ | ||||||||||||||||||||||||
| --metadata-file "metadata.json" \ | ||||||||||||||||||||||||
| --jar "target/differ-bundled-0.1-SNAPSHOT.jar" \ | ||||||||||||||||||||||||
| --jar "${JAR_FILE}" \ | ||||||||||||||||||||||||
| --env FLEX_TEMPLATE_JAVA_MAIN_CLASS="org.datacommons.pipeline.differ.DifferPipeline" | ||||||||||||||||||||||||
| elif [ "$OPERATION" == "run" ]; then | ||||||||||||||||||||||||
| echo "Running Dataflow Flex Template..." | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,24 +19,23 @@ steps: | |
| # 2. Build the Dataflow Flex Template | ||
| # This step uses the built JAR to create the Flex Template image and spec file. | ||
| - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' | ||
| entrypoint: 'gcloud' | ||
| entrypoint: 'bash' | ||
| args: | ||
| - 'dataflow' | ||
| - 'flex-template' | ||
| - 'build' | ||
| - 'gs://$_TEMPLATE_BUCKET/templates/flex/ingestion.json' | ||
| - '--image-gcr-path' | ||
| - '${_IMAGE_GCR_PATH}:$SHORT_SHA' | ||
| - '--sdk-language' | ||
| - 'JAVA' | ||
| - '--flex-template-base-image' | ||
| - 'JAVA17' | ||
| - '--metadata-file' | ||
| - 'pipeline/ingestion/metadata.json' | ||
| - '--jar' | ||
| - 'pipeline/ingestion/target/ingestion-bundled-${_VERSION}.jar' | ||
| - '--env' | ||
| - 'FLEX_TEMPLATE_JAVA_MAIN_CLASS=org.datacommons.ingestion.pipeline.ImportGroupPipeline' | ||
| - '-c' | ||
| - | | ||
| # Find the JAR file using wildcard | ||
| # Note: We are in the root of the workspace context for the build. | ||
| JAR_FILE=$(ls pipeline/ingestion/target/ingestion-bundled-*.jar | head -n 1) | ||
| echo "Found JAR: ${JAR_FILE}" | ||
|
|
||
| gcloud dataflow flex-template build \ | ||
| gs://$_TEMPLATE_BUCKET/templates/flex/ingestion.json \ | ||
| --image-gcr-path "${_IMAGE_GCR_PATH}:$SHORT_SHA" \ | ||
|
Comment on lines
+32
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section introduces a command injection vulnerability due to the insecure use of Cloud Build substitutions (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any thoughts on this? |
||
| --sdk-language JAVA \ | ||
| --flex-template-base-image JAVA17 \ | ||
| --metadata-file pipeline/ingestion/metadata.json \ | ||
| --jar "${JAR_FILE}" \ | ||
| --env FLEX_TEMPLATE_JAVA_MAIN_CLASS=org.datacommons.ingestion.pipeline.ImportGroupPipeline | ||
| id: 'build-flex-template' | ||
|
|
||
| availableSecrets: | ||
|
|
@@ -45,6 +44,6 @@ availableSecrets: | |
| env: AUTOPUSH_DC_API_KEY | ||
|
|
||
| substitutions: | ||
| _VERSION: "0.1-SNAPSHOT" | ||
|
|
||
| _TEMPLATE_BUCKET: "datcom-templates" | ||
| _IMAGE_GCR_PATH: "gcr.io/datcom-ci/dataflow-templates/ingestion" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,13 +4,17 @@ OPERATION=$1 | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if [ "$OPERATION" == "deploy" ]; then | ||||||||||||||||||||||||
| echo "Deploying Dataflow Flex Template..." | ||||||||||||||||||||||||
| # Find the JAR file using wildcard | ||||||||||||||||||||||||
| JAR_FILE=$(ls target/ingestion-bundled-*.jar | head -n 1) | ||||||||||||||||||||||||
| echo "Found JAR: ${JAR_FILE}" | ||||||||||||||||||||||||
|
Comment on lines
+7
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| gcloud dataflow flex-template build \ | ||||||||||||||||||||||||
| "gs://datcom-templates/templates/flex/ingestion.json" \ | ||||||||||||||||||||||||
| --image-gcr-path "gcr.io/datcom-ci/dataflow-templates/ingestion:latest" \ | ||||||||||||||||||||||||
| --sdk-language "JAVA" \ | ||||||||||||||||||||||||
| --flex-template-base-image JAVA17 \ | ||||||||||||||||||||||||
| --metadata-file "metadata.json" \ | ||||||||||||||||||||||||
| --jar "target/ingestion-bundled-0.1-SNAPSHOT.jar" \ | ||||||||||||||||||||||||
| --jar "${JAR_FILE}" \ | ||||||||||||||||||||||||
| --env FLEX_TEMPLATE_JAVA_MAIN_CLASS="org.datacommons.ingestion.pipeline.ImportGroupPipeline" | ||||||||||||||||||||||||
| elif [ "$OPERATION" == "run" ]; then | ||||||||||||||||||||||||
| echo "Running Dataflow Flex Template..." | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
| <maven.compiler.source>17</maven.compiler.source> | ||
| <maven.compiler.target>17</maven.compiler.target> | ||
| <!-- Dependency versions --> | ||
| <revision>0.1-SNAPSHOT</revision> | ||
| <revision>0.3.1-SNAPSHOT</revision> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious why go from 0.1 to 0.3.1..shall we do 0.1.1 instead? |
||
| <beam.version>2.67.0</beam.version> | ||
| <gson.version>2.10.1</gson.version> | ||
| <os.maven.plugin.version>1.7.1</os.maven.plugin.version> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
ls ... | head -n 1to find the JAR file is not robust. If the build directory is not clean, multiple JAR files with different versions might exist.lssorts alphabetically, so this command could select an older version, leading to the deployment of an incorrect artifact. A safer approach is to ensure that exactly one JAR file matches the pattern and fail the build otherwise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider passing the version as a substitution variable (similar to API key)?