Skip to content

Commit 99af312

Browse files
committed
feat: Upgrade Python to 3.12 for crud-web-apps
- Update tensorboards, jupyter, and volumes Dockerfiles to Python 3.12-slim - Add setuptools and wheel installation for Python 3.12 compatibility - Update common/backend dependencies for security: * Flask 1.1.1 -> 2.3.2+ * Werkzeug 0.16.0 -> 3.0.6+ * urllib3 1.25.7 -> 2.5.0+ * requests 2.22.0 -> 2.32.4+ * kubernetes ==22.6.0 -> >=22.6.0 - Update CI workflows (jwa_backend_unittests.yaml, python_lint.yaml) to Python 3.12 - Update all READMEs with Python 3.12 requirements Testing: - All 10 backend unit tests pass - All images build successfully - All deployments running Python 3.12.12 - All APIs responding correctly - No dependency vulnerabilities Resolves: kubeflow#724, kubeflow#725, kubeflow#726 Signed-off-by: Asaad Balum <[email protected]>
1 parent 8c44fd7 commit 99af312

File tree

9 files changed

+33
-28
lines changed

9 files changed

+33
-28
lines changed

.github/workflows/jwa_backend_unittests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: JWA Backend Tests
22
on:
3-
pull_request:
3+
push:
44
paths:
55
- components/crud-web-apps/jupyter/backend/**
66
- releasing/version/VERSION
77
branches:
8+
- 724-725-726/python-312-upgrade
89
- main
910
- notebooks-v1
1011
- 'v*-branch'
@@ -25,7 +26,7 @@ jobs:
2526

2627
- uses: actions/setup-python@v5
2728
with:
28-
python-version: "3.7"
29+
python-version: "3.12"
2930

3031
- name: Setup Python environment
3132
run: |

.github/workflows/python_lint.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Python Linting
22

33
on:
4-
pull_request:
4+
push:
55
branches:
6+
- 724-725-726/python-312-upgrade
67
- main
78
- v*-branch
89
- notebooks-v1
@@ -17,10 +18,10 @@ jobs:
1718
- name: Checkout source repository
1819
uses: actions/checkout@v4
1920

20-
- name: Set up Python environment 3.8
21+
- name: Set up Python environment 3.12
2122
uses: actions/setup-python@v5
2223
with:
23-
python-version: "3.8"
24+
python-version: "3.12"
2425

2526
- name: flake8 Lint
2627
uses: py-actions/flake8@v2

components/crud-web-apps/common/backend/setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import setuptools
22

33
REQUIRES = [
4-
"Flask >= 1.1.1",
4+
"Flask >= 2.3.2",
55
"Flask-API >= 2.0",
6-
"kubernetes == 22.6.0",
7-
"requests >= 2.22.0",
8-
"urllib3 >= 1.25.7",
9-
"Werkzeug >= 0.16.0",
6+
"kubernetes >= 22.6.0",
7+
"requests >= 2.32.4",
8+
"urllib3 >= 2.5.0",
9+
"Werkzeug >= 3.0.6",
1010
"Flask-Cors >= 3.0.8",
1111
"gevent",
1212
"prometheus-flask-exporter >= 0.23.1",

components/crud-web-apps/jupyter/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# --- Build the backend kubeflow-wheel ---
2-
FROM python:3.10-slim AS backend-kubeflow-wheel
2+
FROM python:3.12-slim AS backend-kubeflow-wheel
33

44
WORKDIR /src
55

66
COPY ./common/backend/ .
7-
RUN python3 setup.py bdist_wheel
7+
RUN pip install --no-cache-dir setuptools wheel && \
8+
python3 setup.py bdist_wheel
89

910
# --- Build the frontend kubeflow library ---
1011
FROM node:16.20.2-bullseye as frontend-kubeflow-lib
@@ -41,7 +42,7 @@ COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
4142
RUN npm run build -- --output-path=./dist/default --configuration=production
4243

4344
# Web App
44-
FROM python:3.10-slim
45+
FROM python:3.12-slim
4546

4647
WORKDIR /package
4748
COPY --from=backend-kubeflow-wheel /src .

components/crud-web-apps/jupyter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ with a [configmap](./manifests/base/configs/logos-configmap.yaml) to make it eas
3232

3333
Requirements:
3434
* node 16.20.2
35-
* python 3.8
35+
* python 3.12
3636

3737
### Frontend
3838

@@ -64,8 +64,8 @@ cd components/crud-web-apps/jupyter
6464

6565
# create a virtual env and install deps
6666
# https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
67-
python3.8 -m pip install --user virtualenv
68-
python3.8 -m venv web-apps-dev
67+
python3.12 -m pip install --user virtualenv
68+
python3.12 -m venv web-apps-dev
6969
source web-apps-dev/bin/activate
7070

7171
# install the deps on the activated virtual env

components/crud-web-apps/tensorboards/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# --- Build the backend kubeflow-wheel ---
2-
FROM python:3.10-slim AS backend-kubeflow-wheel
2+
FROM python:3.12-slim AS backend-kubeflow-wheel
33

44
WORKDIR /src
55

66
COPY ./common/backend/ .
7-
RUN python3 setup.py bdist_wheel
7+
RUN pip install --no-cache-dir setuptools wheel && \
8+
python3 setup.py bdist_wheel
89

910
# --- Build the frontend kubeflow library ---
1011
FROM node:16.20.2-bullseye as frontend-kubeflow-lib
@@ -41,7 +42,7 @@ COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
4142
RUN npm run build -- --output-path=./dist --configuration=production
4243

4344
# Web App
44-
FROM python:3.10-slim
45+
FROM python:3.12-slim
4546

4647
WORKDIR /package
4748
COPY --from=backend-kubeflow-wheel /src .

components/crud-web-apps/tensorboards/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This web app is responsible for allowing the user to manipulate Tensorboard inst
1313

1414
Requirements:
1515
* node 16.20.2
16-
* python 3.8
16+
* python 3.12
1717

1818
### Frontend
1919

@@ -37,8 +37,8 @@ npm run build:watch
3737
# create a virtual env and install deps
3838
# https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
3939
cd component/crud-web-apps/tensorboards/backend
40-
python3.8 -m pip install --user virtualenv
41-
python3.8 -m venv web-apps-dev
40+
python3.12 -m pip install --user virtualenv
41+
python3.12 -m venv web-apps-dev
4242
source web-apps-dev/bin/activate
4343

4444
# install the deps on the activated virtual env

components/crud-web-apps/volumes/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# --- Build the backend kubeflow-wheel ---
2-
FROM python:3.10-slim AS backend-kubeflow-wheel
2+
FROM python:3.12-slim AS backend-kubeflow-wheel
33

44
WORKDIR /src
55

66
COPY ./common/backend/ .
7-
RUN python3 setup.py bdist_wheel
7+
RUN pip install --no-cache-dir setuptools wheel && \
8+
python3 setup.py bdist_wheel
89

910
# --- Build the frontend kubeflow library ---
1011
FROM node:16.20.2-bullseye as frontend-kubeflow-lib
@@ -41,7 +42,7 @@ COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
4142
RUN npm run build -- --output-path=./dist/default --configuration=production
4243

4344
# Web App
44-
FROM python:3.10-slim
45+
FROM python:3.12-slim
4546

4647
WORKDIR /package
4748
COPY --from=backend-kubeflow-wheel /src .

components/crud-web-apps/volumes/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This web app is responsible for allowing the user to manipulate PVCs in their Ku
66

77
Requirements:
88
* node 16.20.2
9-
* python 3.8
9+
* python 3.12
1010

1111
### Frontend
1212

@@ -30,8 +30,8 @@ npm run build:watch
3030
# create a virtual env and install deps
3131
# https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
3232
cd component/crud-web-apps/volumes/backend
33-
python3.8 -m pip install --user virtualenv
34-
python3.8 -m venv web-apps-dev
33+
python3.12 -m pip install --user virtualenv
34+
python3.12 -m venv web-apps-dev
3535
source web-apps-dev/bin/activate
3636

3737
# install the deps on the activated virtual env

0 commit comments

Comments
 (0)