Skip to content

Commit

Permalink
[CIVIS-2326] ENH update base datascience-python image to 7.3.0 (#54)
Browse files Browse the repository at this point in the history
* ENH update base ds-py image to 7.3.0

* TST check that .ds_python_version and Dockerfile match for ds-py image version

* TST clearer test message

* MAINT update changelog
  • Loading branch information
jacksonlee-civis authored Jun 18, 2024
1 parent ae698bd commit 7b573eb
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 127 deletions.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@ version: 2
jobs:
build:
docker:
- image: cimg/python:3.11
- image: cimg/python:3.12
steps:
- checkout
- setup_remote_docker
- run:
name: Check that .ds_python_version and Dockerfile are consistent
command: |
python -u << HERE
import re
v1 = re.search(r"(\d+\.\d+.\d+)", open(".ds_python_version").read()).group(1)
v2 = re.search(r"ARG DS_PYTHON_IMG_VERSION\=(\d+\.\d+.\d+)", open("Dockerfile").read()).group(1)
if v1 == v2:
print(f".ds_python_version and Dockerfile match for the ds-py image version: {v1}")
else:
raise ValueError(
f".ds_python_version and Dockerfile don't match for the ds-py image version: {v1} and {v2}"
)
HERE
- run:
name: "Get civisanalytics/datascience-python image version"
command: echo 'export DS_PYTHON_IMG_VERSION="$(head -n 1 ./.ds_python_version)"' >> "$BASH_ENV"
Expand Down
2 changes: 1 addition & 1 deletion .ds_python_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.3.0
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: General
about: Ask a question, report a potential issue, etc.
title: ''
labels: ''
assignees: ''

---

**Note:** Civis employees should _not_ use the GitHub Issues feature at this public codebase
to file a ticket, and should instead use the internal ticketing system.
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


---

- [ ] (For Civis employees only) Reference to a relevant ticket in the pull request title
- [ ] Changelog entry added to `CHANGELOG.md` at the repo's root level
- [ ] Description of change in the pull request description
- [ ] If applicable, unit tests have been added and/or updated
- [ ] The CircleCI builds have all passed
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

## [3.1.0] - 2024-06-18
### Changed
- Updated base datascience-python image version to v7.3.0 (#54)
- Updated core Python dependency versions (#54):
* civis-jupyter-notebook 2.1.1 -> 2.2.0
* matplotlib 3.7.2 -> 3.9.0
* seaborn 0.12.2 -> 0.13.2

## [3.0.0] - 2023-08-22
### Changed
- update base datascience-python version to v7.0.0 (#50)
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Unfortunately Dockerhub isn't as flexible as CircleCi or AWS Codebuild, so we have to hardcode this value here.
# So if you in the future need to update this value, make sure you also edit the value in .ds_python_version.
# These values should be kept in sync.
ARG DS_PYTHON_IMG_VERSION=7.0.0
ARG DS_PYTHON_IMG_VERSION=7.3.0

FROM civisanalytics/datascience-python:${DS_PYTHON_IMG_VERSION}

Expand Down Expand Up @@ -33,8 +33,7 @@ RUN chmod +x /tini

COPY requirements-full.txt .

RUN pip install -r requirements-full.txt && \
pip cache purge && \
RUN pip install --progress-bar off --no-cache-dir -r requirements-full.txt && \
rm requirements-full.txt && \
civis-jupyter-notebooks-install

Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Civis Jupyter Notebook Docker Image for Python 3
[![CircleCI](https://circleci.com/gh/civisanalytics/civis-jupyter-python3/tree/master.svg?style=svg)](https://circleci.com/gh/civisanalytics/civis-jupyter-python3/tree/master)
[![CircleCI](https://circleci.com/gh/civisanalytics/civis-jupyter-python3/tree/master.svg?style=shield)](https://circleci.com/gh/civisanalytics/civis-jupyter-python3/tree/master)

## Installation

Expand All @@ -24,7 +24,7 @@ The version number has been pulled out into a dedicated file to centralize consu

To update the version simply change the version number in `.ds_python_version`

## Testing Integration with the Civis Platform
## Testing Integration with Civis Platform

If you would like to test the image locally follow the steps below:

Expand All @@ -46,10 +46,29 @@ and describe any changes in the [change log](CHANGELOG.md).

### For Maintainers

#### Updating Dependencies

Updating the `civis-jupyter-python3` Docker image entails the following:

* Update the base `datascience-python` image to the latest one;
* Update `requirements-core.txt`, the Python dependencies specific to this `civis-jupyter-python3` image.
* Update `requirements-full.txt` so that it has all transitive dependencies pinned
while respecting those already pinned at both `datascience-python` and `requirements-core.txt`.

To execute these updates, follow these steps:

* Update the version number of the `datascience-python` image in both `Dockerfile` and `.ds_python_version`.
* Update the Python dependencies in `requirements-core.txt` as necessary.
* Locally, have Docker Desktop running in prep for the next step.
* Run `sh generate-requirements-full.sh` to update `requirements-full.txt`.
* To verify the new `civis-jupyter-python3` image would successfully build with your changes, locally run `sh build_docker_file.sh`.

#### Making a New Releases

This repo has autobuild enabled. Any PR that is merged to master will
be built as the `latest` tag on Dockerhub.
Once you are ready to create a new version, 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
"Draft a new release". GitHub will prompt you to create a new tag, release title, and release
description. The tag should use semantic versioning in the form "vX.X.X"; "major.minor.micro".
The title of the release should be the same as the tag. Include a change log in the release description.
Once the release is tagged, DockerHub will automatically build three identical containers, with labels
Expand All @@ -59,4 +78,4 @@ Once the release is tagged, DockerHub will automatically build three identical c

BSD-3

See [LICENSE.md](LICENSE.md) for details.
See [LICENSE.txt](LICENSE.txt) for details.
2 changes: 1 addition & 1 deletion generate-requirements-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ docker run \
"pip freeze >> /tmp/requirements-aggregated-core.txt && \
cat /src/requirements-core.txt >> /tmp/requirements-aggregated-core.txt && \
pip install pip-tools && \
pip-compile --output-file=/src/requirements-full.txt --pip-args='--prefer-binary' /tmp/requirements-aggregated-core.txt"
pip-compile --output-file=/src/requirements-full.txt --pip-args='--prefer-binary' --upgrade /tmp/requirements-aggregated-core.txt"
6 changes: 3 additions & 3 deletions requirements-core.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
matplotlib==3.7.2
seaborn==0.12.2
civis-jupyter-notebook==2.1.1
civis-jupyter-notebook==2.2.0
matplotlib==3.9.0
seaborn==0.13.2
Loading

0 comments on commit 7b573eb

Please sign in to comment.