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

Display of env memory limit seems erroneous #14

Closed
pierrepo opened this issue May 5, 2020 · 3 comments · Fixed by #16
Closed

Display of env memory limit seems erroneous #14

pierrepo opened this issue May 5, 2020 · 3 comments · Fixed by #16

Comments

@pierrepo
Copy link
Contributor

pierrepo commented May 5, 2020

I created a new env with these settings:

image

This env is then proposed to the user with the following properties:

image

The memory limit seems overestimated.

@pierrepo
Copy link
Contributor Author

pierrepo commented May 5, 2020

This issue could impact only 2 GB environments:

image

image

@jtpio
Copy link
Member

jtpio commented May 5, 2020

Good catch, thanks 👍

To give more context:

This is because the default memory limit (2GB at the moment) is now set via tljh-config in this playbook: https://github.com/plasmabio/plasmabio/blob/b1c8e6d26da368790fe7d8fc04469fe758020587/ansible/tljh.yml#L38-L41

And TLJH sets the values on the Spawner here: https://github.com/jupyterhub/the-littlest-jupyterhub/blob/68a84f1f926058142df39a7b4096ed758adf9ac6/tljh/configurer.py#L187

The mem_limit trait is defined as a ByteSpecification in jupyterhub: https://github.com/jupyterhub/jupyterhub/blob/289c3bc3c19951c12cfe540b8245571e299d44aa/jupyterhub/spawner.py#L525-L546

A ByteSpecification in jupyterhub.traitlets automatically parse the "2G" value into a bytes integer: https://github.com/jupyterhub/jupyterhub/blob/289c3bc3c19951c12cfe540b8245571e299d44aa/jupyterhub/traitlets.py#L90

@jtpio
Copy link
Member

jtpio commented May 5, 2020

We can transform this bytes value back into a human readable format before showing it it the user.

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 a pull request may close this issue.

2 participants