From f013077cd7e595645faa1652fb03fc3271763e7a Mon Sep 17 00:00:00 2001 From: Bibo Hao Date: Mon, 3 Jul 2023 12:14:00 +0800 Subject: [PATCH 1/2] fix paddle ver --- docker_core/Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docker_core/Dockerfile b/docker_core/Dockerfile index 193920d..319b359 100644 --- a/docker_core/Dockerfile +++ b/docker_core/Dockerfile @@ -79,16 +79,13 @@ RUN source /opt/utils/script-utils.sh \ && pip install --pre -U ${V} -f "https://download.pytorch.org/whl/${IDX}/torch_stable.html" \ ) || echo "Skip pytorch install" ) \ # Handle paddle installation, cpu/gpu: https://www.paddlepaddle.org.cn/ - # URL_PADDLE=$(curl -sL "https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" |tr "<>" "\n" | grep "${PADDLE_VER}" | grep href | cut -d '=' -f 2) && ( $(grep -q "paddle" <<< "${ARG_PROFILE_PYTHON}") && ( \ - PADDLE=$( [ -x "$(command -v nvcc)" ] && echo "paddlepaddle-gpu" || echo "paddlepaddle") \ - && PADDLE_VER=$(pip index versions ${PADDLE} | grep '(' | cut -d "(" -f 2 | tr -d ')[:space:]') \ + URL_PYPI_PADDLE="https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" \ && CUDA_VER=$(echo "${CUDA_VERSION:0:4}" | sed 's/\.//' ) \ - && V=$($(grep -q "11" <<< "${CUDA_VER}") && echo ".post${CUDA_VER}" || echo "" ) \ - && V=$(echo ${PADDLE}==${PADDLE_VER}${V}) && echo "to install paddle: ${V}" \ - && pip install pip==21.3.1 && pip --version \ + && PADDLE=$( [ -x "$(command -v nvcc)" ] && echo "paddlepaddle-gpu" || echo "paddlepaddle") \ + && PADDLE_VER=$(pip index versions ${PADDLE} -f ${URL_PYPI_PADDLE} | grep 'Available' | cut -d ":" -f 2 | tr ', ' '\n' | grep ${CUDA_VER:-'.'} | head -n 1) \ + && V=$(echo ${PADDLE}==${PADDLE_VER}) && echo "to install paddle: ${V}" \ && pip install ${V} -f "https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" \ - && pip install -U pip \ ) || echo "Skip paddle install" ) From 63d122cc3ddd53f57193d06ae3f66b0ce89f8e9c Mon Sep 17 00:00:00 2001 From: Bibo Hao Date: Mon, 3 Jul 2023 12:44:22 +0800 Subject: [PATCH 2/2] update docs --- README.md | 3 --- tool.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 570d302..5b1dbf1 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,6 @@ Typically, you can choose `full` / `full-cuda` if you have enough disk space and |:-------------------------:|:-------------------------------------------:|:-----------------:|:--------------------------------------------------------------------------------------------------------------------:| | cuda_11.7, cuda | https://hub.docker.com/r/qpod/cuda_11.7 | qpod/base | Version 11.7 of NVIDIA cuda and cudnn libs, including runtime and devel. | | cuda_11.2 | https://hub.docker.com/r/qpod/cuda_11.2 | qpod/base | Version 11.2 of NVIDIA cuda and cudnn libs, including runtime and devel. | -| cuda_10.2 | https://hub.docker.com/r/qpod/cuda_10.2 | qpod/base | Version 10.2 of NVIDIA cuda and cudnn libs, including runtime and devel. | -| cuda_10.0 | https://hub.docker.com/r/qpod/cuda_10.0 | qpod/base | Version 10.0 of NVIDIA cuda and cudnn libs, including runtime and devel. (Specifically retained for tensorflow 1.15) | -| tf1-cuda100, tf1 | https://hub.docker.com/r/qpod/tf1 | qpod/cuda_10.0 | Tensorflow 1.1x environment with GPU (cuda 10.0). | | tf2-cuda112, tf2 | https://hub.docker.com/r/qpod/tf2 | qpod/cuda_11.2 | Tensorflow 2.x environment with GPU (cuda 11.2). | | torch-cuda117, torch | https://hub.docker.com/r/qpod/torch | qpod/torch | Pytorch 1.x environment with GPU (cuda 11.7). | | torch-cuda112 | https://hub.docker.com/r/qpod/torch-cuda112 | qpod/torch-cuda12 | Pytorch 1.x environment with GPU (cuda 10.2). | diff --git a/tool.sh b/tool.sh index 52fd9b9..10ff96f 100755 --- a/tool.sh +++ b/tool.sh @@ -65,6 +65,17 @@ push_image() { done } +clear_images() { + KEYWORD=${1:-'days ago\|weeks ago\|months ago\|years ago'}; # if no keyword is provided, clear all images build days ago + IMGS_1=$(docker images | grep "${KEYWORD}" | awk '{print $1 ":" $2}') ; + IMGS_2=$(docker images | grep "${KEYWORD}" | awk '{print $3}') ; + + for IMG in $(echo "$IMGS_1 $IMGS_2" | tr " " "\n") ; do + docker rmi "${IMG}" || true; status=$?; echo "[${status}] image removed > ${IMG}"; + done + docker image prune --force && docker images ; +} + remove_folder() { sudo du -h -d1 "$1" || true ; sudo rm -rf "$1" || true ;