Spaces:
Runtime error
Runtime error
Update standalone_embed.sh
Browse files- standalone_embed.sh +11 -11
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,21 +104,21 @@ stop() {
|
|
| 104 |
}
|
| 105 |
|
| 106 |
delete() {
|
| 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 failed."
|
| 117 |
exit 1
|
| 118 |
fi
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
echo "Delete successfully."
|
| 123 |
}
|
| 124 |
|
|
|
|
| 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() {
|
| 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 failed."
|
| 117 |
exit 1
|
| 118 |
fi
|
| 119 |
+
rm -rf $(pwd)/volumes
|
| 120 |
+
rm -rf $(pwd)/embedEtcd.yaml
|
| 121 |
+
rm -rf $(pwd)/user.yaml
|
| 122 |
echo "Delete successfully."
|
| 123 |
}
|
| 124 |
|