From 0f9e6a428fcfaeddfba2411aa72689d0a409d1f5 Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Wed, 30 Oct 2024 06:45:53 +0100 Subject: [PATCH 1/2] Adapt docker recipes to Python 3.11 --- README.md | 4 ++-- kubernetes/mlflow/Dockerfile | 8 +++----- kubernetes/simple/Dockerfile | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 855bf245..6991c222 100644 --- a/README.md +++ b/README.md @@ -181,11 +181,11 @@ Our Docker images for most examples are available with the tag ending with `-dev For example, [PyTorch Simple](./pytorch/pytorch_simple.py) can be run via: ```bash -$ docker run --rm -v $(pwd):/prj -w /prj optuna/optuna:py3.7-dev python pytorch/pytorch_simple.py +$ docker run --rm -v $(pwd):/prj -w /prj optuna/optuna:py3.11-dev python pytorch/pytorch_simple.py ``` Additionally, our visualization example can also be run on Jupyter Notebook by opening `localhost:8888` in your browser after executing the following: ```bash -$ docker run -p 8888:8888 --rm optuna/optuna:py3.7-dev jupyter notebook --allow-root --no-browser --port 8888 --ip 0.0.0.0 --NotebookApp.token='' --NotebookApp.password='' +$ docker run -p 8888:8888 --rm optuna/optuna:py3.11-dev jupyter notebook --allow-root --no-browser --port 8888 --ip 0.0.0.0 --NotebookApp.token='' --NotebookApp.password='' ``` diff --git a/kubernetes/mlflow/Dockerfile b/kubernetes/mlflow/Dockerfile index 0fd61114..3b1caa17 100644 --- a/kubernetes/mlflow/Dockerfile +++ b/kubernetes/mlflow/Dockerfile @@ -1,13 +1,11 @@ # NOTE(crcrpar): optuna/optuna:py3.7-dev can be used as base instead. -FROM python:3.7-slim-buster +FROM python:3.11-slim-buster WORKDIR /usr/src/ RUN pip install --no-cache-dir optuna psycopg2-binary mlflow \ - && pip install --no-cache-dir \ - torch==1.10.0+cpu \ - torchvision==0.11.1+cpu \ - -f https://download.pytorch.org/whl/torch_stable.html \ + && pip install --no-cache-dir torch torchvision \ + --index-url https://download.pytorch.org/whl/cpu \ && pip install pytorch-lightning COPY pytorch_lightning_distributed.py . diff --git a/kubernetes/simple/Dockerfile b/kubernetes/simple/Dockerfile index 26e9b1af..86531976 100644 --- a/kubernetes/simple/Dockerfile +++ b/kubernetes/simple/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-slim-buster +FROM python:3.11-slim-buster WORKDIR /usr/src/ From e178311c925dfcdb8f5e66919da63303a9da372d Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Mon, 11 Nov 2024 08:25:49 +0100 Subject: [PATCH 2/2] Apply mizuno's suggestion --- kubernetes/mlflow/Dockerfile | 2 +- kubernetes/simple/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/mlflow/Dockerfile b/kubernetes/mlflow/Dockerfile index 3b1caa17..7cb277c7 100644 --- a/kubernetes/mlflow/Dockerfile +++ b/kubernetes/mlflow/Dockerfile @@ -1,5 +1,5 @@ # NOTE(crcrpar): optuna/optuna:py3.7-dev can be used as base instead. -FROM python:3.11-slim-buster +FROM python:3.11-slim WORKDIR /usr/src/ diff --git a/kubernetes/simple/Dockerfile b/kubernetes/simple/Dockerfile index 86531976..2232909a 100644 --- a/kubernetes/simple/Dockerfile +++ b/kubernetes/simple/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim-buster +FROM python:3.11-slim WORKDIR /usr/src/