Skip to content
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

[FLINK-29501] Add option to override job vertex parallelisms during job submission #21023

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

mxm
Copy link
Contributor

@mxm mxm commented Oct 11, 2022

What is the purpose of the change

This allows to change the job vertex parallelism of a JobGraph during job submission time without having to modify the JobGraph upfront. This is intended to be used for (auto)scaling Flink jobs based on metric observations.

The initial idea was to add a new field to the payload of the job submit Rest endpoint. However, it is probably more practical to handle the overrides in the same way as other PipelineOptions already do it, i.e. via the configuration.

The implementation is deliberately lenient with respect to the presence of job vertices. If vertices have been removed or new ones have been added, only the ones found will have their parallelism overrides. The verification should be performed by the caller, not by Flink. In particular, we want to support scenarios where users modify the deployment and we might not yet have overrides for all vertices.

Based on feedback in #20953.

Brief change log

  • Add option to override job vertex parallelisms during job submission

Verifying this change

Tests

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs)

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 11, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@mxm
Copy link
Contributor Author

mxm commented Nov 11, 2022

I've removed the dependency on #21008.

@mxm mxm force-pushed the FLINK-29501 branch 2 times, most recently from fbc0fca to 04c9ed8 Compare November 11, 2022 16:45
…ob submission

This allows to change the job vertex parallelism of a JobGraph during job submission time without
having to modify the JobGraph upfront.

The initial idea was to add a new field to the payload of the job submit Rest endpoint. However, it
is probably more practical to handle the overrides in the same way as other PipelineOptions already
do it, i.e. via the configuration.

The implementation is deliberately lenient with respect to the presence of job vertices. If vertices
have been removed or new ones have been added, only the ones found will have their parallelism
overrides. The verification should be performed by the caller, not by Flink. In particular, we want
to support scenarios where users modify the deployment and we might not yet have overrides for all
vertices.
@mxm
Copy link
Contributor Author

mxm commented Nov 11, 2022

@flinkbot run azure

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@gyfora
Copy link
Contributor

gyfora commented Nov 14, 2022

Seems like the doc need to be regenerated:

Option pipeline.jobvertex-parallelism-overrides in class org.apache.flink.configuration.PipelineOptions is not documented.

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2022

@flinkbot run azure

@mxm mxm merged commit 23ce228 into apache:master Nov 23, 2022
@mxm mxm deleted the FLINK-29501 branch November 23, 2022 15:56
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
…ob submission (apache#21023)

This allows to change the job vertex parallelism of a JobGraph during job submission time without
having to modify the JobGraph upfront. This is intended to be used for (auto)scaling Flink jobs
based on metric observations.

The initial idea was to add a new field to the payload of the job submit Rest endpoint. However, it
is probably more practical to handle the overrides in the same way as other PipelineOptions already
do it, i.e. via the configuration.

The implementation is deliberately lenient with respect to the presence of job vertices. If vertices
have been removed or new ones have been added, only the ones found will have their parallelism
overrides. The verification should be performed by the caller, not by Flink. In particular, we want
to support scenarios where users modify the deployment and we might not yet have overrides for all
vertices.
vaibhav-gosain-glean pushed a commit to vaibhav-gosain-glean/flink that referenced this pull request Aug 21, 2023
…ob submission (apache#21023)

This allows to change the job vertex parallelism of a JobGraph during job submission time without
having to modify the JobGraph upfront. This is intended to be used for (auto)scaling Flink jobs
based on metric observations.

The initial idea was to add a new field to the payload of the job submit Rest endpoint. However, it
is probably more practical to handle the overrides in the same way as other PipelineOptions already
do it, i.e. via the configuration.

The implementation is deliberately lenient with respect to the presence of job vertices. If vertices
have been removed or new ones have been added, only the ones found will have their parallelism
overrides. The verification should be performed by the caller, not by Flink. In particular, we want
to support scenarios where users modify the deployment and we might not yet have overrides for all
vertices.

(cherry picked from commit 23ce228)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants