Skip to content

Commit

Permalink
Merge pull request #1531 from Polber:jkinard/yaml-docs
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 636651447
  • Loading branch information
cloud-teleport committed May 23, 2024
2 parents 5c8b086 + a96e8bc commit b20548c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ public ImageSpec buildSpecModel(boolean validateFlag) {
block.name(), Arrays.asList(block.content())))
.collect(Collectors.toList()));

if (templateAnnotation.type().equals(TemplateType.YAML)) {
metadata.setMainClass("");
} else if (templateAnnotation.placeholderClass() != null
if (templateAnnotation.placeholderClass() != null
&& templateAnnotation.placeholderClass() != void.class) {
metadata.setMainClass(templateAnnotation.placeholderClass().getName());
} else {
Expand Down
4 changes: 2 additions & 2 deletions plugins/core-plugin/src/main/resources/README-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mvn clean package -PtemplatesStage \
-DbucketName="$BUCKET_NAME" \
-DstagePrefix="templates" \
-DtemplateName="${spec.metadata.internalName}" \
<#if language == 'PYTHON'>
<#if language == 'PYTHON' || language == 'YAML'>
-f python
<#elseif flex>
-f v2/${spec.metadata.module!}
Expand Down Expand Up @@ -196,7 +196,7 @@ mvn clean package -PtemplatesRun \
-DjobName="${spec.metadata.internalName?lower_case?replace("_", "-")}-job" \
-DtemplateName="${spec.metadata.internalName}" \
-Dparameters="<#list spec.metadata.parameters as parameter>${parameter.name}=$${parameter.name?replace('([a-z])([A-Z])', '$1_$2', 'r')?upper_case?replace("-", "_")}<#sep>,</#sep></#list>" \
<#if language == 'PYTHON'>
<#if language == 'PYTHON' || language == 'YAML'>
-f python
<#elseif flex>
-f v2/${spec.metadata.module!}
Expand Down
14 changes: 11 additions & 3 deletions python/README_Yaml_Template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

YAML Template (Experimental) template
YAML Template
---
YAML pipeline. Reads YAML from Cloud Storage and dynamically expands YAML into
Beam pipeline graph.
The YAML Template is used to run Dataflow pipelines written in Beam YAML. The
YAML pipeline can be passed to the template directly as a raw string or the
location of a Beam YAML pipeline file stored in Google Cloud Storage can
optionally be passed.

For launching a Beam YAML pipeline directly from the gcloud command line, see
https://cloud.google.com/sdk/gcloud/reference/dataflow/yaml.

For more information on Beam YAML, see
https://beam.apache.org/documentation/sdks/yaml/.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@
name = "Yaml_Template",
category = TemplateCategory.GET_STARTED,
type = Template.TemplateType.YAML,
displayName = "YAML Template (Experimental)",
displayName = "YAML",
description =
"YAML pipeline. Reads YAML from Cloud Storage and dynamically expands YAML into "
+ "Beam pipeline graph.",
"The YAML Template is used to run Dataflow pipelines written in Beam YAML. "
+ "The YAML pipeline can be passed to the template directly as a raw string or the location "
+ "of a Beam YAML pipeline file stored in Google Cloud Storage can optionally be passed."
+ "\n\n"
+ "For launching a Beam YAML pipeline directly from the gcloud command line, see "
+ "https://cloud.google.com/sdk/gcloud/reference/dataflow/yaml"
+ "\n\n"
+ "For more information on Beam YAML, see https://beam.apache.org/documentation/sdks/yaml/",
flexContainerName = "yaml-template",
contactInformation = "https://cloud.google.com/support")
contactInformation = "https://cloud.google.com/support",
requirements = {
"A valid Beam YAML pipeline.",
})
public interface YAMLTemplate {
@TemplateParameter.Text(
order = 1,
Expand Down

0 comments on commit b20548c

Please sign in to comment.