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

Add custom hub package & config hooks #360

Merged
merged 4 commits into from Jun 5, 2019

Conversation

yuvipanda
Copy link
Collaborator

@yuvipanda yuvipanda commented May 31, 2019

  • Add hook for installing additional hub packages

  • Add hook for additional jupyterhub_config.py
    entries

  • Add / update documentation

  • Add tests

@yuvipanda yuvipanda changed the title Add hook to install packages in hub environment Add custom hub package & config hooks Jun 1, 2019
@yuvipanda yuvipanda force-pushed the repo2dockerspawner branch 4 times, most recently from c80c2e9 to 1f15299 Compare June 1, 2019 07:52
@yuvipanda
Copy link
Collaborator Author

yuvipanda commented Jun 1, 2019

Adding these hooks to help set up https://discourse.jupyter.org/t/would-a-the-littlest-binder-be-useful/1041/28. I've locally hacked this up to work, so am trying to upstream it all.

Copy link
Member

@GeorgianaElena GeorgianaElena left a comment

Choose a reason for hiding this comment

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

This looks awesome @yuvipanda ❤️ . I left a couple of comments inline, but feel free to ignore them if you think they are too far-fetched (I'm not very familiar with the plugin code and I might not fully understand the whole context).

@@ -46,3 +53,11 @@ def test_config_hook():
data = yaml.load(f)

assert data['simplest_plugin']['present']

def test_tmpauthenticator():
"""
Copy link
Member

Choose a reason for hiding this comment

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

I would probably name this test_tmpauthenticator_enabled or test_jupyterhub_config_hook (I'm not very good at naming things though 👀 ) but the name as it is makes me think we're testing the authenticator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! I've renamed it!

@@ -208,6 +208,7 @@ def ensure_jupyterhub_package(prefix):
'jupyterhub-firstuseauthenticator==0.12',
'jupyterhub-nativeauthenticator==0.0.4',
'jupyterhub-ldapauthenticator==1.2.2',
'jupyterhub-tmpauthenticator==0.6',
Copy link
Member

Choose a reason for hiding this comment

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

From what I understand, when a user wants to custom its juputerhub_config using tljh_custom_jupyterhub_config in order to use something that's not directly installed by TLJH, they could would use tljh_extra_hub_pip_packages to install it first.

If this is the case, I believe tmpauthenticator package should/could come from tljh_extra_hub_pip_packages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've split this part of the PR to #365 separately, and based this PR on that. So we have two PRs:

  1. Add tmpauthenticator by default to TLJH #365 that adds tmpauthenticator
  2. This PR, which adds two hooks with tests for both of them. There is a test for tljh_extra_hub_pip_packages that imports the 'there' package, and the test for tljh_custom_jupyterhub_config that sets tmpauthenticator to be the default authenticator.

How does that sound?

Is popular enough we should let people use it by
default
Required when installing additional authenticators or
spawners
This lets extensions directly control how JupyterHub
is configured
@yuvipanda
Copy link
Collaborator Author

Thanks for the review, @GeorgianaElena! I've updated the PR to reflect your suggestions. Let me know what you think :)

#365 should probably be merged before this though - this PR 'depends' on that (it includes some commits from there). So once #365 gets merged, the diff on this PR should stop showing the contents of #365. This might be confusing - let me know if I can help clarify that.

@GeorgianaElena
Copy link
Member

Excellent @yuvipanda 🎊. Once the tests pass I'll try to merge the PRs in the order you suggested :D

@GeorgianaElena GeorgianaElena merged commit a774e2c into jupyterhub:master Jun 5, 2019
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

2 participants