Display of env memory limit seems erroneous
pierrepo opened this issue · comments
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
We can transform this bytes value back into a human readable format before showing it it the user.