Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Commit 1141f4b

Browse files
committed
Initial commit
1 parent 8438465 commit 1141f4b

23 files changed

+888
-2
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ db.sqlite3
6060
instance/
6161
.webassets-cache
6262

63+
# PyCharm/JetBrains stuff:
64+
.idea/
65+
6366
# Scrapy stuff:
6467
.scrapy
6568

Diff for: CONTRIBUTING.rst

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.. highlight:: shell
2+
3+
============
4+
Contributing
5+
============
6+
7+
Contributions are welcome, and they are greatly appreciated! Every little bit
8+
helps, and credit will always be given.
9+
10+
You can contribute in many ways:
11+
12+
Types of Contributions
13+
----------------------
14+
15+
Report Bugs
16+
~~~~~~~~~~~
17+
18+
Report bugs at https://github.com/gateway-experiments/docker_kernel_provider/issues.
19+
20+
If you are reporting a bug, please include:
21+
22+
* Your operating system name and version.
23+
* Any details about your local setup that might be helpful in troubleshooting.
24+
* Detailed steps to reproduce the bug.
25+
26+
Fix Bugs
27+
~~~~~~~~
28+
29+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30+
wanted" is open to whoever wants to implement it.
31+
32+
Implement Features
33+
~~~~~~~~~~~~~~~~~~
34+
35+
Look through the GitHub issues for features. Anything tagged with "enhancement"
36+
and "help wanted" is open to whoever wants to implement it.
37+
38+
Write Documentation
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
Docker Kernel Provider could always use more documentation, whether as part of the
42+
official Docker Kernel Provider docs, in docstrings, or even on the web in blog posts,
43+
articles, and such.
44+
45+
Submit Feedback
46+
~~~~~~~~~~~~~~~
47+
48+
The best way to send feedback is to file an issue at https://github.com/gateway-experiments/docker_kernel_provider/issues.
49+
50+
If you are proposing a feature:
51+
52+
* Explain in detail how it would work.
53+
* Keep the scope as narrow as possible, to make it easier to implement.
54+
* Remember that this is a volunteer-driven project, and that contributions
55+
are welcome :)
56+
57+
Get Started!
58+
------------
59+
60+
Ready to contribute? Here's how to set up `docker_kernel_provider` for local development.
61+
62+
1. Fork the `docker_kernel_provider` repo on GitHub.
63+
2. Clone your fork locally::
64+
65+
$ git clone [email protected]:your_name_here/docker_kernel_provider.git
66+
67+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68+
69+
$ mkvirtualenv docker_kernel_provider
70+
$ cd docker_kernel_provider/
71+
$ python setup.py develop
72+
73+
4. Create a branch for local development::
74+
75+
$ git checkout -b name-of-your-bugfix-or-feature
76+
77+
Now you can make your changes locally.
78+
79+
5. When you're done making changes, check that your changes pass flake8 and the
80+
tests, including testing other Python versions with tox::
81+
82+
$ flake8 docker_kernel_provider tests
83+
$ python setup.py test or py.test
84+
$ tox
85+
86+
To get flake8 and tox, just pip install them into your virtualenv.
87+
88+
6. Commit your changes and push your branch to GitHub::
89+
90+
$ git add .
91+
$ git commit -m "Your detailed description of your changes."
92+
$ git push origin name-of-your-bugfix-or-feature
93+
94+
7. Submit a pull request through the GitHub website.
95+
96+
Pull Request Guidelines
97+
-----------------------
98+
99+
Before you submit a pull request, check that it meets these guidelines:
100+
101+
1. The pull request should include tests.
102+
2. If the pull request adds functionality, the docs should be updated. Put
103+
your new functionality into a function with a docstring, and add the
104+
feature to the list in README.rst.
105+
3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and for PyPy. Check
106+
https://travis-ci.org/gateway-experiments/docker_kernel_provider/pull_requests
107+
and make sure that the tests pass for all supported Python versions.
108+
109+
Tips
110+
----
111+
112+
To run a subset of tests::
113+
114+
115+
$ python -m unittest tests.test_docker_kernel_provider
116+
117+
Deploying
118+
---------
119+
120+
A reminder for the maintainers on how to deploy.
121+
Make sure all your changes are committed (including an entry in HISTORY.rst).
122+
Then run::
123+
124+
$ bumpversion patch # possible: major / minor / patch
125+
$ git push
126+
$ git push --tags
127+
128+
Travis will then deploy to PyPI if tests pass.

Diff for: HISTORY.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=======
2+
History
3+
=======
4+
5+
0.1.0 (2019-05-30)
6+
------------------
7+
8+
* First release on PyPI.

Diff for: MANIFEST.in

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include CONTRIBUTING.rst
2+
include HISTORY.rst
3+
include LICENSE
4+
include README.rst
5+
6+
recursive-include tests *
7+
recursive-exclude * __pycache__
8+
recursive-exclude * *.py[co]
9+
10+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

Diff for: Makefile

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.PHONY: clean clean-test clean-pyc clean-build docs help
2+
.DEFAULT_GOAL := help
3+
4+
help:
5+
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
6+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
7+
8+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
9+
10+
clean-build: ## remove build artifacts
11+
rm -fr build/
12+
rm -fr dist/
13+
rm -fr .eggs/
14+
find . -name '*.egg-info' -exec rm -fr {} +
15+
find . -name '*.egg' -exec rm -f {} +
16+
17+
clean-pyc: ## remove Python file artifacts
18+
find . -name '*.pyc' -exec rm -f {} +
19+
find . -name '*.pyo' -exec rm -f {} +
20+
find . -name '*~' -exec rm -f {} +
21+
find . -name '__pycache__' -exec rm -fr {} +
22+
23+
clean-test: ## remove test and coverage artifacts
24+
rm -fr .tox/
25+
rm -f .coverage
26+
rm -fr htmlcov/
27+
rm -fr .pytest_cache
28+
29+
lint: ## check style with flake8
30+
flake8 docker_kernel_provider
31+
32+
test: ## run tests quickly with the default Python
33+
python setup.py test
34+
35+
docs: ## generate Sphinx HTML documentation, including API docs
36+
rm -f docs/docker_kernel_provider.rst
37+
rm -f docs/modules.rst
38+
sphinx-apidoc -o docs/ docker_kernel_provider
39+
$(MAKE) -C docs clean
40+
$(MAKE) -C docs html
41+
42+
release: dist ## package and upload a release
43+
twine upload dist/*
44+
45+
dist: clean ## builds source and wheel package
46+
python setup.py sdist
47+
python setup.py bdist_wheel
48+
ls -l dist
49+
50+
install: clean ## install the package to the active Python's site-packages
51+
python setup.py install

Diff for: README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# docker_kernel_provider
2-
Kernel provider used to manage Jupyter kernels in Docker or Docker Swarm clusters
1+
# Docker Kernel Provider
2+
3+
__NOTE: This repository is experimental and undergoing frequent changes!__
4+
5+
The Docker Kernel Provider package provides support necessary for launching and managing Jupyter kernels within Docker or Docker Swarm clusters. This is accomplished via two classes:
6+
7+
1. [`DockerKernelProvider`](https://github.com/gateway-experiments/docker_kernel_provider/blob/master/docker_kernel_provider/provider.py) is invoked by the application to locate and identify specific kernel specificiations (kernelspecs) that manage kernel lifecycles within Docker configurations.
8+
2. Either of [`DockerSwarmKernelLifecycleManager`](https://github.com/gateway-experiments/docker_kernel_provider/blob/master/docker_kernel_provider/docker_swarm.py) or [`DockerKernelLifecycleManager`](https://github.com/gateway-experiments/docker_kernel_provider/blob/master/docker_kernel_provider/docker_swarm.py) depending on the content of the `docker_kernel.json` file. One of these classes is instantiated by the [`RemoteKernelManager`](https://github.com/gateway-experiments/remote_kernel_provider/blob/master/remote_kernel_provider/manager.py) to peform the kernel lifecycle management. This class performs post-launch discovery of the kernel container and handles its termination via the [docker-py](https://github.com/docker/docker-py) python API.
9+
10+
## Installation
11+
`DockerKernelProvider` is a pip-installable package:
12+
```bash
13+
pip install docker_kernel_provider
14+
```
15+
16+
## Docker Kernel Specifications
17+
Criteria for discovery of the kernel specification via the `DockerKernelProvider` is that a `docker_kernel.json` file exist in a sub-directory of `kernels`.

Diff for: docker_kernel_provider/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""Top-level package for Kubernetes Kernel Provider."""
4+
5+
__author__ = """Jupyter Development Team"""
6+
__email__ = '[email protected]'
7+
__version__ = '0.1.0'

Diff for: docker_kernel_provider/_version.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version_info = (0, 1, 0, 'dev0')
2+
__version__ = '.'.join(map(str, version_info))

0 commit comments

Comments
 (0)