Name | civis-jupyter-notebook JSON |
Version |
2.2.0
JSON |
| download |
home_page | None |
Summary | A tool for building Docker images for Civis Platform Jupyter notebooks |
upload_time | 2024-06-11 17:48:21 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | BSD-3-Clause |
keywords |
|
VCS |
![](/static/img/github-24-000000.png) |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
civis-jupyter-notebook
======================
.. image:: https://circleci.com/gh/civisanalytics/civis-jupyter-notebook.svg?style=shield
:target: https://circleci.com/gh/civisanalytics/civis-jupyter-notebook
:alt: CircleCI Builds
A tool to enable any Docker image to be used with Civis Platform Jupyter notebooks.
Usage
-----
In your ``Dockerfile``, put the following code at the end::
ENV DEFAULT_KERNEL <your kernel> # set to python3 or ir
RUN pip install civis-jupyter-notebook && \
civis-jupyter-notebooks-install
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
EXPOSE 8888
WORKDIR /root/work
ENTRYPOINT ["/tini", "--"]
CMD ["civis-jupyter-notebooks-start"]
Here you need to replace ``<your kernel>`` with the name of your kernel (e.g.,
``python3`` or ``ir``). Note that your Dockerfile must use
``root`` as the default user.
See the `example`_ Docker image for more details.
.. _example: example
Integration Testing Docker Images with Civis Platform
-----------------------------------------------------
If you would like to test your image's integration with Civis Platform locally follow the steps below:
1. Create a notebook in your Civis Platform account and grab the ID of the notebook. This ID is the number
that appears at the end of the URL for the notebook, ``https://platform.civisanalytics.com/#/notebooks/<NOTEBOOK ID>``.
2. Create an environment file called ``my.env`` and add the following to it::
PLATFORM_OBJECT_ID=<NOTEBOOK ID>
CIVIS_API_KEY=<YOUR CIVIS API KEY>
3. Build your image locally: ``docker build -t test .``.
4. Run the container: ``docker run --rm -p 8888:8888 --env-file my.env test``.
5. Access the notebook at the ip of your Docker host with port 8888 (e.g., ``http://localhost:8888/notebooks/notebook.ipynb``).
Integration Testing Code Changes with Civis Platform
----------------------------------------------------
The scripts ``tests/build_dev_image.sh`` and ``tests/run_dev_image.sh`` can be used to test the
integration of code changes with Civis Platform.
From the top directory in the repo type::
$ ./tests/build_dev_image.sh
$ ./tests/run_dev_image.sh <NOTEBOOK ID>
where ``<NOTEBOOK ID>`` is the ID of a Civis Platform notebook. See step 1 above if you do not
have a notebook ID. Then you can connect to the notebook from your local browser and check
to make sure it is working properly.
Contributing
------------
See ``CONTRIBUTING.md`` for information about contributing to this project.
License
-------
BSD-3
See ``LICENSE.md`` for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "civis-jupyter-notebook",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Civis Analytics <opensource@civisanalytics.com>",
"download_url": "https://files.pythonhosted.org/packages/38/3a/4fcb5717cafed39d59976beec805680a9afab4a556889adc64b81411e313/civis_jupyter_notebook-2.2.0.tar.gz",
"platform": null,
"description": "civis-jupyter-notebook\n======================\n\n.. image:: https://circleci.com/gh/civisanalytics/civis-jupyter-notebook.svg?style=shield\n :target: https://circleci.com/gh/civisanalytics/civis-jupyter-notebook\n :alt: CircleCI Builds\n\nA tool to enable any Docker image to be used with Civis Platform Jupyter notebooks.\n\nUsage\n-----\n\nIn your ``Dockerfile``, put the following code at the end::\n\n ENV DEFAULT_KERNEL <your kernel> # set to python3 or ir\n\n RUN pip install civis-jupyter-notebook && \\\n civis-jupyter-notebooks-install\n\n # Add Tini\n ENV TINI_VERSION v0.19.0\n ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini\n RUN chmod +x /tini\n\n EXPOSE 8888\n WORKDIR /root/work\n ENTRYPOINT [\"/tini\", \"--\"]\n CMD [\"civis-jupyter-notebooks-start\"]\n\nHere you need to replace ``<your kernel>`` with the name of your kernel (e.g.,\n``python3`` or ``ir``). Note that your Dockerfile must use\n``root`` as the default user.\n\nSee the `example`_ Docker image for more details.\n\n.. _example: example\n\nIntegration Testing Docker Images with Civis Platform\n-----------------------------------------------------\n\nIf you would like to test your image's integration with Civis Platform locally follow the steps below:\n\n1. Create a notebook in your Civis Platform account and grab the ID of the notebook. This ID is the number\n that appears at the end of the URL for the notebook, ``https://platform.civisanalytics.com/#/notebooks/<NOTEBOOK ID>``.\n2. Create an environment file called ``my.env`` and add the following to it::\n\n PLATFORM_OBJECT_ID=<NOTEBOOK ID>\n CIVIS_API_KEY=<YOUR CIVIS API KEY>\n\n3. Build your image locally: ``docker build -t test .``.\n4. Run the container: ``docker run --rm -p 8888:8888 --env-file my.env test``.\n5. Access the notebook at the ip of your Docker host with port 8888 (e.g., ``http://localhost:8888/notebooks/notebook.ipynb``).\n\nIntegration Testing Code Changes with Civis Platform\n----------------------------------------------------\n\nThe scripts ``tests/build_dev_image.sh`` and ``tests/run_dev_image.sh`` can be used to test the\nintegration of code changes with Civis Platform.\n\nFrom the top directory in the repo type::\n\n $ ./tests/build_dev_image.sh\n $ ./tests/run_dev_image.sh <NOTEBOOK ID>\n\nwhere ``<NOTEBOOK ID>`` is the ID of a Civis Platform notebook. See step 1 above if you do not\nhave a notebook ID. Then you can connect to the notebook from your local browser and check\nto make sure it is working properly.\n\nContributing\n------------\n\nSee ``CONTRIBUTING.md`` for information about contributing to this project.\n\nLicense\n-------\n\nBSD-3\n\nSee ``LICENSE.md`` for details.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A tool for building Docker images for Civis Platform Jupyter notebooks",
"version": "2.2.0",
"project_urls": {
"Homepage": "https://www.civisanalytics.com",
"Source": "https://github.com/civisanalytics/civis-jupyter-notebook"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "839ca4ad7675f50010d62f846d20e4e68dc7194eb3d19a971f19af90321970e5",
"md5": "67a548b50c6b87069d7bf25d821eb139",
"sha256": "e2da2edf90aa47f53ce06a9da50f1722121a2b76fa28a6728463db21e93412a0"
},
"downloads": -1,
"filename": "civis_jupyter_notebook-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "67a548b50c6b87069d7bf25d821eb139",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 83607,
"upload_time": "2024-06-11T17:48:11",
"upload_time_iso_8601": "2024-06-11T17:48:11.597395Z",
"url": "https://files.pythonhosted.org/packages/83/9c/a4ad7675f50010d62f846d20e4e68dc7194eb3d19a971f19af90321970e5/civis_jupyter_notebook-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "383a4fcb5717cafed39d59976beec805680a9afab4a556889adc64b81411e313",
"md5": "3e15669b3c0868024a1269a3d999df73",
"sha256": "8c028accb4262dfc73b5aba7932a7e4d05e3a5cb45d0e15b21bb4c0491b2c05d"
},
"downloads": -1,
"filename": "civis_jupyter_notebook-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3e15669b3c0868024a1269a3d999df73",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 82009,
"upload_time": "2024-06-11T17:48:21",
"upload_time_iso_8601": "2024-06-11T17:48:21.100942Z",
"url": "https://files.pythonhosted.org/packages/38/3a/4fcb5717cafed39d59976beec805680a9afab4a556889adc64b81411e313/civis_jupyter_notebook-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-11 17:48:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "civisanalytics",
"github_project": "civis-jupyter-notebook",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "civis-jupyter-notebook"
}