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

Support broadcast segments #14789

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Conversation

georgew5656
Copy link
Contributor

@georgew5656 georgew5656 commented Aug 9, 2023

Since the pod template adapter does not generate the internal peon ... run command itself (the command is passed in the pod templates), we need a way to account for the optional --load-broadcast-segments flag in CliPeon for tasks that are queryable.

Description

Based on the task being launched, pass whether the task can handle queries as a environment variable to the job launched by the pod template adapter. The operator can then configure their k8s command in the pod template to include this env variable in the internal peon run command.

Release note

Allow the PodTemplateTaskAdapter to account for queryable tasks.

Key changed/added classes in this PR
  • PodTemplateTaskAdapter

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@@ -34,6 +34,7 @@ public class DruidK8sConstants
public static final String TASK_JSON_ENV = "TASK_JSON";
public static final String TASK_DIR_ENV = "TASK_DIR";
public static final String TASK_ID_ENV = "TASK_ID";
public static final String LOAD_BROADCAST_SEGMENTS_ENV = "LOAD_BROADCAST_SEGMENTS";
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be loadBroadcastSegments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a env variable so i think it should match the other env variables

@@ -224,7 +224,11 @@ private Collection<EnvVar> getEnv(Task task)
.withValueFrom(new EnvVarSourceBuilder().withFieldRef(new ObjectFieldSelector(
null,
StringUtils.format("metadata.annotations['%s']", DruidK8sConstants.TASK)
)).build()).build()
)).build()).build(),
new EnvVarBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is we what to do things similar to this
Is setting an env variable enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this needs to be passed to the java druid internal peon command as a flag, and in the PodTemplateTaskAdapter, we don't actually control how the user configures that command.

But right now there's no way to even see whether the flag should be set, since we set the environment variable here, the user can read it and choose to set --loadBroadcastSegments

Copy link
Contributor

@YongGang YongGang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@suneet-s suneet-s left a comment

Choose a reason for hiding this comment

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

+1 it would be good to document this new environment variable somewhere so operators know how to use it. It can be done as a separate change.

@suneet-s suneet-s merged commit c8a1170 into apache:master Aug 11, 2023
46 checks passed
@LakshSingla LakshSingla added this to the 28.0 milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants