Skip to content

Commit 6e6c4bc

Browse files
committed
Pin and automate doing isolated bumps of hub image dependencies' major versions
1 parent dd58e99 commit 6e6c4bc

File tree

8 files changed

+72
-59
lines changed

8 files changed

+72
-59
lines changed

.github/dependabot.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ updates:
1515
interval: monthly
1616
time: "05:00"
1717
timezone: Etc/UTC
18+
- package-ecosystem: pip
19+
directory: /images/hub/unfrozen
20+
labels: [breaking]
21+
groups:
22+
major-versions:
23+
update-types: [major]
24+
exclude-patterns:
25+
- jupyterhub # bumped by other automation
26+
schedule:
27+
interval: daily
28+
time: "05:00"
29+
timezone: Etc/UTC

.github/workflows/watch-dependencies.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# - Watch multiple images tags referenced in values.yaml to match the latest
55
# image tag.
66
#
7-
# - Watch the jupyterhub pinning in images/*/requirements.in to match the
7+
# - Watch the jupyterhub pinning in images/*/unfrozen/requirements.txt to match the
88
# latest jupyterhub version available on PyPI, and if doing this, also
99
# refreeze images/*/requirements.txt.
1010
#
@@ -20,7 +20,7 @@ name: Watch dependencies
2020
on:
2121
push:
2222
paths:
23-
- "images/*/requirements.in"
23+
- "images/*/unfrozen/requirements.txt"
2424
- ".github/workflows/watch-dependencies.yaml"
2525
branches: ["main"]
2626
schedule:
@@ -142,10 +142,10 @@ jobs:
142142
- name: Install Python dependencies
143143
run: pip install packaging requests
144144

145-
- name: Get images/hub/requirements.in pinned version of jupyterhub
145+
- name: Get images/hub/unfrozen/requirements.txt pinned version of jupyterhub
146146
id: local
147147
run: |
148-
local_version=$(cat images/hub/requirements.in | grep 'jupyterhub==' | sed 's/jupyterhub==//')
148+
local_version=$(cat images/hub/unfrozen/requirements.txt | grep 'jupyterhub==' | sed 's/jupyterhub==//')
149149
echo "version=$local_version" >> $GITHUB_OUTPUT
150150
151151
- name: Get latest version of jupyterhub
@@ -168,11 +168,11 @@ jobs:
168168
if: steps.local.outputs.version != steps.latest.outputs.version
169169
run: |
170170
for img in hub singleuser-sample; do
171-
sed --in-place 's/jupyterhub==${{ steps.local.outputs.version }}/jupyterhub==${{ steps.latest.outputs.version }}/g' images/$img/requirements.in
171+
sed --in-place 's/jupyterhub==${{ steps.local.outputs.version }}/jupyterhub==${{ steps.latest.outputs.version }}/g' images/$img/unfrozen/requirements.txt
172172
done
173173
sed --in-place 's/appVersion: "${{ steps.local.outputs.version }}"/appVersion: "${{ steps.latest.outputs.version }}"/g' jupyterhub/Chart.yaml
174174
175-
- name: Refreeze images/*/requirements.txt based on images/*/requirements.in
175+
- name: Refreeze images/*/requirements.txt based on images/*/unfrozen/requirements.txt
176176
if: steps.local.outputs.version != steps.latest.outputs.version
177177
run: ci/refreeze
178178

@@ -208,7 +208,7 @@ jobs:
208208
steps:
209209
- uses: actions/checkout@v4
210210

211-
- name: Refreeze images/*/requirements.txt based on images/*/requirements.in
211+
- name: Refreeze images/*/requirements.txt based on images/*/unfrozen/requirements.txt
212212
run: ci/refreeze
213213

214214
- name: git diff
@@ -227,4 +227,4 @@ jobs:
227227
title: "hub image: refreeze requirements.txt"
228228
body: >-
229229
The hub image's requirements.txt has been refrozen based on
230-
requirements.in.
230+
unfrozen/requirements.txt.

ci/refreeze

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ for img in ${IMAGES}; do
1414
--workdir=/io \
1515
--user=root \
1616
python:3.12-bookworm \
17-
sh -c 'pip install pip-tools==7.* && pip-compile --allow-unsafe --strip-extras --upgrade'
17+
sh -c 'pip install pip-tools==7.* && pip-compile --allow-unsafe --strip-extras --upgrade --output-file=requirements.txt unfrozen/requirements.txt'
1818
popd
1919
done

images/hub/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The Dockerfile in this folder is built by
44
[chartpress](https://github.com/jupyterhub/chartpress#readme), using the
55
requirements.txt file. The requirements.txt file is updated based on the
6-
requirements.in file using [`pip-compile`](https://pip-tools.readthedocs.io).
6+
unfrozen/requirements.txt file using [`pip-compile`](https://pip-tools.readthedocs.io).
77

88
## How to update requirements.txt
99

images/hub/requirements.in

Lines changed: 0 additions & 32 deletions
This file was deleted.

images/hub/unfrozen/requirements.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file is the input to requirements.txt, which is a frozen version of this.
2+
#
3+
# To update:
4+
# - the jupyterhub version or the frozen requirements.txt file, use the
5+
# "Run workflow" button at https://github.com/jupyterhub/zero-to-jupyterhub-k8s/actions/workflows/watch-dependencies.yaml.
6+
# - the major version pins in this file, trigger dependabot to run via
7+
# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/network/updates
8+
#
9+
10+
# JupyterHub itself
11+
jupyterhub==5.2.1
12+
13+
# JupyterHub Spawner, kubernetes specific
14+
jupyterhub-kubespawner==7.*
15+
16+
# JupyterHub Authenticator choices
17+
jupyterhub-firstuseauthenticator==1.*
18+
jupyterhub-hmacauthenticator==1.*
19+
jupyterhub-ldapauthenticator==2.*
20+
jupyterhub-ltiauthenticator==1.*
21+
jupyterhub-nativeauthenticator==1.*
22+
jupyterhub-tmpauthenticator==1.*
23+
oauthenticator[googlegroups,mediawiki]==17.*
24+
25+
# JupyterHub service shutting servers after a period of inactivity
26+
jupyterhub-idle-culler==1.*
27+
28+
# Other optional dependencies for additional features
29+
pymysql==1.* # mysql
30+
psycopg2==2.* # postgres
31+
pycurl==7.* # internal http requests handle more load with pycurl
32+
sqlalchemy-cockroachdb==2.* # cocroachdb
33+
statsd==4.* # statsd metrics collection (TODO: remove soon, since folks use prometheus)

images/singleuser-sample/requirements.in

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is the input to requirements.txt, which is a frozen version of this.
2+
#
3+
# To update:
4+
# - the jupyterhub version or the frozen requirements.txt file, use the
5+
# "Run workflow" button at https://github.com/jupyterhub/zero-to-jupyterhub-k8s/actions/workflows/watch-dependencies.yaml.
6+
#
7+
8+
# JupyterHub itself, update this version pinning by running the workflow
9+
# mentioned above.
10+
jupyterhub==5.2.1
11+
12+
# UI
13+
jupyterlab
14+
nbclassic
15+
16+
# plugins
17+
nbgitpuller

0 commit comments

Comments
 (0)