Either build the Docker image locally
./build_docker_file.shor download the image from DockerHub
docker pull civisanalytics/civis-jupyter-python3:latestThe latest tag (Docker's default if you don't specify a tag)
will give you the most recently-built version of the civis-jupyter-python3
image. You can replace the tag latest with a version number such as 1.0
to retrieve a reproducible environment.
The version number has been pulled out into a dedicated file to centralize consumption of the file through the scripts that require it.
To update the version simply change the version number in .ds_python_version
If you would like to test the image 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/
- Grab a Civis API Key from your account. How to Generate a Civis API Key
- Build your image locally:
./build_docker_file.sh - Run the container:
docker run --rm -p 8888:8888 -e PLATFORM_OBJECT_ID=<NOTEBOOK ID> -e CIVIS_API_KEY=$CIVIS_API_KEY civis-jupyter-python3(This assumes $CIVIS_API_KEY is set in your environment.) - Access the notebook at the ip of your docker host with port 8888 i.e.
<docker-host-ip>:8888
See CONTRIBUTING for information about contributing to this project.
If you make any changes, be sure to build a container to verify that it successfully completes:
./build_docker_file.shand describe any changes in the change log.
Updating the civis-jupyter-python3 Docker image entails the following:
- Update the base
datascience-pythonimage to the latest one; - Update
requirements-core.txt, the Python dependencies specific to thiscivis-jupyter-python3image. - Update
requirements-full.txtso that it has all transitive dependencies pinned while respecting those already pinned at bothdatascience-pythonandrequirements-core.txt.
To execute these updates, follow these steps:
- Update the version number of the
datascience-pythonimage in.ds_python_version. - Update the Python dependencies in
requirements-core.txtas necessary. - Locally, have Docker Desktop running in prep for the next step.
- Run
sh generate-requirements-full.shto updaterequirements-full.txt. - To verify the new
civis-jupyter-python3image would successfully build with your changes, locally runsh build_docker_file.sh.
Publishing to DockerHub is handled by GitHub Actions (see .github/workflows). Both publishing workflows build the image and run the smoke checks before they push anything.
The workflows use no stored DockerHub password or access token. They authenticate
over OIDC: each run exchanges a GitHub identity token for a DockerHub token that
expires within minutes. This requires two things a repository admin must set up
once -- an OIDC connection on the civisanalytics DockerHub organization, and a
DOCKERHUB_OIDC_CONNECTIONID repository variable holding that connection's ID
(it is an identifier, not a secret). The publishing jobs also run in a
dockerhub-publish environment restricted to master and v*.*.*.
Any PR merged to master is published as the latest tag on DockerHub.
To cut a new version:
- Move the
Unreleasedsection of the change log under a[major.minor.micro]heading. Do this before tagging -- the release workflow refuses to publish if the change log's newest version doesn't match the tag. - Once that is merged, go to the "releases" tab of the repository and click "Draft a new release". GitHub will prompt you to create a new tag, release title, and release description. The tag must use semantic versioning in the form "vX.Y.Z", for for the "major.minor.micro" version numbers. The leading "v" is required -- tags without it won't trigger a build. The title of the release should be the same as the tag. Include a change log in the release description.
- Publishing the release creates the tag, which builds and pushes three identical containers labelled "major", "major.minor", and "major.minor.micro".
BSD-3
See LICENSE.txt for details.