Skip to content

[BEAM-6058] Adding option for flink configuration directory and setting config in exectution environment - #7031

Merged
tweise merged 1 commit into
apache:masterfrom
angoenka:flink_load_config
Nov 28, 2018
Merged

tweise merged 1 commit into
apache:masterfrom
angoenka:flink_load_config

Conversation

@angoenka

Copy link
Copy Markdown
Contributor

This is needed as when submitting to remote execution environment, client config from the request is used.


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@angoenka
angoenka requested review from mxm and tweise November 14, 2018 02:38
@angoenka

Copy link
Copy Markdown
Contributor Author

Run Python Flink ValidatesRunner

@angoenka

Copy link
Copy Markdown
Contributor Author

Run Flink ValidatesRunner

@mxm mxm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This makes sense. Before portability, users used the Flink config of the cluster, now they need a different way to provide the config.


@Description("Directory containing Flink YAML configuration files.")
@Nullable
String getFlinkConfigDir();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Could you test the default in PipelineOptionstest#testDefaults?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Updated the test.

@tweise tweise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please document why/when this is required (JIRA is blank and it isn't obvious). It's not specific to portable execution, assuming the job server executes on the host where the old Flink runner would run otherwise.

@mxm

mxm commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

I think this is required to load a custom config for portability. If you submit the "legacy" way, you would have a Flink installation with a custom config which would be automatically discovered.

@tweise

tweise commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

I think this is required to load a custom config for portability. If you submit the "legacy" way, you would have a Flink installation with a custom config which would be automatically discovered.

Same applies in either case (which is why we need documentation). In portability case the job server replaces the legacy runner and it would discover that configuration (that's how we run the job server in Lyft).

@mxm

mxm commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

I agree that we should document the reason for changes in JIRA.

How do you let the JobServer discover the config? Via the Java property?

@tweise

tweise commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

The machine has Flink installed and flink-conf.yaml is same as on every cluster node. No extra properties are required for the job server (other than --flink-master-url or eq pipeline option).

@mxm

mxm commented Nov 14, 2018 •

Copy link
Copy Markdown
Contributor

Some configuration entries needs to be available at JobGraph creation time, which will occur inside the JobServer. The JobServer currently doesn't have a way to load the Flink config.

@angoenka

angoenka commented Nov 14, 2018 •

Copy link
Copy Markdown
Contributor Author

Properties like taskmanager.runtime.large-record-handler are read from the submitted JobGraph and are not read from cluster config when using RemoteEnvironment. Hence we need to read and set the properties in the job graph. Many of these properties are not even exposed via ExecutionConfig so we need to read these properties directly.
Reading from a config dir seems be the right way as we are already doing it for parallelism.
Also this lets us specify all flink properties instead of creating new flags for individual ones.

@angoenka

Copy link
Copy Markdown
Contributor Author

Also updated the jira with more details.

@angoenka
angoenka force-pushed the flink_load_config branch 2 times, most recently from 9f21bdb to bf8b452 Compare November 14, 2018 19:31
@angoenka

Copy link
Copy Markdown
Contributor Author

@tweise Reminder for review :)

@Nullable
String getFlinkConfigDir();

void setFlinkConfigDir(@Nullable String value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed in the JIRA, the better place for this is the JobServer configuration. Sorry for the hassle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable. I will move it their.

@tweise

tweise commented Nov 17, 2018

Copy link
Copy Markdown
Contributor

Something that may make sense as part of pipeline options is to let the user provide key value pairs of configuration options and merge those into the configuration object.

@angoenka

Copy link
Copy Markdown
Contributor Author

Run Python Flink ValidatesRunner

@angoenka

Copy link
Copy Markdown
Contributor Author

Run Flink ValidatesRunner

ExecutionEnvironment executionEnvironment =
FlinkExecutionEnvironments.createBatchExecutionEnvironment(pipelineOptions, filesToStage);
FlinkExecutionEnvironments.createBatchExecutionEnvironment(
pipelineOptions, filesToStage, confDir);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the config also passed for the streaming translator?

@mxm

mxm commented Nov 26, 2018

Copy link
Copy Markdown
Contributor

I think this needs to be adapted to also use the config in streaming translation. Otherwise it looks fine!

@angoenka

Copy link
Copy Markdown
Contributor Author

Thanks @mxm .
Updated the PR to pass the parameter in case of streaming as well. I think I missed it earlier.

@mxm mxm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. Looks good. Would merge.

@tweise Are you ok with the current state?

StreamExecutionEnvironment sev =
FlinkExecutionEnvironments.createStreamExecutionEnvironment(
options, Collections.emptyList(), flinkConfDir);
options, Collections.emptyList(), confDir);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unnecessary change

@tweise

tweise commented Nov 27, 2018

Copy link
Copy Markdown
Contributor

Is this change now equivalent to setting FLINK_CONF_DIR? If so, it would be good to document that.

@mxm

mxm commented Nov 27, 2018

Copy link
Copy Markdown
Contributor

@tweise It overrides the FLINK_CONF_DIR environment variable, if set.

@Option(
name = "--flink-conf-dir",
usage =
"Directory containing Flink YAML configuration files. These properties will be set to all jobs submitted to Flink."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mention here that it overrides FLINK_CONF_DIR and also confirm that if this option isn't used FLINK_CONF_DIR remains in effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants