From 582cfcbd690985e58a59450e1acbac00e61f0632 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 13:29:10 +0100 Subject: [PATCH 1/6] update docker --- Dockerfile | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index fed3a46..d1b77d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,20 +13,24 @@ # limitations under the License. # Using specific tag for now, there was some reason newer minio versions didn't work -FROM quay.io/cloudservices/minio:RELEASE.2021-06-17T00-10-46Z.hotfix.35a0912ff as minio-examples +ARG MODEL_DIR=/data1/modelmesh-example-models +ARG FVT_DIR=/data1/modelmesh-example-models/fvt +FROM quay.io/centos/stream9-minimal as os +ARG MODEL_DIR EXPOSE 9000 -ARG MODEL_DIR=/data1/modelmesh-example-models - USER root -RUN useradd -u 1000 -g 0 modelmesh -RUN mkdir -p ${MODEL_DIR} -RUN chown -R 1000:0 /data1 && \ +RUN useradd -u 1000 -g 0 modelmesh &&\ + mkdir -p ${MODEL_DIR} &&\ + chown -R 1000:0 /data1 && \ chgrp -R 0 /data1 && \ chmod -R g=u /data1 +FROM quay.io/minio/minio:RELEASE.2024-02-26T09-33-48Z as minio +ARG FVT_DIR +ARG MODEL_DIR COPY --chown=1000:0 keras ${MODEL_DIR}/keras/ COPY --chown=1000:0 lightgbm ${MODEL_DIR}/lightgbm/ COPY --chown=1000:0 onnx ${MODEL_DIR}/onnx/ @@ -38,18 +42,6 @@ COPY --chown=1000:0 xgboost ${MODEL_DIR}/xgboost/ # some models are duplicated for testing and verification COPY --chown=1000:0 tensorflow/mnist ${MODEL_DIR}/tensorflow/mnist.savedmodel/ -USER 1000 - - -# Image with additional models used in the FVTs -FROM minio-examples as minio-fvt - -ARG FVT_DIR=/data1/modelmesh-example-models/fvt - -USER root - -COPY --chown=1000:0 fvt ${FVT_DIR}/ - # some models are duplicated for FVT testing and verification COPY --chown=1000:0 keras ${FVT_DIR}/keras/ COPY --chown=1000:0 keras ${FVT_DIR}/tensorflow/keras-mnist/ @@ -57,5 +49,6 @@ COPY --chown=1000:0 keras ${FVT_DIR}/tensorflow/keras-mnistne COPY --chown=1000:0 tensorflow/mnist ${FVT_DIR}/tensorflow/mnist.savedmodel/ COPY --chown=1000:0 tensorflow/mnist ${FVT_DIR}/tensorflow/mnist-dup.savedmodel/ COPY --chown=1000:0 fvt/pytorch/pytorch-mar ${FVT_DIR}/pytorch/pytorch-mar-dup/ +COPY --chown=1000:0 fvt ${FVT_DIR}/ USER 1000 From d15957f61b18e28f0532fe14b4c08e54662429cd Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 13:32:49 +0100 Subject: [PATCH 2/6] move folder copy --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d1b77d7..327a5da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,12 +43,13 @@ COPY --chown=1000:0 xgboost ${MODEL_DIR}/xgboost/ COPY --chown=1000:0 tensorflow/mnist ${MODEL_DIR}/tensorflow/mnist.savedmodel/ # some models are duplicated for FVT testing and verification +COPY --chown=1000:0 fvt ${FVT_DIR}/ COPY --chown=1000:0 keras ${FVT_DIR}/keras/ COPY --chown=1000:0 keras ${FVT_DIR}/tensorflow/keras-mnist/ COPY --chown=1000:0 keras ${FVT_DIR}/tensorflow/keras-mnistnew/ COPY --chown=1000:0 tensorflow/mnist ${FVT_DIR}/tensorflow/mnist.savedmodel/ COPY --chown=1000:0 tensorflow/mnist ${FVT_DIR}/tensorflow/mnist-dup.savedmodel/ COPY --chown=1000:0 fvt/pytorch/pytorch-mar ${FVT_DIR}/pytorch/pytorch-mar-dup/ -COPY --chown=1000:0 fvt ${FVT_DIR}/ + USER 1000 From 69c13d7418e92e88e0cd171b7a58302f335f491c Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 13:35:33 +0100 Subject: [PATCH 3/6] move expose --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 327a5da..aa7028a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,6 @@ ARG FVT_DIR=/data1/modelmesh-example-models/fvt FROM quay.io/centos/stream9-minimal as os ARG MODEL_DIR -EXPOSE 9000 - USER root RUN useradd -u 1000 -g 0 modelmesh &&\ @@ -31,6 +29,8 @@ RUN useradd -u 1000 -g 0 modelmesh &&\ FROM quay.io/minio/minio:RELEASE.2024-02-26T09-33-48Z as minio ARG FVT_DIR ARG MODEL_DIR +EXPOSE 9000 + COPY --chown=1000:0 keras ${MODEL_DIR}/keras/ COPY --chown=1000:0 lightgbm ${MODEL_DIR}/lightgbm/ COPY --chown=1000:0 onnx ${MODEL_DIR}/onnx/ From fa12a69ce1f4c00d3a498fc49bdae2d77c25c810 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 14:22:16 +0100 Subject: [PATCH 4/6] add expose port for console --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index aa7028a..6eb1f4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,10 @@ RUN useradd -u 1000 -g 0 modelmesh &&\ FROM quay.io/minio/minio:RELEASE.2024-02-26T09-33-48Z as minio ARG FVT_DIR ARG MODEL_DIR +# API server EXPOSE 9000 +# Console Server +EXPOSE 9001 COPY --chown=1000:0 keras ${MODEL_DIR}/keras/ COPY --chown=1000:0 lightgbm ${MODEL_DIR}/lightgbm/ From ee6ec62721b0afb03b0b490376983fb3ca9cefc1 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 14:53:07 +0100 Subject: [PATCH 5/6] remove wrong stage --- Dockerfile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6eb1f4f..03f2262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,22 +13,10 @@ # limitations under the License. # Using specific tag for now, there was some reason newer minio versions didn't work -ARG MODEL_DIR=/data1/modelmesh-example-models -ARG FVT_DIR=/data1/modelmesh-example-models/fvt - -FROM quay.io/centos/stream9-minimal as os -ARG MODEL_DIR -USER root - -RUN useradd -u 1000 -g 0 modelmesh &&\ - mkdir -p ${MODEL_DIR} &&\ - chown -R 1000:0 /data1 && \ - chgrp -R 0 /data1 && \ - chmod -R g=u /data1 FROM quay.io/minio/minio:RELEASE.2024-02-26T09-33-48Z as minio -ARG FVT_DIR -ARG MODEL_DIR +ARG MODEL_DIR=/data1/modelmesh-example-models +ARG FVT_DIR=/data1/modelmesh-example-models/fvt # API server EXPOSE 9000 # Console Server From 143d88670a49a8588109d1b09bbf4d366ff0c9d0 Mon Sep 17 00:00:00 2001 From: bdattoma Date: Mon, 26 Feb 2024 14:58:58 +0100 Subject: [PATCH 6/6] update run cmd in readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7617892..25a0f73 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,10 @@ Start a container with the name _"modelmesh-minio-examples"_: docker run --rm --name "modelmesh-minio-examples" \ -u "1000" \ -p "9000:9000" \ + -p "9001:9001" \ -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \ -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \ - ${DOCKER_USER}/modelmesh-minio-examples:latest server /data1 + ${DOCKER_USER}/modelmesh-minio-examples:latest server /data1 --console-address ":9001" ```