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

SwarmSpawner.image_whitelist spawn only default image #285

Closed
zi-dan opened this issue Feb 15, 2019 · 14 comments
Closed

SwarmSpawner.image_whitelist spawn only default image #285

zi-dan opened this issue Feb 15, 2019 · 14 comments

Comments

@zi-dan
Copy link

zi-dan commented Feb 15, 2019

Hi Guys,

I try to use image_whitelist in my SwarmSpawner with guidance of issue #219 but always a default image is choosen. It looks like a image_whitelist options are skipped and always values of SwarmSpawner.image is taken from configuration.
My jupyter_config has following parameters:

c.JupyterHub.spawner_class = 'dockerspawner.SwarmSpawner' 
c.SwarmSpawner.image = 'jupyter/minimal-notebook:77e10160c7ef' 
c.SwarmSpawner.image_whitelist = { 
    'Jupyteo All-In-One': 'jupytepide/user-spawn-notebook:dev', 
    'Jupyteo EO Processing': 'jupytepide/eodata-notebook:1.3.6' 
}

With this config list with option is displayed but choosing any of the item loads jupyter/minimal-notebook.

Did I miss something?

@minrk
Copy link
Member

minrk commented Mar 1, 2019

were you using dockerspawner master? This isn't in a release yet, though I'm trying to make the 0.11 release today.

@zi-dan
Copy link
Author

zi-dan commented Mar 1, 2019

Yes, I use a master branch. So I will wait for update and new release.

@mathematicalmichael
Copy link

mathematicalmichael commented Jul 8, 2020

hi, I cloned off master (pip install git+https://github.com/jupyterhub/dockerspawner.git) and switched to allowed_images, but I'm still only getting default spawns. Why might this be?

I also tried on 0.11 and even downgraded to 0.10 and reverted to image_whitelist, and in none of the cases does the menu show up (even tried trimming my list down to a single entry, nothing seems to bring it back all of the sudden)

In my case, the menu to select doesn't even show up, and I'm using DockerSpawner instead of SwarmSpawner

@efagerberg
Copy link

I have not tried master but I tried 0.11.1 with the allowed_images option and also only get the default image with no form. In my case I do not specify c.DockerSpawner.image at all so it seems like allowed_images is being looked and just taking the first image.

@GeorgianaElena
Copy link
Member

I didn't manage to reproduce this with:

  • jupyterhub 1.1.0
  • dockerspawner 0.12.0.dev0 (master)

and @zi-dan's config:

c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.allowed_images = {
    'Jupyteo All-In-One': 'jupytepide/user-spawn-notebook:dev',
    'Jupyteo EO Processing': 'jupytepide/eodata-notebook:1.3.6'
}

😕
bug-not-reproducing

@efagerberg
Copy link

So seems like it is on 0.12.0.dev0 did not see that in pypi thanks

@zi-dan
Copy link
Author

zi-dan commented Aug 12, 2020

I suppose that c.SwarmSpawner.image overwrite c.SwarmSpawner.image_whitelist so if you remove c.SwarmSpawner.image parameter from your config (as @GeorgianaElena write) a list will be displayed without any problems. One trick should be done - first entry in c.SwarmSpawner.image_whitelist will be default option displayed on start.

@mathematicalmichael
Copy link

I couldn't get the spawner options working with upgrades, so I'm still using image_whitelist with an old docker image for the hub component, if anyone need a stable solution for the time being: docker pull mathematicalmichael/math-hub, I have not been able to upgrade the hub + dockerspawner + get the list working all together. it doesn't help that my deployment (jupyterhub-deploy-docker) hasn't been updated to refer to.

@benz0li
Copy link

benz0li commented Oct 13, 2020

In my case (SwarmSpawner), dockerspawner 0.12.0.dev0 (master) is working with both jupyterhub 1.0.0 and jupyterhub 1.1.0 but not jupyterhub 1.2.0 (master).

With jupyterhub 1.2.0 (master) the Spawner Options screen does not show up and the default image is used.

slemonide added a commit to slemonide/dockerspawner that referenced this issue Nov 12, 2020
@minrk
Copy link
Member

minrk commented Dec 9, 2020

Can folks share the exact commits or releases of jupyterhub and dockerspawner they are working with, as well as the traitlets and Python versions, and relevant sections of jupyterhub_config.py?

I've at least verified that this does not affect current master (9ccedbe) of DockerSpawner (and current stable (1.2.2) or development jupyterhub/jupyterhub@ffed8f6) with this config:

# dummy auth for testing
c.JupyterHub.authenticator_class = "dummy"

c.JupyterHub.hub_bind_url = 'http://0.0.0.0:8081'
c.JupyterHub.spawner_class = "docker"
c.DockerSpawner.allowed_images = {
    "data8": "jupyterhub/singleuser:1.0",
    "ds100": "jupyter/base-notebook",
    "cs267": "jupyter/scipy-notebook",
}
c.DockerSpawner.remove = True

I have traitlets 5.0.5

@manics
Copy link
Member

manics commented Dec 21, 2020

@mathematicalmichael the name of the function shouldn't matter, the decorator @default('options_form') indicates the variable it applies to. That said it might be a bug somewhere, which is why having your full list of component versions would be useful.

@mathematicalmichael
Copy link

@manics thanks, I poked around the open PR's in this repo and found that, deleted my comment shortly thereafter.
I'll take a look at my versions when I have access to that machine / have time to re-try with latest versions. I am hoping this was just an unfortunate consequence of when I chose to test out upgrading.

@minrk
Copy link
Member

minrk commented Feb 26, 2021

I'm going to close this one since the latest comments and testing suggest that it's working with current versions of everything.

If someone can reproduce this with a jupyterhub_config.py and exact, current versions of jupyterhub and dockerspawner, please feel free to open a new Issue with that information and we'll track it down. Things are getting a little mixed up by how old this issue is, since the original report is about a feature not available in an old version, which is fixed by updating dockerspawner.

@mathematicalmichael
Copy link

I rebuilt my hub / images recently and was able to get the dropdown lists working again.
didn't pin a version of the spawner, so whatever was latest recently (2-3 weeks ago) is definitely working. hub == 1.3.0

sorry I didn't come back around and update the issue. thanks for your help as always, @minrk

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

No branches or pull requests

7 participants