Spaces:
Runtime error
Runtime error
Update standalone_embed.sh
Browse files- standalone_embed.sh +12 -12
standalone_embed.sh
CHANGED
|
@@ -29,7 +29,7 @@ EOF
|
|
| 29 |
# Extra config to override default milvus.yaml
|
| 30 |
EOF
|
| 31 |
|
| 32 |
-
|
| 33 |
--name milvus-standalone \
|
| 34 |
--security-opt seccomp:unconfined \
|
| 35 |
-e ETCD_USE_EMBED=true \
|
|
@@ -55,7 +55,7 @@ wait_for_milvus_running() {
|
|
| 55 |
echo "Wait for Milvus Starting..."
|
| 56 |
while true
|
| 57 |
do
|
| 58 |
-
res=`
|
| 59 |
if [ $res -eq 1 ]
|
| 60 |
then
|
| 61 |
echo "Start successfully."
|
|
@@ -67,17 +67,17 @@ wait_for_milvus_running() {
|
|
| 67 |
}
|
| 68 |
|
| 69 |
start() {
|
| 70 |
-
res=`
|
| 71 |
if [ $res -eq 1 ]
|
| 72 |
then
|
| 73 |
echo "Milvus is running."
|
| 74 |
exit 0
|
| 75 |
fi
|
| 76 |
|
| 77 |
-
res=`
|
| 78 |
if [ $res -eq 1 ]
|
| 79 |
then
|
| 80 |
-
|
| 81 |
else
|
| 82 |
run_embed
|
| 83 |
fi
|
|
@@ -92,7 +92,7 @@ start() {
|
|
| 92 |
}
|
| 93 |
|
| 94 |
stop() {
|
| 95 |
-
|
| 96 |
|
| 97 |
if [ $? -ne 0 ]
|
| 98 |
then
|
|
@@ -104,13 +104,13 @@ stop() {
|
|
| 104 |
}
|
| 105 |
|
| 106 |
delete_container() {
|
| 107 |
-
res=`
|
| 108 |
if [ $res -eq 1 ]
|
| 109 |
then
|
| 110 |
echo "Please stop Milvus service before delete."
|
| 111 |
exit 1
|
| 112 |
fi
|
| 113 |
-
|
| 114 |
if [ $? -ne 0 ]
|
| 115 |
then
|
| 116 |
echo "Delete milvus container failed."
|
|
@@ -121,16 +121,16 @@ delete_container() {
|
|
| 121 |
|
| 122 |
delete() {
|
| 123 |
delete_container
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
echo "Delete successfully."
|
| 128 |
}
|
| 129 |
|
| 130 |
upgrade() {
|
| 131 |
read -p "Please confirm if you'd like to proceed with the upgrade. The default will be to the latest version. Confirm with 'y' for yes or 'n' for no. > " check
|
| 132 |
if [ "$check" == "y" ] ||[ "$check" == "Y" ];then
|
| 133 |
-
res=`
|
| 134 |
if [ $res -eq 1 ]
|
| 135 |
then
|
| 136 |
stop
|
|
|
|
| 29 |
# Extra config to override default milvus.yaml
|
| 30 |
EOF
|
| 31 |
|
| 32 |
+
docker run -d \
|
| 33 |
--name milvus-standalone \
|
| 34 |
--security-opt seccomp:unconfined \
|
| 35 |
-e ETCD_USE_EMBED=true \
|
|
|
|
| 55 |
echo "Wait for Milvus Starting..."
|
| 56 |
while true
|
| 57 |
do
|
| 58 |
+
res=`docker ps|grep milvus-standalone|grep healthy|wc -l`
|
| 59 |
if [ $res -eq 1 ]
|
| 60 |
then
|
| 61 |
echo "Start successfully."
|
|
|
|
| 67 |
}
|
| 68 |
|
| 69 |
start() {
|
| 70 |
+
res=`docker ps|grep milvus-standalone|grep healthy|wc -l`
|
| 71 |
if [ $res -eq 1 ]
|
| 72 |
then
|
| 73 |
echo "Milvus is running."
|
| 74 |
exit 0
|
| 75 |
fi
|
| 76 |
|
| 77 |
+
res=` docker ps -a|grep milvus-standalone|wc -l`
|
| 78 |
if [ $res -eq 1 ]
|
| 79 |
then
|
| 80 |
+
docker start milvus-standalone 1> /dev/null
|
| 81 |
else
|
| 82 |
run_embed
|
| 83 |
fi
|
|
|
|
| 92 |
}
|
| 93 |
|
| 94 |
stop() {
|
| 95 |
+
docker stop milvus-standalone 1> /dev/null
|
| 96 |
|
| 97 |
if [ $? -ne 0 ]
|
| 98 |
then
|
|
|
|
| 104 |
}
|
| 105 |
|
| 106 |
delete_container() {
|
| 107 |
+
res=` docker ps|grep milvus-standalone|wc -l`
|
| 108 |
if [ $res -eq 1 ]
|
| 109 |
then
|
| 110 |
echo "Please stop Milvus service before delete."
|
| 111 |
exit 1
|
| 112 |
fi
|
| 113 |
+
docker rm milvus-standalone 1> /dev/null
|
| 114 |
if [ $? -ne 0 ]
|
| 115 |
then
|
| 116 |
echo "Delete milvus container failed."
|
|
|
|
| 121 |
|
| 122 |
delete() {
|
| 123 |
delete_container
|
| 124 |
+
rm -rf $(pwd)/volumes
|
| 125 |
+
rm -rf $(pwd)/embedEtcd.yaml
|
| 126 |
+
rm -rf $(pwd)/user.yaml
|
| 127 |
echo "Delete successfully."
|
| 128 |
}
|
| 129 |
|
| 130 |
upgrade() {
|
| 131 |
read -p "Please confirm if you'd like to proceed with the upgrade. The default will be to the latest version. Confirm with 'y' for yes or 'n' for no. > " check
|
| 132 |
if [ "$check" == "y" ] ||[ "$check" == "Y" ];then
|
| 133 |
+
res=` docker ps -a|grep milvus-standalone|wc -l`
|
| 134 |
if [ $res -eq 1 ]
|
| 135 |
then
|
| 136 |
stop
|