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

Use a separate node pool to run custom connector jobs #19770

Merged
merged 23 commits into from
Dec 7, 2022
Merged

Conversation

xiaohansong
Copy link
Contributor

@xiaohansong xiaohansong commented Nov 23, 2022

What

#19684

Custom connectors - user can upload their own docker image as the source or destination of the sync. Such sourceDefinition or destinationDefinition will be classified as custom connectors. Since they are not vetted by airbyte, we want to run it in a separate node pool for safety reasons to avoid failing jobs running with airbyte vetted connectors.

The goal of the PR is to:

  1. Identify which activity are involving custom connectors.
  2. pass along custom connector bit via temporal and eventually when starting a kube process we know it's a custom connector and thus run it on a different node pool.

How

Passing the value in launchConfig - launcher will read launchConfig and launch a kube process with correct node selector.

For jobs spawned by Orchestrator, we also need to pass down the env variable to containers.

@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/server area/worker Related to worker labels Nov 23, 2022
@xiaohansong xiaohansong temporarily deployed to more-secrets November 23, 2022 19:41 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 23, 2022 19:41 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 23, 2022 21:48 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 23, 2022 21:48 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 24, 2022 00:06 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 24, 2022 00:06 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 24, 2022 00:31 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 24, 2022 00:31 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 29, 2022 16:43 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 29, 2022 16:43 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 29, 2022 17:35 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets November 29, 2022 17:35 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 2, 2022 00:06 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 2, 2022 00:07 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 5, 2022 20:12 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 5, 2022 20:12 Inactive
@xiaohansong
Copy link
Contributor Author

@pmossman when you get a chance can you take another look at this PR? thanks!

@xiaohansong xiaohansong temporarily deployed to more-secrets December 5, 2022 21:49 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 5, 2022 21:49 Inactive
Copy link
Contributor

@pmossman pmossman left a comment

Choose a reason for hiding this comment

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

@xiaohansong I left a couple more comments but overall this looks good to me! I'll approve the PR assuming we don't disagree about any of my comments, let me know if you want to sync about any of them!

// If using isolated pool, check workerConfigs has isolated pool set. If not set, fall back to use
// regular node pool.
final var nodeSelectors =
usesIsolatedPool ? workerConfigs.getWorkerIsolatedKubeNodeSelectors().orElse(workerConfigs.getworkerKubeNodeSelectors())
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I wonder if we should just thrown an exception if usesIsolatedPool is true but the getWorkerIsolatedKubeNodeSelectors Optional is empty. I think it would be safer for us to fail loudly if we didn't configure the isolated pool properly, rather than accidentally letting custom connectors run in our main pool. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call! fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Realized this is not true - usesIsolatedPool here is actually passed by callers (isCustomConnector flag). Thus for OSS users who do not run them in a separate pool, usesIsolatedPool might still be true because they are custom connectors. I should rename this to isCustomConnectors instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh good call, OSS users should be able to use custom connectors without an isolated pool indeed

// custom connectors run in an isolated node pool from airbyte-supported connectors
// to reduce the blast radius of any problems with custom connector code.
final var nodeSelectors =
isCustomConnector ? workerConfigs.getWorkerIsolatedKubeNodeSelectors().orElse(workerConfigs.getworkerKubeNodeSelectors())
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment here, I think it's more dangerous to fall back on our primary node selectors, and perhaps we should throw an exception instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this check in WorkerConfigurationBeanFactory.java instead - because 1) workerConfigs does not carry useIsolatedPool flag, 2) should throw this error as early as possible

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 21:11 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 21:12 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 22:43 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 22:44 Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 23:53 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 23:54 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 23:59 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets December 6, 2022 23:59 — with GitHub Actions Inactive
@xiaohansong
Copy link
Contributor Author

Connector base build has been failing for unrelated reasons. Submitting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/server area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants