From 9e7a74684d8b4f513ea0fbc6608b1dd0e71665f4 Mon Sep 17 00:00:00 2001 From: deepfailing Date: Tue, 14 May 2024 14:28:41 +0000 Subject: [PATCH 1/4] update mlflow/2.11.1/22.03-lts-sp3/Dockerfile. 1. Create a writable directory for user so that the user can create subdirectories and files in it, which is critical to run the mlflow server. 2. Add CMD ["mlflow", "server" ... ] at the end so that the mlflow server will be started automatically once the container is started. Signed-off-by: deepfailing --- mlflow/2.11.1/22.03-lts-sp3/Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile index a92785f7..51b64f05 100644 --- a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile +++ b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile @@ -1,11 +1,20 @@ -ARG BASE=openeuler/openeuler:22.03-lts-sp3 -FROM ${BASE} +FROM openeuler/openeuler:22.03-lts-sp3 + +RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime && \ + sed -i "s/TMOUT=300/TMOUT=0/g" /etc/bashrc ARG VERSION=2.11.1 + RUN yum install -y python3-pip && yum clean all + RUN pip3 install mlflow==${VERSION} -i https://pypi.tuna.tsinghua.edu.cn/simple && \ groupadd --gid 10001 mlflow && \ - useradd --uid 10001 --gid mlflow --shell /bin/bash --create-home mlflow + useradd --uid 10001 --gid mlflow --shell /bin/bash --create-home mlflow && \ + mkdir -p /mlflow && \ + chown mlflow:mlflow /mlflow USER 10001 -CMD ["bash"] + +ENV MLFLOW_TRACKING_URI=/mlflow + +CMD ["mlflow", "server", "--backend-store-uri", "/mlflow", "--default-artifact-root", "/mlflow", "--host", "0.0.0.0"] -- Gitee From 18450fd102389f820c225bf2870155f109ef15c0 Mon Sep 17 00:00:00 2001 From: deepfailing Date: Tue, 14 May 2024 14:52:02 +0000 Subject: [PATCH 2/4] update mlflow/README.md. Signed-off-by: deepfailing --- mlflow/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mlflow/README.md b/mlflow/README.md index dbd5ebb2..e6473240 100644 --- a/mlflow/README.md +++ b/mlflow/README.md @@ -18,8 +18,20 @@ docker buildx build -t "openeuler/mlflow:$TAG" --platform linux/amd64,linux/arm6 We are using `buildx` in here to generate multi-arch images, see more in [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) 2. Run: + +Specify a port in your host so that you can access the Web UI at 127.0.0.1:{YOUR_PORT}. +```shell +docker run -it --name mlflow -p {YOUR_PORT}:5000 openeuler/mlflow:{TAG} +``` + +If you want to store the data permanently, add the parameter "-v" and specify a directory in your host. +```shell +docker run -it --name mlflow -p {YOUR_PORT}:5000 -v {DIR_IN_YOUR_HOST}:/mlflow openeuler/mlflow:{TAG} +``` +Please make sure the DIR_IN_YOUR_HOST is writable. Maybe you should run the commands below before the ```docker run -v```. ```shell -docker run -it --name mlflow openeuler/mlflow:{TAG} +mkdir {DIR_IN_YOUR_HOST} +chmod 777 {DIR_IN_YOUR_HOST} ``` # Supported tags and respective Dockerfile links -- Gitee From 9599077e2a040946bfc5ab40b8bd601042a0d894 Mon Sep 17 00:00:00 2001 From: deepfailing Date: Tue, 14 May 2024 16:16:20 +0000 Subject: [PATCH 3/4] update mlflow/README.md. Signed-off-by: deepfailing --- mlflow/README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mlflow/README.md b/mlflow/README.md index e6473240..a10b5353 100644 --- a/mlflow/README.md +++ b/mlflow/README.md @@ -10,7 +10,7 @@ # Build reference -1. Build images and push: +1. Build images and push: (you may need to replace "openeuler" with your own repo name.) ```shell docker buildx build -t "openeuler/mlflow:$TAG" --platform linux/amd64,linux/arm64 . --push ``` @@ -24,14 +24,9 @@ Specify a port in your host so that you can access the Web UI at 127.0.0.1:{YOUR docker run -it --name mlflow -p {YOUR_PORT}:5000 openeuler/mlflow:{TAG} ``` -If you want to store the data permanently, add the parameter "-v" and specify a directory in your host. +If you want to store the data permanently, use parameter ```-v``` to specify a volume such as ```mlruns```. ```shell -docker run -it --name mlflow -p {YOUR_PORT}:5000 -v {DIR_IN_YOUR_HOST}:/mlflow openeuler/mlflow:{TAG} -``` -Please make sure the DIR_IN_YOUR_HOST is writable. Maybe you should run the commands below before the ```docker run -v```. -```shell -mkdir {DIR_IN_YOUR_HOST} -chmod 777 {DIR_IN_YOUR_HOST} +docker run -it --name mlflow -p {YOUR_PORT}:5000 -v mlruns:/mlflow openeuler/mlflow:{TAG} ``` # Supported tags and respective Dockerfile links -- Gitee From 8365384c6938a4d3ec9ccf0b1d794d6822f6fcae Mon Sep 17 00:00:00 2001 From: deepfailing Date: Wed, 15 May 2024 10:13:43 +0000 Subject: [PATCH 4/4] update mlflow/2.11.1/22.03-lts-sp3/Dockerfile. Signed-off-by: deepfailing --- mlflow/2.11.1/22.03-lts-sp3/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile index 51b64f05..8e903add 100644 --- a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile +++ b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile @@ -1,7 +1,6 @@ -FROM openeuler/openeuler:22.03-lts-sp3 +ARG BASE=openeuler/openeuler:22.03-lts-sp3 -RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime && \ - sed -i "s/TMOUT=300/TMOUT=0/g" /etc/bashrc +FROM ${BASE} ARG VERSION=2.11.1 -- Gitee