A tool for building Docker images for Civis Platform Jupyter notebooks.
Project description
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:
RUN pip install civis-jupyter-notebook && \ civis-jupyter-notebooks-install # Add Tini ENV TINI_VERSION v0.16.1 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini ENV DEFAULT_KERNEL <your kernel> # set to one of python3, python2 or ir 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., one of python2, python3, or ir). Note that your Dockerfile must use root as the default user.
See the example Docker image for more details.
Integration Testing with the Civis Platform
If you would like to test your image’s integration with the Civis Platform locally follow the steps below:
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>.
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>
Build your image locally: docker build -t test ..
Run the container: docker run --rm -p 8888:8888 --env-file my.env test.
Access the notebook at the ip of your Docker host with port 8888 (e.g., http://localhost:8888/notebooks/notebook.ipynb).
Contributing
See CONTIBUTING.md for information about contributing to this project.
License
BSD-3
See LICENSE.md for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for civis-jupyter-notebook-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9098bfb85f13cf804e14f8a92cedb55a946faae4b54c8e211f83f9febfb016f |
|
MD5 | 0ec62c2e47fb0cbc8d50027a2451f7b1 |
|
BLAKE2b-256 | f30c888a8abc4de9bbdc852fed78d341857f5af0965d5952a7083dc320acc040 |