{"id":19721971,"url":"https://github.com/datajoint/djlabhub-docker","last_synced_at":"2025-04-29T22:30:32.594Z","repository":{"id":41901963,"uuid":"267767049","full_name":"datajoint/djlabhub-docker","owner":"datajoint","description":"A docker image optimized for deploying to JupyterHub a JupyterLab environment with DataJoint Python.","archived":false,"fork":false,"pushed_at":"2024-07-29T16:00:32.000Z","size":335,"stargazers_count":3,"open_issues_count":7,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-05T19:51:12.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datajoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-29T04:45:04.000Z","updated_at":"2024-07-29T13:40:24.000Z","dependencies_parsed_at":"2024-04-29T22:25:18.162Z","dependency_job_id":"e5a63317-e5fd-4700-95a7-691eb53b835b","html_url":"https://github.com/datajoint/djlabhub-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datajoint%2Fdjlabhub-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datajoint%2Fdjlabhub-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datajoint%2Fdjlabhub-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datajoint%2Fdjlabhub-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datajoint","download_url":"https://codeload.github.com/datajoint/djlabhub-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251592897,"owners_count":21614440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T23:16:05.354Z","updated_at":"2025-04-29T22:30:31.898Z","avatar_url":"https://github.com/datajoint.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# djlabhub-docker\n\n## Table of Contents\n  - [Introduction](#introduction)\n  - [Quick Start](#quick-start)\n  - [Build Jupyterhub Singleuser Image](#build-jupyterhub-singleuser-image)\n    - [Configuration](#configuration)\n    - [Build](#build)\n    - [Test in Local Jupyterhub](#test-in-local-jupyterhub)\n      - [Local Jupyterhub Configuration](#local-jupyterhub-configuration)\n      - [Start Local Jupyterhub](#start-local-jupyterhub)\n\n## Introduction\n\nThis image is made for building customized jupyterhub profile/server option images. It was originally based on [datajoint/djlab](https://github.com/datajoint/djlab-docker) all the way up to [datajoint/djbase](https://github.com/datajoint/djbase-docker). To reduce the maintenance effort, we decided to use quay.io/jupyter/minimal-notebook as the base image. We also kept the previous implementation under `legacy` directory, just in case there are unforeseen issues with the new implementation.\n\n\u003e **Note**: `datajoint/djlab` is deprecated since the `singleuser` part of this image overlaps with the `djlab` image, it'll run jupyter lab server by default.\n\n\n## Quick Start\nDirectory explain:\n- `~/legacy` contains the old implementation of the image\n- `~/singleuser` is used to build the jupyterhub profile images\n- `~/hub` is a Docker based jupyterhub host server using DockerSpawner and Docker-in-Docker to launch jupyterhub singleuser server as a Docker container, in order to locally validate the singleuser images for development purpose.(**Don't recommend to use this in production, due to the security concern of Docker-in-Docker**)\n\n\n## Build Jupyterhub Singleuser Image\n\n### Configuration\nWe put all the dependencies in the `~/singleuser/config` directory including:\n- `apt_install.sh` for system level dependencies\n- `pip_requirements.txt` for python packages\n- `before_start_hook.sh` to run before the jupyterhub singleuser server starts, [doc](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#startup-hooks)\n- `jupyter**config.py` for jupyter related configurations\n  - Jupyter Server Config, [doc](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html#other-full-config)\n  - Jupyter Notebook Server Config, [doc](https://jupyter-notebook.readthedocs.io/en/5.7.4/config.html)\n  - Jupyter Lab Server Config, [doc](https://jupyterlab-server.readthedocs.io/en/latest/api/app-config.html)\n  - Optionally, you can add more configurations for ipython kernel, etc.\n\u003e **Note**: We added `jupyter**config.py` to extract configurations from the environment variables for some that are not supported to set by environment variables directly. The goal is to make the jupyterhub profile list clear and easy to maintain.\n\n### Build\n```\n# make the .env file from the example.env\nset -a \u0026\u0026 source .env \u0026\u0026 set +a\ndocker compose build\n\n# To run this image as local jupyterlab server for testing\n# The default password is set by the `JUPYTER_SERVER_APP_PASSWORD` in the container\ndocker compose up djlab\n```\n\n### Test in Local Jupyterhub\n#### Local Jupyterhub Configuration\nSimilarly to the singleuser image, we the `jupyterhub_config.py` in the `~/hub/config` directory, you need to modify the `c.DockerSpawner.container_image` and `c.DockerSpawner.environment` to configure your singleuser server container.\n\n#### Start Local Jupyterhub\n\u003e **Note**: Local Jupyterhub requires jupyterhub host container to mount `/var/run/docker.sock:/var/run/docker.sock` to enable Docker-in-Docker, [doc](https://devopscube.com/run-docker-in-docker/) \n```\n# make the .env file from the example.env\n# OAUTH2 related configurations are not necessary\n# since the c.JupyterHub.authenticator_class = \"jupyterhub.auth.DummyAuthenticator\"\nset -a \u0026\u0026 source .env \u0026\u0026 set +a\n\n# It takes any random username and password\ndocker compose up\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatajoint%2Fdjlabhub-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatajoint%2Fdjlabhub-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatajoint%2Fdjlabhub-docker/lists"}