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

Type mismatch between Kubespawner and Helm Schema #2068

Closed
thomasv314 opened this issue Feb 25, 2021 · 3 comments · Fixed by #2070
Closed

Type mismatch between Kubespawner and Helm Schema #2068

thomasv314 opened this issue Feb 25, 2021 · 3 comments · Fixed by #2070
Labels

Comments

@thomasv314
Copy link

Bug description

It is not immediately clear to me if this is an issue with the latest version of the jupyterhub chart, or Kubespawner.

There is a mismatch between the helm values for .singleuser.cpu.guarantee and the Kubespawner traitlets.

After upgrading to a version running off master, we see errors related to cpu limits/requests.

Expected behaviour

JupyterHub deploys / runs without issue.

Actual behaviour

Helm fails to deploy due to Schema validation issues:

Given the following values

  singleuser:
    cpu:
      limit: 2
      guarantee: 1

Deploying with helm errors out:

  Error: UPGRADE FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
  jupyterhub:
  - singleuser.cpu.guarantee: Invalid type. Expected: [string,null], given: integer
  - singleuser.cpu.limit: Invalid type. Expected: [string,null], given: integer

When fixing the type in helm values, the deploy succeeds but the hub container errors out with:

   traitlets.traitlets.TraitError: The 'cpu_limit' trait of a KubeSpawner instance expected a float, not the str '2'.

How to reproduce

Try to sync with versions specified and the values provided above.

Your personal set up

Jupyterhub Chart: 10196f6 (0.11.1-n239.h10196f66)
Kubespawner: jupyterhub/kubespawner@a16e400

alembic==1.4.3
async-generator==1.10
attrs==20.3.0
bcrypt==3.2.0
boto3==1.17.14
botocore==1.20.14
cachetools==4.1.1
certifi==2020.12.5
certipy==0.1.3
cffi==1.14.4
chardet==3.0.4
conda==4.3.16
cryptography==3.4.4
entrypoints==0.3
escapism==1.0.1
google-auth==1.23.0
idna==2.10
ipython-genutils==0.2.0
Jinja2==2.11.2
jmespath==0.10.0
jsonschema==3.2.0
jupyter-telemetry==0.1.0
jupyterhub==1.3.0
jupyterhub-firstuseauthenticator==0.14.1
jupyterhub-hmacauthenticator==1.0
jupyterhub-idle-culler==1.0
jupyterhub-kubespawner @ git+https://github.com/jupyterhub/kubespawner.git@a16e400d69b2481863f3c6452273abbedb74f76a
jupyterhub-ldapauthenticator==1.3.2
jupyterhub-ltiauthenticator==1.0.0
jupyterhub-nativeauthenticator==0.0.7
jupyterhub-tmpauthenticator==0.6
kubernetes==12.0.1
ldap3==2.8.1
Mako==1.1.3
MarkupSafe==1.1.1
mwoauth==0.3.7
nullauthenticator==1.0.0
oauthenticator==0.13.0
oauthlib==3.1.0
onetimepass==1.0.1
pamela==1.0.0
prometheus-client==0.9.0
psycopg2-binary==2.8.6
py-spy==0.3.4
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycosat==0.6.3
pycparser==2.20
pycurl==7.43.0.6
PyJWT==1.7.1
PyMySQL==1.0.2
pyOpenSSL==20.0.0
pyrsistent==0.17.3
python-dateutil==2.8.1
python-editor==1.0.4
python-json-logger==2.0.1
python-slugify==4.0.1
PyYAML==5.3.1
requests==2.25.0
requests-oauthlib==1.3.0
rsa==4.6
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
s3transfer==0.3.4
six==1.15.0
SQLAlchemy==1.3.23
statsd==3.3.0
text-unidecode==1.3
tornado==6.1
traitlets==5.0.5
urllib3==1.26.2
websocket-client==0.57.0
  • Configuration
# jupyterhub_config.py
  • Logs
hub-7b65ffd55c-rjhmh:hub     Traceback (most recent call last):
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2856, in launch_instance_async
hub-7b65ffd55c-rjhmh:hub         await self.initialize(argv)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2428, in initialize
hub-7b65ffd55c-rjhmh:hub         await gen.with_timeout(
hub-7b65ffd55c-rjhmh:hub       File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
hub-7b65ffd55c-rjhmh:hub         self._context.run(self._callback, *self._args)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2413, in log_init_time
hub-7b65ffd55c-rjhmh:hub         n_spawners = f.result()
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2116, in init_spawners
hub-7b65ffd55c-rjhmh:hub         spawner = user.spawners[orm_spawner.name]
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/user.py", line 186, in __getitem__
hub-7b65ffd55c-rjhmh:hub         self[key] = self.spawner_factory(key)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/jupyterhub/user.py", line 332, in _new_spawner
hub-7b65ffd55c-rjhmh:hub         spawner = spawner_class(**spawn_kwargs)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/kubespawner/spawner.py", line 162, in __init__
hub-7b65ffd55c-rjhmh:hub         super().__init__(*args, **kwargs)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/config/configurable.py", line 104, in __init__
hub-7b65ffd55c-rjhmh:hub         self.config = config
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 604, in __set__
hub-7b65ffd55c-rjhmh:hub         self.set(obj, value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 593, in set
hub-7b65ffd55c-rjhmh:hub         obj._notify_trait(self.name, old_value, new_value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 1217, in _notify_trait
hub-7b65ffd55c-rjhmh:hub         self.notify_change(Bunch(
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 1227, in notify_change
hub-7b65ffd55c-rjhmh:hub         return self._notify_observers(change)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 1264, in _notify_observers
hub-7b65ffd55c-rjhmh:hub         c(event)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 888, in compatible_observer
hub-7b65ffd55c-rjhmh:hub         return func(self, change)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/config/configurable.py", line 208, in _config_changed
hub-7b65ffd55c-rjhmh:hub         self._load_config(change.new, traits=traits, section_names=section_names)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/config/configurable.py", line 175, in _load_config
hub-7b65ffd55c-rjhmh:hub         setattr(self, name, deepcopy(config_value))
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 604, in __set__
hub-7b65ffd55c-rjhmh:hub         self.set(obj, value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 578, in set
hub-7b65ffd55c-rjhmh:hub         new_value = self._validate(obj, value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 610, in _validate
hub-7b65ffd55c-rjhmh:hub         value = self.validate(obj, value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 2080, in validate
hub-7b65ffd55c-rjhmh:hub         self.error(obj, value)
hub-7b65ffd55c-rjhmh:hub       File "/usr/local/lib/python3.8/dist-packages/traitlets/traitlets.py", line 690, in error
hub-7b65ffd55c-rjhmh:hub         raise TraitError(e)
hub-7b65ffd55c-rjhmh:hub     traitlets.traitlets.TraitError: The 'cpu_limit' trait of a KubeSpawner instance expected a float, not the str '2'.
@thomasv314 thomasv314 added the bug label Feb 25, 2021
@consideRatio
Copy link
Member

@thomasv314 ❤️ 🎉 thank you for reporting this, and doing it so clearly! This is an issue with z2jh following #2033.

@thomasv314
Copy link
Author

@consideRatio no problem, much thanks for confirming it was a z2jjh issue.

The changes in #2069 resolved the issue

@consideRatio
Copy link
Member

We ended up working in parallel! Thank you for reporting and contributing to fix this @thomasv314! ❤️ 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants