From 54eccccd1187877c157e34b77d33dc8587cf8e40 Mon Sep 17 00:00:00 2001 From: Francesco Mattioli Date: Sat, 28 Sep 2024 20:07:03 +0200 Subject: [PATCH] Removing cpu-info persistence for Docker images (#16470) Signed-off-by: UltralyticsAssistant Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- docker/Dockerfile | 5 +++-- docker/Dockerfile-arm64 | 2 ++ docker/Dockerfile-conda | 2 ++ docker/Dockerfile-cpu | 4 ++-- docker/Dockerfile-jetson-jetpack4 | 4 +++- docker/Dockerfile-jetson-jetpack5 | 3 ++- docker/Dockerfile-jetson-jetpack6 | 4 +++- docker/Dockerfile-python | 4 ++-- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 44c84b00..aa34bf33 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,8 +49,9 @@ RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 RUN pip install "paddlepaddle>=2.6.0" x2paddle # Fix error: `np.bool` was a deprecated alias for the builtin `bool` segmentation error in Tests RUN pip install numpy==1.23.5 -# Remove exported models -RUN rm -rf tmp + +# Remove extra build files +RUN rm -rf tmp /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-arm64 b/docker/Dockerfile-arm64 index 7eeade10..786061e7 100644 --- a/docker/Dockerfile-arm64 +++ b/docker/Dockerfile-arm64 @@ -38,6 +38,8 @@ RUN pip install -e ".[export]" # Creates a symbolic link to make 'python' point to 'python3' RUN ln -sf /usr/bin/python3 /usr/bin/python +# Remove extra build files +RUN rm -rf /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-conda b/docker/Dockerfile-conda index c6a31f1c..343b8001 100644 --- a/docker/Dockerfile-conda +++ b/docker/Dockerfile-conda @@ -30,6 +30,8 @@ RUN conda config --set solver libmamba && \ conda install -c conda-forge ultralytics mkl # conda install -c pytorch -c nvidia -c conda-forge pytorch torchvision pytorch-cuda=12.1 ultralytics mkl +# Remove extra build files +RUN rm -rf /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index fcd5336e..f6b691c5 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -38,12 +38,12 @@ RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 # Requires Python<=3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 # RUN pip install "paddlepaddle>=2.6.0" x2paddle -# Remove exported models -RUN rm -rf tmp # Creates a symbolic link to make 'python' point to 'python3' RUN ln -sf /usr/bin/python3 /usr/bin/python +# Remove extra build files +RUN rm -rf tmp /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-jetson-jetpack4 b/docker/Dockerfile-jetson-jetpack4 index ca238b96..4ea29852 100644 --- a/docker/Dockerfile-jetson-jetpack4 +++ b/docker/Dockerfile-jetson-jetpack4 @@ -48,7 +48,9 @@ RUN pip install \ https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-1.11.0a0+gitbc2c6ed-cp38-cp38-linux_aarch64.whl \ https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.12.0a0+9b5a3fe-cp38-cp38-linux_aarch64.whl RUN pip install -e ".[export]" -RUN rm *.whl + +# Remove extra build files +RUN rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-jetson-jetpack5 b/docker/Dockerfile-jetson-jetpack5 index 9ec2e64a..afd1f002 100644 --- a/docker/Dockerfile-jetson-jetpack5 +++ b/docker/Dockerfile-jetson-jetpack5 @@ -41,8 +41,9 @@ ADD https://nvidia.box.com/shared/static/mvdcltm9ewdy2d5nurkiqorofz1s53ww.whl on RUN python3 -m pip install --upgrade pip wheel RUN pip install onnxruntime_gpu-1.15.1-cp38-cp38-linux_aarch64.whl RUN pip install -e ".[export]" -RUN rm *.whl +# Remove extra build files +RUN rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-jetson-jetpack6 b/docker/Dockerfile-jetson-jetpack6 index 3b53c31d..ccc87276 100644 --- a/docker/Dockerfile-jetson-jetpack6 +++ b/docker/Dockerfile-jetson-jetpack6 @@ -38,7 +38,9 @@ RUN pip install \ https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.3.0-cp310-cp310-linux_aarch64.whl \ https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.18.0a0+6043bc2-cp310-cp310-linux_aarch64.whl RUN pip install -e ".[export]" -RUN rm *.whl + +# Remove extra build files +RUN rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json # Usage Examples ------------------------------------------------------------------------------------------------------- diff --git a/docker/Dockerfile-python b/docker/Dockerfile-python index f8a8611c..281d802b 100644 --- a/docker/Dockerfile-python +++ b/docker/Dockerfile-python @@ -38,9 +38,9 @@ RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32 # Requires Python<=3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 RUN pip install "paddlepaddle>=2.6.0" x2paddle -# Remove exported models -RUN rm -rf tmp +# Remove extra build files +RUN rm -rf tmp /root/.config/Ultralytics/persistent_cache.json # Usage Examples -------------------------------------------------------------------------------------------------------