Name | civis-jupyter-notebook JSON |
Version |
2.2.1
JSON |
| download |
home_page | None |
Summary | A tool for building Docker images for Civis Platform Jupyter notebooks |
upload_time | 2024-08-15 18:22:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | BSD-3-Clause |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
civis-jupyter-notebook
======================
[![PyPI version](https://badge.fury.io/py/civis-jupyter-notebook.svg)](https://pypi.org/project/civis-jupyter-notebook/)
[![CircleCI Builds](https://circleci.com/gh/civisanalytics/civis-jupyter-notebook.svg?style=shield)](https://circleci.com/gh/civisanalytics/civis-jupyter-notebook)
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](example/Dockerfile) for more details.
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](./tests/build_dev_image.sh) and [tests/run_dev_image.sh](./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.txt](./LICENSE.txt) for details.
The file [terminal.js](./src/civis_jupyter_notebooks/assets/extensions/terminal.js) contains code from [jupyter/nbclassic](https://github.com/jupyter/nbclassic/blob/b6257e966f47951b49f661bd129de1fc794079c2/nbclassic/static/base/js/utils.js).
As noted in the file, that code is Copyright (c) Jupyter Development Team and has a BSD-3 license.
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/75/4b/737db8aac8b43c288a901e676ddd714d674bf5be35e251b379cd50f339fa/civis_jupyter_notebook-2.2.1.tar.gz",
"platform": null,
"description": "civis-jupyter-notebook\n======================\n\n[![PyPI version](https://badge.fury.io/py/civis-jupyter-notebook.svg)](https://pypi.org/project/civis-jupyter-notebook/)\n[![CircleCI Builds](https://circleci.com/gh/civisanalytics/civis-jupyter-notebook.svg?style=shield)](https://circleci.com/gh/civisanalytics/civis-jupyter-notebook)\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```\nENV DEFAULT_KERNEL=<your kernel> # set to python3 or ir\n\nRUN pip install civis-jupyter-notebook && \\\n civis-jupyter-notebooks-install\n\n# Add Tini\nENV TINI_VERSION=v0.19.0\nADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini\nRUN chmod +x /tini\n\nEXPOSE 8888\nWORKDIR /root/work\nENTRYPOINT [\"/tini\", \"--\"]\nCMD [\"civis-jupyter-notebooks-start\"]\n```\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](example/Dockerfile) for more details.\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```\nPLATFORM_OBJECT_ID=<NOTEBOOK ID>\nCIVIS_API_KEY=<YOUR CIVIS API KEY>\n```\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](./tests/build_dev_image.sh) and [tests/run_dev_image.sh](./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```\n./tests/build_dev_image.sh\n./tests/run_dev_image.sh <NOTEBOOK ID>\n```\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.txt](./LICENSE.txt) for details.\n\nThe file [terminal.js](./src/civis_jupyter_notebooks/assets/extensions/terminal.js) contains code from [jupyter/nbclassic](https://github.com/jupyter/nbclassic/blob/b6257e966f47951b49f661bd129de1fc794079c2/nbclassic/static/base/js/utils.js).\nAs noted in the file, that code is Copyright (c) Jupyter Development Team and has a BSD-3 license.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A tool for building Docker images for Civis Platform Jupyter notebooks",
"version": "2.2.1",
"project_urls": {
"Homepage": "https://www.civisanalytics.com",
"Source": "https://github.com/civisanalytics/civis-jupyter-notebook"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82dbfc450693aeba8946af3e6c883c0bb3dbed8b1a7a67386f44f2536a447970",
"md5": "33568fd97e4c50e66651754062b82a80",
"sha256": "f46357fd7f9cb099d6e08ba4c502a1bf0e3acb6abe5cb5e706da2ff0043d2796"
},
"downloads": -1,
"filename": "civis_jupyter_notebook-2.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "33568fd97e4c50e66651754062b82a80",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 84815,
"upload_time": "2024-08-15T18:23:05",
"upload_time_iso_8601": "2024-08-15T18:23:05.381847Z",
"url": "https://files.pythonhosted.org/packages/82/db/fc450693aeba8946af3e6c883c0bb3dbed8b1a7a67386f44f2536a447970/civis_jupyter_notebook-2.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "754b737db8aac8b43c288a901e676ddd714d674bf5be35e251b379cd50f339fa",
"md5": "2a193bf76f96b01c4bbf056023fa8e40",
"sha256": "abd49283dfe12aa3e79661c3c60740af60591235277d51078522dc6ddd839819"
},
"downloads": -1,
"filename": "civis_jupyter_notebook-2.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2a193bf76f96b01c4bbf056023fa8e40",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 83134,
"upload_time": "2024-08-15T18:22:41",
"upload_time_iso_8601": "2024-08-15T18:22:41.192201Z",
"url": "https://files.pythonhosted.org/packages/75/4b/737db8aac8b43c288a901e676ddd714d674bf5be35e251b379cd50f339fa/civis_jupyter_notebook-2.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-15 18:22:41",
"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"
}