Skip to content

pin s3 worker count for kubernetes tasks #2259

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metaflow/plugins/airflow/airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ def _to_job(self, node):
"METAFLOW_DATATOOLS_S3ROOT": DATATOOLS_S3ROOT,
"METAFLOW_DEFAULT_DATASTORE": self.flow_datastore.TYPE,
"METAFLOW_DEFAULT_METADATA": "service",
"METAFLOW_S3_WORKER_COUNT": max(1, int(k8s_deco.attributes["cpu"]) - 2),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would we need a similar change in argo workflows for pods and jobsets?

"METAFLOW_KUBERNETES_WORKLOAD": str(
1
), # This is used by kubernetes decorator.
Expand Down
1 change: 1 addition & 0 deletions metaflow/plugins/aws/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def create_job(
.environment_variable("METAFLOW_DEFAULT_DATASTORE", "s3")
.environment_variable("METAFLOW_DEFAULT_METADATA", DEFAULT_METADATA)
.environment_variable("METAFLOW_CARD_S3ROOT", CARD_S3ROOT)
.environment_variable("METAFLOW_S3_WORKER_COUNT", max(1, int(cpu) - 2))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would we need a change in step functions as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

step-functions calls the batch implementation so this should apply there as well. will verify

Copy link
Collaborator

Choose a reason for hiding this comment

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

confirmed, step-functions is setting the env correctly through the changes in Batch

.environment_variable("METAFLOW_OTEL_ENDPOINT", OTEL_ENDPOINT)
.environment_variable("METAFLOW_RUNTIME_ENVIRONMENT", "aws-batch")
)
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/kubernetes/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ def create_job_object(
"METAFLOW_ARGO_WORKFLOWS_ENV_VARS_TO_SKIP",
ARGO_WORKFLOWS_ENV_VARS_TO_SKIP,
)
# TODO: Set this for AWS Batch too.
.environment_variable("METAFLOW_S3_WORKER_COUNT", max(1, int(cpu) - 2))
.environment_variable("METAFLOW_OTEL_ENDPOINT", OTEL_ENDPOINT)
# Skip setting METAFLOW_DATASTORE_SYSROOT_LOCAL because metadata sync
Expand Down
Loading