berkeley-dsep-infra / hubploy

Toolkit to deploy many z2jh based JupyterHubs
BSD 3-Clause "New" or "Revised" License
17 stars 15 forks source link

make image building in hubploy.yaml optional #75

Closed scottyhq closed 4 years ago

scottyhq commented 4 years ago

Closes https://github.com/yuvipanda/hubploy/issues/73

This allows bypassing hubploys image building in favor of an existing image as described here https://zero-to-jupyterhub.readthedocs.io/en/latest/customizing/user-environment.html#choose-and-use-an-existing-docker-image

singleuser:
  image:
    # Get the latest image tag at:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
    name: jupyter/datascience-notebook
    tag: 177037d09156

Just added conditionals on the existence of the images: key in hubploy.yaml. If that section does not exist hubploy deploy commands still work. I did not add any error catching if people are to run hubploy build without the images: key

Tested on local hubploy commands for a single hub (https://github.com/escience-pangeo/dssg-jhub). but haven't yet considered how this might affect CI. cc @salvis2 @yuvipanda

scottyhq commented 4 years ago

@yuvipanda - any other changes needed? I'd love to get this merged to fix the linked issue above

salvis2 commented 4 years ago

@scottyhq it looks like you've done what I've done for your deployment and just commented out the build step in the GitHub Action. It feels like we should really make that a method that you can pass through without error if it isn't needed. Ex. if we ran

hubploy build dssg2020 --check-registry --push

and we didn't define images in hubploy.yaml, it should output Building 0 images and return successfully (which it might do, need to test).

We could also enable the images block to specifically hold DockerHub entries. This would need some work in __main__.py, the docs, and hubploy-template. Maybe some new options in config.py.

Is this something you'd be willing to work on as part of this PR, or should we open up another issue and have this be its own PR?

yuvipanda commented 4 years ago

Agree it would be nice to have what @salvis2 asked for. Could be a separate PR, though.

@consideRatio the documentation here continues to be a mess, unfortunately... Needs a lot of fixing :(