Skip to content

Use worker config resource requirements by default in jobs #10231

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

Merged

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Feb 9, 2022

We noticed that resource requirements were not actually being populated on jobs in cloud, so this PR causes the DefaultJobCreator to use the resource requirements from WorkerConfigs by default if they are not populated in the StandardSync

@github-actions github-actions bot added area/platform issues related to the platform area/scheduler area/server area/worker Related to worker labels Feb 9, 2022
@lmossman lmossman temporarily deployed to more-secrets February 9, 2022 19:24 Inactive
@lmossman lmossman temporarily deployed to more-secrets February 9, 2022 19:36 Inactive
@lmossman lmossman temporarily deployed to more-secrets February 9, 2022 19:45 Inactive
@@ -113,6 +114,8 @@ public SchedulerApp(final Path workspaceRoot,
}

public void start() throws IOException {
final Configs configs = new EnvConfigs();
final WorkerConfigs workerConfigs = new WorkerConfigs(configs);
Copy link
Contributor Author

@lmossman lmossman Feb 9, 2022

Choose a reason for hiding this comment

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

I believe this should be safe to do here in the SchedulerApp, because I see that the resource requirement env variables exist in each of these environments:

  • Docker compose:
    - JOB_MAIN_CONTAINER_CPU_LIMIT=${JOB_MAIN_CONTAINER_CPU_LIMIT}
    - JOB_MAIN_CONTAINER_CPU_REQUEST=${JOB_MAIN_CONTAINER_CPU_REQUEST}
    - JOB_MAIN_CONTAINER_MEMORY_LIMIT=${JOB_MAIN_CONTAINER_MEMORY_LIMIT}
    - JOB_MAIN_CONTAINER_MEMORY_REQUEST=${JOB_MAIN_CONTAINER_MEMORY_REQUEST}
  • Kube overlays:
    JOB_MAIN_CONTAINER_CPU_REQUEST=
    JOB_MAIN_CONTAINER_CPU_LIMIT=
    JOB_MAIN_CONTAINER_MEMORY_REQUEST=
    JOB_MAIN_CONTAINER_MEMORY_LIMIT=
  • Helm charts:
    - name: JOB_MAIN_CONTAINER_CPU_REQUEST
    valueFrom:
    configMapKeyRef:
    name: airbyte-env
    key: JOB_MAIN_CONTAINER_CPU_REQUEST
    - name: JOB_MAIN_CONTAINER_CPU_LIMIT
    valueFrom:
    configMapKeyRef:
    name: airbyte-env
    key: JOB_MAIN_CONTAINER_CPU_LIMIT
    - name: JOB_MAIN_CONTAINER_MEMORY_REQUEST
    valueFrom:
    configMapKeyRef:
    name: airbyte-env
    key: JOB_MAIN_CONTAINER_MEMORY_REQUEST
    - name: JOB_MAIN_CONTAINER_MEMORY_LIMIT
    valueFrom:
    configMapKeyRef:
    name: airbyte-env
    key: JOB_MAIN_CONTAINER_MEMORY_LIMIT


public DefaultJobCreator(final JobPersistence jobPersistence, final ConfigRepository configRepository) {
public DefaultJobCreator(final JobPersistence jobPersistence,
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 the class with the main changes of using the WorkerConfig resource requirements if they are not set on the StandardSync

@lmossman lmossman requested a review from jrhizor February 9, 2022 19:51
@lmossman lmossman temporarily deployed to more-secrets February 9, 2022 19:56 Inactive
@lmossman lmossman temporarily deployed to more-secrets February 9, 2022 19:59 Inactive
@lmossman lmossman merged commit dedd1ea into master Feb 9, 2022
@lmossman lmossman deleted the lmossman/use-worker-config-resource-requirements-by-default branch February 9, 2022 21:04
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/scheduler area/server area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants