Skip to content

Apply labels when creating Dataflow jobs for Ingestion - #899

Closed
davidheryanto wants to merge 1 commit into
feast-dev:masterfrom
davidheryanto:dataflow-jobs-labelling
Closed

davidheryanto wants to merge 1 commit into
feast-dev:masterfrom
davidheryanto:dataflow-jobs-labelling

Conversation

@davidheryanto

@davidheryanto davidheryanto commented Jul 27, 2020 •

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

This PR sets the label options for Dataflow jobs created when FeatureSets 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

The job labels are derived from the labels of the FeatureSets that
the job is expected to process when the Dataflow job is created.

When the Dataflow job is processing multiple FeatureSets and there
are 2 FeatureSets with the same label key but different label value,
the resulting label value for the job will be the concatentation
of each label value from the FeatureSets.
@davidheryanto
davidheryanto requested a review from zhilingc as a code owner July 27, 2020 03:04
@feast-ci-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidheryanto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

pipelineOptions.setUpdate(update);
pipelineOptions.setRunner(DataflowRunner.class);
pipelineOptions.setJobName(jobName);
pipelineOptions.setLabels(labels);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cmiiw, but this overwrites all labels that could be set in application properties. Shouldn't we extend them instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we should extend them. Thanks for checking

@davidheryanto

Copy link
Copy Markdown
Collaborator Author

Closing because there is going to be change in job lifecycle in #903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants