Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manics/jupyterhub-ansiblespawner
Spawn JupyterHub single user notebook servers using Ansible
https://github.com/manics/jupyterhub-ansiblespawner
ansible jupyterhub jupyterhub-spawner spawner
Last synced: about 1 month ago
JSON representation
Spawn JupyterHub single user notebook servers using Ansible
- Host: GitHub
- URL: https://github.com/manics/jupyterhub-ansiblespawner
- Owner: manics
- License: bsd-3-clause
- Created: 2020-05-14T11:25:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:13:15.000Z (7 months ago)
- Last Synced: 2024-04-14T03:19:58.683Z (7 months ago)
- Topics: ansible, jupyterhub, jupyterhub-spawner, spawner
- Language: Python
- Size: 335 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AnsibleSpawner
[![PyPI version](https://badge.fury.io/py/ansiblespawner.svg)](https://pypi.org/project/ansiblespawner/)
[![GitHub Workflow](https://github.com/manics/jupyterhub-ansiblespawner/actions/workflows/workflow.yml/badge.svg)](https://github.com/manics/jupyterhub-ansiblespawner/actions/workflows/workflow.yml)Spawn [JupyterHub](https://github.com/jupyterhub/jupyterhub) single user notebook servers using [Ansible](https://www.ansible.com/).
This spawner runs Ansible playbooks to start, manage and stop JupyterHub singleuser servers.
This means any Ansible module can be used to orchestrate your singleuser servers, including [Docker and many public/private clouds](https://docs.ansible.com/ansible/2.9/modules/list_of_cloud_modules.html), and other infrastructure platforms supported by the community.
You can do things like create multiple storage volumes for each user, or provision additional services on other containers/VMs.## Prerequisites
Python 3.6 or above and JupyterHub 1.0.0 or above are required.
## Installation
## Configuration
Example `jupyterhub_config.py` spawner configuration.
```
ansible_path = "/path/to/"
c.JupyterHub.spawner_class = "ansible"
c.AnsibleSpawner.inventory = ansible_path + "inventory.yml.j2"
c.AnsibleSpawner.create_playbook = ansible_path + "create.yml"
c.AnsibleSpawner.update_playbook = ansible_path + "update.yml"
c.AnsibleSpawner.poll_playbook = ansible_path + "poll.yml"
c.AnsibleSpawner.destroy_playbook = ansible_path + "destroy.yml"
c.AnsibleSpawner.playbook_vars = {
"container_image": "docker.io/jupyter/base-notebook",
"ansible_python_interpreter": "python3",
}
c.AnsibleSpawner.start_timeout = 600
c.JupyterHub.hub_connect_ip = "10.0.0.1"
```## Examples
Example playbooks and configurations can be found under [`examples`](https://github.com/manics/jupyterhub-ansiblespawner/tree/main/examples).
- [AWS EC2](https://github.com/manics/jupyterhub-ansiblespawner/tree/main/examples/aws-ec2)
- [Docker](https://github.com/manics/jupyterhub-ansiblespawner/tree/main/examples/docker)
- [Podman](https://github.com/manics/jupyterhub-ansiblespawner/tree/main/examples/podman)
- [Openstack](https://github.com/manics/jupyterhub-ansiblespawner/tree/main/examples/openstack)## Development
Pytest is used to run automated tests that require [Docker](https://www.docker.com/) and [Podman](https://podman.io/).
These platforms were chosen because they are self-contained and can be installed in Travis, whereas testing with public cloud platforms requires secure access credentials.If you only have one of these you can limit tests by specifying a marker.
For example, to disable the Docker tests:pytest -vs -m "not docker"
To view test coverage run pytest with `--cov=ansiblespawner --cov-report=html`, then open `htmlcov/index.html`.
[setuptools-scm](https://pypi.org/project/setuptools-scm/) is used to manage versions.
Just create a git tag.