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

fix: apply only supported attributes from resources decorator in batch #1586

Merged
merged 2 commits into from Oct 24, 2023

Conversation

saikonen
Copy link
Collaborator

@saikonen saikonen commented Oct 12, 2023

Changes the way BatchDecorator pulls values from ResourcesDecorator if any are set. This limits the values to only ones supported through resource_defaults in batchdeco.

Should unblock #1500 which currently breaks for batch as it introduces a disk= attribute which is not supported for the batch deco, yet gets pulled in by the current implementation.

@saikonen saikonen changed the title fix: filter supported attributes from resources decorator in batch fix: apply only supported attributes from resources decorator in batch Oct 12, 2023
@saikonen
Copy link
Collaborator Author

also relates to #1609

@savingoyal savingoyal merged commit 161a449 into master Oct 24, 2023
20 checks passed
@savingoyal savingoyal deleted the fix/resources-deco-batch-handling branch October 24, 2023 15:52
@@ -109,6 +109,11 @@ def compute_resource_attributes(decos, compute_deco, resource_defaults):
# We use the non None value if there is only one or the larger value
# if they are both non None. Note this considers "" to be equivalent to
# the value zero.
#
# Skip attributes that are not supported by the decorator.
if k not in [*resource_defaults.keys(), *deco.attributes.keys()]:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this will be recomputed everytime. May be better to make it a set initially and then compare for inclusion. Here for every k, we will recompute the full list.

This also doesn't seem to do what the comment says. My understanding was that it would only let through attributes that are known to, for example, the batch decorator (that's the resource_defaults part) whereas here it lets through anything that is known to the batch_decorator OR the resources decorator which seems to not be exactly what we want (ie: no real different from what it currently is.

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.

None yet

3 participants