Apply labels when creating Dataflow jobs for Ingestion #899
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR sets the
label
options for Dataflow jobs created whenFeatureSets
are applied. The labels are useful for organizing Dataflow jobs and breaking down costs for Dataflow jobs in Google Cloud.The labels for the Dataflow jobs are derived from the
FeatureSets
the Dataflow job is expected to process when the Dataflow job is created/updated. This means that new FeatureSets that the Dataflow job processes after it was first created (Dataflow job listens to the message broker for new FeatureSets after it is created) will not be considered in the labels unless the Dataflow job is restarted. (This is mainly due to the limitation in Dataflow jobs API in Google that only allows the setting of labels at jobs creation/update time)When a Dataflow job is processing 2 FeatureSets with the same label key but different label value, the resulting label value for the Dataflow job will be the concatenation of the label value from both FeatureSets. The label keys and values to be applied to the Dataflow jobs will be validated so it can meet the requirement for Dataflow job labels https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements. If it does not meet the requirement, those labels will be ignored, so that the Dataflow job creation can still proceed. (This is because labels are good to have but should not cause disruption in job creation)
Which issue(s) this PR fixes:
None
Does this PR introduce a user-facing change?:
None