diff --git a/images/Dockerfile b/images/Dockerfile index 75978f7..c8dca9d 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -1,13 +1,25 @@ FROM rocker/geospatial +ENV NB_USER rstudio +ENV VIRTUAL_ENV /opt/venv + RUN /rocker_scripts/install_jupyter.sh -COPY requirements.txt requirements.txt -RUN python3 -m pip install -r requirements.txt && rm requirements.txt COPY install.R install.R RUN Rscript install.R && rm install.R -RUN python3 -m ipykernel install --user --name=nasa # some teaching preferences RUN git config --global pull.rebase false +EXPOSE 8888 +CMD ["/bin/sh", "-c", "jupyter lab --ip 0.0.0.0 --no-browser"] + +RUN chown -R root:staff ${VIRTUAL_ENV} +USER ${NB_USER} +COPY requirements.txt requirements.txt +RUN python3 -m pip install -r requirements.txt && rm requirements.txt +RUN python3 -m ipykernel install --user --name=spatial + + +WORKDIR /home/${NB_USER} + diff --git a/jupyterhub/public-config.yaml b/jupyterhub/public-config.yaml index 0815073..d4b8a5a 100644 --- a/jupyterhub/public-config.yaml +++ b/jupyterhub/public-config.yaml @@ -20,39 +20,57 @@ singleuser: - display_name: "GPU Server" description: "Spawns a notebook server with access to a GPU" kubespawner_override: - extra_resource_limits: + image: ghcr.io/boettiger-lab/k8s:latest + extra_resource_limits: nvidia.com/gpu: "1" - display_name: "Rocker Geospatial with RStudio" slug: rocker description: R environment with many geospatial libraries pre-installed - profile_options: &profile_options - resource_allocation: &profile_options_resource_allocation - display_name: Resource Allocation - choices: - mem_1_9: - display_name: 2 GB RAM - kubespawner_override: - mem_guarantee: 1991341312 - mem_limit: 1991341312 - default: true - mem_7_4: - display_name: 7.4 GB RAM - kubespawner_override: - mem_guarantee: 7965365248 - mem_limit: 7965365248 - mem_14_8: - display_name: 14.8 GB RAM - kubespawner_override: - mem_guarantee: 15930730496 - mem_limit: 15930730496 - mem_29_7: - display_name: 29.7 GB RAM - kubespawner_override: - mem_guarantee: 31861460992 - mem_limit: 31861460992 - kubespawner_override: + profile_options: &profile_options + resource_allocation: &profile_options_resource_allocation + display_name: Resource Allocation + choices: + mem_1_9: + display_name: CPU only + 2 GB RAM + kubespawner_override: + mem_guarantee: 1991341312 + mem_limit: 1991341312 + default: true + mem_14_8: + display_name: CPU only + 14.8 GB RAM + kubespawner_override: + mem_guarantee: 15930730496 + mem_limit: 15930730496 + mem_29_7: + display_name: CPU only + 29.7 GB RAM + kubespawner_override: + mem_guarantee: 31861460992 + mem_limit: 31861460992 + gpu_1_9: + display_name: GPU + 2 GB RAM + kubespawner_override: + mem_guarantee: 1991341312 + mem_limit: 1991341312 + extra_resource_limits: + nvidia.com/gpu: "1" + gpu_14_8: + display_name: GPU + 14.8 GB RAM + kubespawner_override: + mem_guarantee: 15930730496 + mem_limit: 15930730496 + extra_resource_limits: + nvidia.com/gpu: "1" + gpu_29_7: + display_name: GPU + 29.7 GB RAM + kubespawner_override: + mem_guarantee: 31861460992 + mem_limit: 31861460992 + extra_resource_limits: + nvidia.com/gpu: "1" + kubespawner_override: image: rocker/binder:4.3 - default_url: /rstudio +# image: ghcr.io/boettiger-lab/k8s:latest + default_url: /lab # change to /rstudio to go straight to RStudio working_dir: /home/rstudio - display_name: "Bring your own image" description: Specify your own docker image (must have python and jupyterhub installed in it)