-
Notifications
You must be signed in to change notification settings - Fork 824
Correct memory units from MB to MiB #2309
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,9 @@ class ResourcesDecorator(StepDecorator): | |
gpu : int, optional, default None | ||
Number of GPUs required for this step. | ||
disk : int, optional, default None | ||
Disk size (in MB) required for this step. Only applies on Kubernetes. | ||
Disk size (in MiB) required for this step. Only applies on Kubernetes. | ||
memory : int, default 4096 | ||
Memory size (in MB) required for this step. | ||
Memory size (in MiB) required for this step. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given that these values are used in @kubernetes as well - would be good to ensure it's the case there too. also what about disk? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've not used Kubernetes before, so I wasn't sure about the three instances I left unchanged:
I am pretty sure this one ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
shared_memory : int, optional, default None | ||
The value for the size (in MiB) of the /dev/shm volume for this step. | ||
This parameter maps to the `--shm-size` option in Docker. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a peek at the units, and it seems that memory/disk values for kubernetes are treated as MB so the earlier docstring for these was correct.
we could hold off on changing the kubernetes units in the docs for now, as this would require also changing the implementation to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively changing the units from
M
toMi
inkube_utils.py#qos_requests_and_limits
should be the only additional change required, as this is used both by the kubernetes and argo workflows implementations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for taking a look at the Kubernetes units. Since the defaults are multiples of 1024, MiB seems to be the original intent. So I think it makes sense to update the implementation, especially if doing so is as easy as you've described. Accordingly, I've pushed up a new commit: bfaa672. But, if you prefer, I could revert bfaa672 and 4fc5107 and update the
@resources
docstring to indicate that the memory units are MiB for AWS Batch and MB for Kubernetes. Just let me know your preference. Thanks!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, the Kubernetes "Assign Memory Resources to Containers and Pods" example uses MiB, potentially indicating that MiB is more standard / expected there. Maybe.