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

Allow easily augmenting the pod config before launching #111

Merged
merged 5 commits into from
Dec 15, 2017
Merged

Allow easily augmenting the pod config before launching #111

merged 5 commits into from
Dec 15, 2017

Conversation

yuvipanda
Copy link
Collaborator

This makes it easy for people to configure this without
having to inherit from KubeSpawner and change it.

This makes it easy for people to configure this without
having to inherit from KubeSpawner and change it.
@yuvipanda
Copy link
Collaborator Author

/cc @foxish for easier augmenting of pod specification.


This can be a coroutine if necessary. When set to none, no augmenting is done.

This is very useful if you want to modify the pod being launched programattically.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo in "programattically"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

@@ -909,6 +931,8 @@ def start(self):
# FIXME: Have better / cleaner retry logic!
retry_times = 4
pod = yield self.get_pod_manifest()
if self.augment_pod:
pod = self.augment_pod(self, pod)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why also pass self?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the augmenter can access other traitlets, and also call methods to get things like auth_state...

@foxish
Copy link
Contributor

foxish commented Dec 8, 2017

This is a good step towards more flexible parameterizing in the spawner. Thanks @yuvipanda

It doesn't actually seem to exist in traitlets for some reason
@yuvipanda
Copy link
Collaborator Author

np @foxish! Glad to help :)

@yuvipanda
Copy link
Collaborator Author

/cc @minrk too.

I welcome some amount of bikeshedding on the name of this thing.

@minrk
Copy link
Member

minrk commented Dec 8, 2017

I welcome some amount of bikeshedding on the name of this thing.

There is some convention around calling configurable callables hooks, but I don't have a strong feeling.

@yuvipanda
Copy link
Collaborator Author

@minrk renamed!

@foxish
Copy link
Contributor

foxish commented Dec 11, 2017

LGTM!

@minrk minrk merged commit 13bd555 into jupyterhub:master Dec 15, 2017
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.

3 participants