From 3b8ab8cb990d3cfa34045b3c596bc9162912f4d1 Mon Sep 17 00:00:00 2001 From: Linkwei Date: Wed, 6 Aug 2025 19:43:39 +0800 Subject: [PATCH] enhance: [skip e2e] Enhance standalone_embed add DEPLOY_MODE=STANDALONE (#43772) - add DEPLOY_MODE=STANDALONE - fix standalone_embed.bat milvus images version - add delete confirm https://github.com/milvus-io/milvus/issues/43760 https://github.com/milvus-io/milvus/issues/43681 Signed-off-by: Linkwei --- scripts/standalone_embed.bat | 21 +++++++++++++++------ scripts/standalone_embed.sh | 17 ++++++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/scripts/standalone_embed.bat b/scripts/standalone_embed.bat index 0da77e2ac3..a80d769e69 100644 --- a/scripts/standalone_embed.bat +++ b/scripts/standalone_embed.bat @@ -34,7 +34,7 @@ if "%1"=="restart" ( call :delete ) else ( echo Unknown command. - echo Please use standalone_embed.bat restart^|start^|stop^|upgrade^|delete + echo Please use standalone_embed.bat restart^|start^|stop^|delete exit /b 1 ) goto :eof @@ -68,6 +68,7 @@ docker run -d ^ -e ETCD_DATA_DIR=/var/lib/milvus/etcd ^ -e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml ^ -e COMMON_STORAGETYPE=local ^ + -e DEPLOY_MODE=STANDALONE ^ -v "%cd%\volumes\milvus:/var/lib/milvus" ^ -v "%cd%\embedEtcd.yaml:/milvus/configs/embedEtcd.yaml" ^ -v "%cd%\user.yaml:/milvus/configs/user.yaml" ^ @@ -144,11 +145,19 @@ echo Delete Milvus container successfully. goto :eof :delete -call :delete_container -rmdir /s /q "%cd%\volumes" -del /q embedEtcd.yaml -del /q user.yaml -echo Delete successfully. +set /p check="Please confirm if you'd like to proceed with the delete. This operation will delete the container and data. Confirm with 'y' for yes or 'n' for no. > " +if /i "%check%"=="y" ( + call :delete_container + rmdir /s /q "%cd%\volumes" + del /q embedEtcd.yaml + del /q user.yaml + echo Delete successfully. +) else ( + echo Exit delete + exit /b 0 +) goto :eof + + :EOF \ No newline at end of file diff --git a/scripts/standalone_embed.sh b/scripts/standalone_embed.sh index 8634bbd37f..59469e664c 100644 --- a/scripts/standalone_embed.sh +++ b/scripts/standalone_embed.sh @@ -47,6 +47,7 @@ EOF -e ETCD_DATA_DIR=/var/lib/milvus/etcd \ -e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \ -e COMMON_STORAGETYPE=local \ + -e DEPLOY_MODE=STANDALONE \ -v $(pwd)/volumes/milvus:/var/lib/milvus \ -v $(pwd)/embedEtcd.yaml:/milvus/configs/embedEtcd.yaml \ -v $(pwd)/user.yaml:/milvus/configs/user.yaml \ @@ -131,11 +132,17 @@ delete_container() { } delete() { - delete_container - sudo rm -rf $(pwd)/volumes - sudo rm -rf $(pwd)/embedEtcd.yaml - sudo rm -rf $(pwd)/user.yaml - echo "Delete successfully." + read -p "Please confirm if you'd like to proceed with the delete. This operation will delete the container and data. Confirm with 'y' for yes or 'n' for no. > " check + if [ "$check" == "y" ] ||[ "$check" == "Y" ];then + delete_container + sudo rm -rf $(pwd)/volumes + sudo rm -rf $(pwd)/embedEtcd.yaml + sudo rm -rf $(pwd)/user.yaml + echo "Delete successfully." + else + echo "Exit delete" + exit 0 + fi } upgrade() {