Skip to content

Commit ff8d0c3

Browse files
authored
Merge pull request #10 from yacchin1205/feature/upgrade-2025-01-rcosdp
Upstreamの取り込み(JupyterHub 5.2.1対応)
2 parents 9ffe7f0 + 5e4c769 commit ff8d0c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1442
-588
lines changed

.circleci/config.yml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,70 @@
1+
# We use CircleCI to run a basic test for arm64.
2+
#
3+
# To reduce the complexity, we let this test verify our built images works with
4+
# arm64, but doesn't test the acquisition of HTTPS certificates (because it
5+
# requires a ACME server) or enforcement of the chart's NetworkPolicy resources
6+
# (because it requires Calico or similar to do it robustly).
7+
#
18
version: 2.1
29

310
orbs:
4-
python: circleci/python@0.2.1
11+
python: circleci/python@2.1.1
512

613
jobs:
7-
# Testing on ARM64
8-
# https://circleci.com/docs/2.0/arm-resources/#using-arm-resources
14+
# Testing on arm64
15+
# https://circleci.com/docs/using-arm/#using-arm-resources
916
test-arm:
1017
machine:
11-
image: ubuntu-2004:2022.04.1
18+
image: ubuntu-2204:current
1219
resource_class: arm.medium
1320
steps:
1421
- checkout
1522

23+
# The k3s setup should be kept similar to how we do it in
24+
# https://github.com/jupyterhub/action-k3s-helm.
1625
- run:
17-
command: uname -a
18-
name: Check architecture
19-
20-
- run:
21-
# NOTE: we can't use k3s 1.24 and --docker unless we also install for
22-
# example cri-dockerd as done in
23-
# https://github.com/jupyterhub/action-k3s-helm.
24-
#
25-
# NOTE: we declare --egress-selector-mode=disabled to workaround
26-
# intermittent issues in k3s introduced as a regression in k3s
27-
# 1.22.10, 1.23.7, and 1.24.0. This is tracked in
28-
# https://github.com/k3s-io/k3s/issues/5633.
29-
#
26+
name: Setup k3s
3027
command: >-
3128
curl -sfL https://get.k3s.io |
32-
INSTALL_K3S_CHANNEL=v1.23 sh -s -
29+
INSTALL_K3S_CHANNEL=latest sh -s -
3330
--disable metrics-server
3431
--disable traefik
32+
--disable-network-policy
3533
--docker
3634
--egress-selector-mode=disabled
37-
name: Install K3S
3835
3936
- run:
37+
name: Prepare a kubeconfig in ~/.kube/config
4038
command: |
4139
mkdir -p ~/.kube
4240
sudo cat /etc/rancher/k3s/k3s.yaml > "$HOME/.kube/config"
4341
chmod 600 "$HOME/.kube/config"
44-
name: Prepare a kubeconfig in ~/.kube/config
4542
4643
- run:
44+
name: Install dependencies
4745
command: |
4846
. ci/common
4947
setup_helm
5048
pip3 install --no-cache-dir -r dev-requirements.txt
51-
name: Install dependencies
5249
5350
- run:
51+
name: Run chartpress
5452
command: |
5553
export DOCKER_BUILDKIT=1
5654
chartpress
57-
name: Run chartpress
5855
5956
- run:
57+
name: Install local chart
6058
command: |
6159
export KUBECONFIG="$HOME/.kube/config"
6260
helm upgrade --install jupyterhub ./jupyterhub \
6361
--wait \
6462
--values dev-config.yaml \
6563
--values dev-config-arm.yaml \
6664
--values dev-config-local-chart-extra-config.yaml
67-
name: Install local chart
6865
6966
- run:
67+
name: Run tests
7068
command: |
7169
export KUBECONFIG="$HOME/.kube/config"
7270
export HUB_URL=http://localhost:30080
@@ -80,19 +78,30 @@ jobs:
8078
kubectl describe {} && \
8179
kubectl logs --all-containers {} && \
8280
echo --------------------------------"
83-
name: Run tests
8481
8582
- run:
86-
name: k8s namespace report
83+
name: k3s.service status
8784
when: on_fail
8885
command: |
89-
export KUBECONFIG="$HOME/.kube/config"
90-
wget https://raw.githubusercontent.com/jupyterhub/action-k8s-namespace-report/v1.1.0/k8s-namespace-report
91-
bash k8s-namespace-report
86+
systemctl status --no-pager --full k3s.service || true
87+
88+
- run:
89+
name: k3s.service logs
90+
when: on_fail
91+
command: |
92+
journalctl --no-pager -xu k3s.service
93+
94+
- run:
95+
name: k8s namespace report
96+
when: on_fail
9297
environment:
9398
NAMESPACE: ""
9499
POD_SELECTOR: ""
95100
IMPORTANT_WORKLOADS: ""
101+
command: |
102+
export KUBECONFIG="$HOME/.kube/config"
103+
wget https://raw.githubusercontent.com/jupyterhub/action-k8s-namespace-report/v1.1.0/k8s-namespace-report
104+
bash k8s-namespace-report
96105
97106
workflows:
98107
main:

.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/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
# correctly
4343
fetch-depth: 0
4444

45-
- uses: actions/setup-python@v4
45+
- uses: actions/setup-python@v5
4646
with:
4747
python-version: "3.11"
4848

@@ -144,7 +144,7 @@ jobs:
144144
run: helm package jupyterhub
145145

146146
# ref: https://github.com/actions/upload-artifact
147-
- uses: actions/upload-artifact@v3
147+
- uses: actions/upload-artifact@v4
148148
if: steps.publishing.outputs.publishing == ''
149149
with:
150150
name: jupyterhub-${{ github.sha }}

.github/workflows/release-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
# https://github.com/actions/github-script
1717
# https://octokit.github.io/rest.js/v18#repos-create-release
18-
- uses: actions/github-script@v6
18+
- uses: actions/github-script@v7
1919
with:
2020
script: |
2121
if (!context.ref.startsWith('refs/tags/')) {

.github/workflows/support-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
action:
1313
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: dessant/support-requests@v3
15+
- uses: dessant/support-requests@v4
1616
with:
1717
github-token: ${{ github.token }}
1818
support-label: "support"

.github/workflows/test-chart.yaml

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-22.04
3232
steps:
3333
- uses: actions/checkout@v4
34-
- uses: actions/setup-python@v4
34+
- uses: actions/setup-python@v5
3535
with:
3636
python-version: "3.11"
3737

@@ -45,7 +45,7 @@ jobs:
4545
runs-on: ubuntu-22.04
4646
steps:
4747
- uses: actions/checkout@v4
48-
- uses: actions/setup-python@v4
48+
- uses: actions/setup-python@v5
4949
with:
5050
python-version: "3.11"
5151

@@ -78,7 +78,7 @@ jobs:
7878

7979
steps:
8080
- uses: actions/checkout@v4
81-
- uses: actions/setup-python@v4
81+
- uses: actions/setup-python@v5
8282
with:
8383
python-version: "3.11"
8484

@@ -129,21 +129,22 @@ jobs:
129129
# k3s-channel: https://update.k3s.io/v1-release/channels
130130
#
131131
include:
132-
- k3s-channel: v1.29.0+k3s1
132+
- k3s-channel: latest
133133
test: install
134134
- k3s-channel: stable # also test hub-slim, and prePuller.hook
135135
test: install
136136
local-chart-extra-args: >-
137137
--set hub.image.name=gcr.io/nii-ap-ops/k8s-hub
138138
--set prePuller.hook.enabled=true
139139
--set prePuller.hook.pullOnlyOnChanges=true
140-
- k3s-channel: v1.26 # also test hub.existingSecret
140+
- k3s-channel: v1.31 # also test hub.existingSecret and subdomain_host
141141
test: install
142142
local-chart-extra-args: >-
143143
--set hub.existingSecret=test-hub-existing-secret
144144
--set proxy.secretToken=aaaa1111
145145
--set hub.cookieSecret=bbbb2222
146146
--set hub.config.CryptKeeper.keys[0]=cccc3333
147+
--set hub.config.JupyterHub.subdomain_host=jupyterhub.example.org
147148
create-k8s-test-resources: true
148149
# We run three upgrade tests where we first install an already released
149150
# Helm chart version and then upgrade to the version we are now
@@ -159,7 +160,7 @@ jobs:
159160
# information from
160161
# https://hub.jupyter.org/helm-chart/info.json
161162
#
162-
- k3s-channel: v1.25
163+
- k3s-channel: v1.30
163164
test: upgrade
164165
upgrade-from: stable
165166
upgrade-from-extra-args: >-
@@ -172,46 +173,44 @@ jobs:
172173
--set hub.db.type=sqlite-pvc
173174
--set singleuser.storage.type=dynamic
174175
create-k8s-test-resources: true
175-
# v1.24はEOLとなっており、利用想定がないのでテストを除外する
176-
# - k3s-channel: v1.24
177-
# test: upgrade
178-
# upgrade-from: dev
179-
# upgrade-from-extra-args: >-
180-
# --set proxy.secretToken=aaaa1111
181-
# --set hub.db.type=sqlite-pvc
182-
# --set singleuser.storage.type=dynamic
183-
# local-chart-extra-args: >-
184-
# --set hub.db.type=sqlite-pvc
185-
# --set singleuser.storage.type=dynamic
186-
# RCOSのリポジトリにjupyterhub chart version 2.0.0がないため、テストを除外する
187-
# - k3s-channel: v1.23
188-
# test: upgrade
189-
# # We're testing hub.db.upgrade with PostgreSQL so this version must be old
190-
# # enough to require a DB upgrade
191-
# upgrade-from: 2.0.0
192-
# upgrade-from-extra-args: >-
193-
# --set proxy.secretToken=aaaa1111
194-
# --set hub.cookieSecret=bbbb2222
195-
# --set hub.config.CryptKeeper.keys[0]=cccc3333
196-
# --set hub.db.type=postgres
197-
# --set hub.db.url=postgresql+psycopg2://postgres:postgres@postgresql:5432/jupyterhub
198-
# --set singleuser.storage.type=dynamic
199-
# local-chart-extra-args: >-
200-
# --set hub.db.type=postgres
201-
# --set hub.db.url=postgresql+psycopg2://postgres:postgres@postgresql:5432/jupyterhub
202-
# --set singleuser.storage.type=dynamic
203-
# --set hub.db.upgrade=true
204-
# create-k8s-test-resources: true
205-
# # https://artifacthub.io/packages/helm/bitnami/postgresql
206-
# setup-postgresql-args: >-
207-
# --version=11.6.13
208-
# --set auth.enablePostgresUser=true
209-
# --set auth.postgresPassword=postgres
210-
# --set auth.database=jupyterhub
211-
# --set audit.logHostname=true
212-
# --set audit.logConnections=true
213-
# --set audit.logDisconnections=true
214-
# --set audit.clientMinMessages=debug
176+
- k3s-channel: v1.29
177+
test: upgrade
178+
upgrade-from: dev
179+
upgrade-from-extra-args: >-
180+
--set proxy.secretToken=aaaa1111
181+
--set hub.db.type=sqlite-pvc
182+
--set singleuser.storage.type=dynamic
183+
local-chart-extra-args: >-
184+
--set hub.db.type=sqlite-pvc
185+
--set singleuser.storage.type=dynamic
186+
- k3s-channel: v1.28
187+
test: upgrade
188+
# We're testing hub.db.upgrade with PostgreSQL so this version must be old
189+
# enough to require a DB upgrade
190+
upgrade-from: 3.2.1-20240523
191+
upgrade-from-extra-args: >-
192+
--set proxy.secretToken=aaaa1111
193+
--set hub.cookieSecret=bbbb2222
194+
--set hub.config.CryptKeeper.keys[0]=cccc3333
195+
--set hub.db.type=postgres
196+
--set hub.db.url=postgresql+psycopg2://postgres:postgres@postgresql:5432/jupyterhub
197+
--set singleuser.storage.type=dynamic
198+
local-chart-extra-args: >-
199+
--set hub.db.type=postgres
200+
--set hub.db.url=postgresql+psycopg2://postgres:postgres@postgresql:5432/jupyterhub
201+
--set singleuser.storage.type=dynamic
202+
--set hub.db.upgrade=true
203+
create-k8s-test-resources: true
204+
# https://artifacthub.io/packages/helm/bitnami/postgresql
205+
setup-postgresql-args: >-
206+
--version=16.0.5
207+
--set auth.enablePostgresUser=true
208+
--set auth.postgresPassword=postgres
209+
--set auth.database=jupyterhub
210+
--set audit.logHostname=true
211+
--set audit.logConnections=true
212+
--set audit.logDisconnections=true
213+
--set audit.clientMinMessages=debug
215214
216215
steps:
217216
- uses: actions/checkout@v4
@@ -224,14 +223,14 @@ jobs:
224223
# kubectl and helm
225224
#
226225
# ref: https://github.com/jupyterhub/action-k3s-helm/
227-
- uses: jupyterhub/action-k3s-helm@v3
226+
- uses: jupyterhub/action-k3s-helm@v4
228227
with:
229228
k3s-channel: ${{ matrix.k3s-channel }}
230229
metrics-enabled: false
231230
traefik-enabled: false
232231
docker-enabled: true
233232

234-
- uses: actions/setup-python@v4
233+
- uses: actions/setup-python@v5
235234
with:
236235
python-version: "3.11"
237236

@@ -270,7 +269,7 @@ jobs:
270269
# jupyterhub and the autohttps pod is about to start, so for CI
271270
# performance we delayed this until now and did other things in between.
272271
- name: Await local ACME server
273-
uses: jupyterhub/action-k8s-await-workloads@v2
272+
uses: jupyterhub/action-k8s-await-workloads@v3
274273
with:
275274
timeout: 150
276275
max-restarts: 1
@@ -336,7 +335,7 @@ jobs:
336335
337336
- name: "(Upgrade) Await ${{ matrix.upgrade-from }} chart"
338337
if: matrix.test == 'upgrade'
339-
uses: jupyterhub/action-k8s-await-workloads@v2
338+
uses: jupyterhub/action-k8s-await-workloads@v3
340339
with:
341340
timeout: 150
342341
max-restarts: 1
@@ -361,7 +360,7 @@ jobs:
361360
${{ matrix.local-chart-extra-args }}
362361
363362
- name: "Await local chart"
364-
uses: jupyterhub/action-k8s-await-workloads@v2
363+
uses: jupyterhub/action-k8s-await-workloads@v3
365364
with:
366365
timeout: 150
367366
max-restarts: 1
@@ -379,6 +378,9 @@ jobs:
379378
continue-on-error: ${{ matrix.accept-failure == true }}
380379
run: |
381380
. ./ci/common
381+
if [ "${{ contains(matrix.local-chart-extra-args, 'subdomain_host') }}" = "true" ]; then
382+
export CI_SUBDOMAIN_HOST=jupyterhub.example.org
383+
fi
382384
# If you have problems with the tests add '--capture=no' to show stdout
383385
pytest --verbose --maxfail=2 --color=yes --capture=no ./tests
384386

.github/workflows/test-docker-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# correctly
3838
fetch-depth: 0
3939

40-
- uses: actions/setup-python@v4
40+
- uses: actions/setup-python@v5
4141
with:
4242
python-version: "3.11"
4343

.github/workflows/test-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# chartpress, used by docs/conf.py, requires git history to set
3333
# chart version and image tags correctly
3434
fetch-depth: 0
35-
- uses: actions/setup-python@v4
35+
- uses: actions/setup-python@v5
3636
with:
3737
python-version: "3.11"
3838

0 commit comments

Comments
 (0)