Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/jwa_backend_unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.12"

- name: Setup Python environment
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- name: Checkout source repository
uses: actions/checkout@v4

- name: Set up Python environment 3.8
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: flake8 Lint
uses: py-actions/flake8@v2
Expand Down
4 changes: 2 additions & 2 deletions components/crud-web-apps/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ In order to build a Docker image and use this code you coud build a wheel and th

```dockerfile
### Docker
FROM python:3.7 AS backend-kubeflow-wheel
FROM python:3.12 AS backend-kubeflow-wheel

WORKDIR /src
COPY ./components/crud-web-apps/common/backend .
Expand All @@ -54,7 +54,7 @@ RUN python3 setup.py bdist_wheel

...
# Web App
FROM python:3.7
FROM python:3.12

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create_app(name, static_folder, config):

if (config.ENV == BackendMode.DEVELOPMENT.value
or config.ENV == BackendMode.DEVELOPMENT_FULL.value): # noqa: W503
log.warn("RUNNING IN DEVELOPMENT MODE")
log.warning("RUNNING IN DEVELOPMENT MODE")

# Register all the blueprints
app.register_blueprint(authn_bp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DevConfig(Config):

def __init__(self):
super()
log.warn("RUNNING IN DEVELOPMENT MODE")
log.warning("RUNNING IN DEVELOPMENT MODE")


class ProdConfig(Config):
Expand Down

This file was deleted.

13 changes: 6 additions & 7 deletions components/crud-web-apps/common/backend/setup.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I THINK the following file is unused.. and given the changes here to setup.py - is now a source of outdated (mis)information:

We should remove this requirements.txt file (assuming its removal doesn't break anything!)

Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import setuptools

REQUIRES = [
"Flask >= 1.1.1",
"Flask >= 2.3.2",
"Flask-API >= 2.0",
"kubernetes == 22.6.0",
"requests >= 2.22.0",
"urllib3 >= 1.25.7",
"Werkzeug >= 0.16.0",
"kubernetes == 34.1.0",
"requests",
"urllib3",
"Werkzeug >= 3.0.6",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current python_requires=">=3.6" is incompatible with the updated dependencies. I checked the actual Python requirements on PyPI:

Dependencies that require Python ≥3.9:

  • urllib3 >= 2.5.0 → requires Python ≥3.9
  • gevent (latest) → requires Python ≥3.9

Dependencies that support Python ≥3.8:

  • Flask >= 2.3.2 → requires Python ≥3.8
  • Werkzeug >= 3.0.6 → requires Python ≥3.8
  • requests >= 2.32.4 → requires Python ≥3.8
  • kubernetes >= 22.6.0 → requires Python ≥3.6

Recommendation:

Since this PR was tested with Python 3.12 and some dependencies require ≥3.9, I suggest:

python_requires=">=3.12", # Tested version, most conservative Or at minimum:

python_requires=">=3.9", # Minimum required by urllib3 2.5.0 and gevent (that is the permissive suggestion).

Also consider removing line 13:

"importlib-metadata >= 1.0;python_version<'3.8'",
This condition will never be true when python_requires is ≥3.9, making it redundant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great observation, totally agreed and modified, thanks.

"Flask-Cors >= 3.0.8",
"gevent",
"prometheus-flask-exporter >= 0.23.1",
"importlib-metadata >= 1.0;python_version<'3.8'",
]

setuptools.setup(
Expand All @@ -27,5 +26,5 @@
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
],
python_requires=">=3.6",
python_requires=">=3.12",
)
8 changes: 5 additions & 3 deletions components/crud-web-apps/jupyter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# --- Build the backend kubeflow-wheel ---
FROM python:3.10-slim AS backend-kubeflow-wheel
# Python 3.12 upgrade
FROM python:3.12-slim AS backend-kubeflow-wheel

WORKDIR /src

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

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

# Web App
FROM python:3.10-slim
FROM python:3.12-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
6 changes: 3 additions & 3 deletions components/crud-web-apps/jupyter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ with a [configmap](./manifests/base/configs/logos-configmap.yaml) to make it eas

Requirements:
* node 16.20.2
* python 3.8
* python 3.12

### Frontend

Expand Down Expand Up @@ -64,8 +64,8 @@ cd components/crud-web-apps/jupyter

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

# install the deps on the activated virtual env
Expand Down
8 changes: 5 additions & 3 deletions components/crud-web-apps/tensorboards/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# --- Build the backend kubeflow-wheel ---
FROM python:3.10-slim AS backend-kubeflow-wheel
# Python 3.12 upgrade
FROM python:3.12-slim AS backend-kubeflow-wheel

WORKDIR /src

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

# --- Build the frontend kubeflow library ---
FROM node:16.20.2-bullseye as frontend-kubeflow-lib
Expand Down Expand Up @@ -41,7 +43,7 @@ COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/
RUN npm run build -- --output-path=./dist --configuration=production

# Web App
FROM python:3.10-slim
FROM python:3.12-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
6 changes: 3 additions & 3 deletions components/crud-web-apps/tensorboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This web app is responsible for allowing the user to manipulate Tensorboard inst

Requirements:
* node 16.20.2
* python 3.8
* python 3.12

### Frontend

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

# install the deps on the activated virtual env
Expand Down
8 changes: 5 additions & 3 deletions components/crud-web-apps/volumes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# --- Build the backend kubeflow-wheel ---
FROM python:3.10-slim AS backend-kubeflow-wheel
# Python 3.12 upgrade
FROM python:3.12-slim AS backend-kubeflow-wheel

WORKDIR /src

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

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

# Web App
FROM python:3.10-slim
FROM python:3.12-slim

WORKDIR /package
COPY --from=backend-kubeflow-wheel /src .
Expand Down
6 changes: 3 additions & 3 deletions components/crud-web-apps/volumes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This web app is responsible for allowing the user to manipulate PVCs in their Ku

Requirements:
* node 16.20.2
* python 3.8
* python 3.12

### Frontend

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

# install the deps on the activated virtual env
Expand Down
Loading