@@ -836,6 +836,188 @@ jobs:
836836
837837
838838
839+ test-backup-restore-local-storage :
840+ needs : unit-test-go
841+ name : Backup and restore with local storage
842+ runs-on : ubuntu-latest
843+ strategy :
844+ fail-fast : false
845+ matrix :
846+ image_tag : [v2.5.20, 2.6-latest]
847+
848+ steps :
849+ - uses : actions/checkout@v6
850+
851+ - name : Set up Python 3.10
852+ uses : actions/setup-python@v6
853+ with :
854+ python-version : ' 3.10'
855+ cache : pip
856+
857+ - uses : actions/setup-go@v6
858+ name : Set up Go ${{ env.go-version }}
859+ with :
860+ go-version : ${{ env.go-version }}
861+ cache : true
862+
863+ - name : Build
864+ timeout-minutes : 5
865+ shell : bash
866+ run : |
867+ go get
868+ go build
869+
870+ - name : Install dependency
871+ timeout-minutes : 5
872+ working-directory : tests
873+ shell : bash
874+ run : |
875+ pip install -r requirements.txt --trusted-host https://test.pypi.org
876+
877+ - name : Deploy Milvus with local storage
878+ timeout-minutes : 15
879+ shell : bash
880+ working-directory : deployment/standalone
881+ run : |
882+ tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.image_tag }}) && echo $tag
883+ mkdir -p volumes/milvus
884+ sudo chmod -R 777 volumes
885+
886+ # Create embedEtcd.yaml
887+ cat > embedEtcd.yaml <<'ETCD'
888+ listen-client-urls: http://0.0.0.0:2379
889+ advertise-client-urls: http://0.0.0.0:2379
890+ quota-backend-bytes: 4294967296
891+ auto-compaction-mode: revision
892+ auto-compaction-retention: '1000'
893+ ETCD
894+
895+ # Create user.yaml for custom config
896+ cat > user.yaml <<'USERCFG'
897+ log:
898+ level: debug
899+ dataNode:
900+ segment:
901+ insertBufSize: 4096
902+ USERCFG
903+ cat user.yaml
904+
905+ # Match official standalone docker deployment:
906+ # https://milvus.io/docs/install_standalone-docker.md
907+ sudo docker run -d \
908+ --name milvus-standalone \
909+ --security-opt seccomp:unconfined \
910+ -e ETCD_USE_EMBED=true \
911+ -e ETCD_DATA_DIR=/var/lib/milvus/etcd \
912+ -e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \
913+ -e COMMON_STORAGETYPE=local \
914+ -e DEPLOY_MODE=STANDALONE \
915+ -v $(pwd)/volumes/milvus:/var/lib/milvus \
916+ -v $(pwd)/embedEtcd.yaml:/milvus/configs/embedEtcd.yaml \
917+ -v $(pwd)/user.yaml:/milvus/configs/user.yaml \
918+ -p 19530:19530 \
919+ -p 9091:9091 \
920+ -p 2379:2379 \
921+ --health-cmd="curl -f http://localhost:9091/healthz" \
922+ --health-interval=30s \
923+ --health-start-period=90s \
924+ --health-timeout=20s \
925+ --health-retries=3 \
926+ milvusdb/milvus:${tag} \
927+ milvus run standalone
928+
929+ # Wait for healthy
930+ for i in $(seq 1 60); do
931+ status=$(sudo docker inspect --format='{{.State.Health.Status}}' milvus-standalone 2>/dev/null || echo "not ready")
932+ echo "Attempt $i: $status"
933+ if [ "$status" = "healthy" ]; then break; fi
934+ sleep 5
935+ done
936+ sudo docker ps -a
937+ # Fix permissions on Milvus data dir created by container root
938+ sudo chmod -R 777 volumes
939+
940+ - name : Export container status after deploy
941+ if : ${{ always() }}
942+ shell : bash
943+ working-directory : deployment/standalone
944+ run : |
945+ echo "=== Container Status ==="
946+ sudo docker ps -a || true
947+ echo "=== Standalone Container Logs ==="
948+ sudo docker logs milvus-standalone 2>&1 | tail -100 || true
949+
950+ - name : Configure backup.yaml for local storage
951+ timeout-minutes : 1
952+ shell : bash
953+ run : |
954+ yq -i '.log.level = "debug"' configs/backup.yaml
955+ yq -i '.minio.storageType = "local"' configs/backup.yaml
956+ yq -i '.minio.localPath = "deployment/standalone/volumes/milvus/data"' configs/backup.yaml
957+ yq -i '.minio.bucketName = ""' configs/backup.yaml
958+ yq -i '.minio.rootPath = "files"' configs/backup.yaml
959+ yq -i '.minio.backupStorageType = "local"' configs/backup.yaml
960+ yq -i '.minio.backupLocalPath = "deployment/standalone/volumes/backup"' configs/backup.yaml
961+ yq -i '.minio.backupBucketName = ""' configs/backup.yaml
962+ yq -i '.minio.backupRootPath = "backup"' configs/backup.yaml
963+ cat configs/backup.yaml
964+
965+ - name : Prepare data
966+ timeout-minutes : 5
967+ shell : bash
968+ run : |
969+ python example/prepare_data.py
970+
971+ - name : Fix permissions after data preparation
972+ shell : bash
973+ working-directory : deployment/standalone
974+ run : |
975+ sudo chmod -R 777 volumes
976+
977+ - name : Backup
978+ timeout-minutes : 5
979+ shell : bash
980+ run : |
981+ ./milvus-backup check
982+ ./milvus-backup list
983+ ./milvus-backup create -n my_backup
984+ ./milvus-backup list
985+
986+ - name : Restore backup
987+ timeout-minutes : 5
988+ shell : bash
989+ run : |
990+ ./milvus-backup restore -n my_backup -s _recover
991+
992+ - name : Verify data
993+ timeout-minutes : 5
994+ shell : bash
995+ run : |
996+ python example/verify_data.py
997+
998+ - name : Delete backup
999+ timeout-minutes : 5
1000+ shell : bash
1001+ run : |
1002+ ./milvus-backup delete -n my_backup
1003+ ./milvus-backup list
1004+
1005+ - name : Export logs
1006+ if : ${{ always() }}
1007+ shell : bash
1008+ run : |
1009+ mkdir -p /tmp/ci_logs
1010+ sudo docker logs milvus-standalone > /tmp/ci_logs/standalone.log 2>&1 || true
1011+
1012+ - name : Upload logs
1013+ if : ${{ ! success() }}
1014+ uses : actions/upload-artifact@v7
1015+ with :
1016+ name : local-storage-logs-${{ matrix.image_tag }}
1017+ path : |
1018+ /tmp/ci_logs
1019+ ./server.log
1020+
8391021 test-backup-restore-api :
8401022 name : Backup and restore api
8411023 runs-on : ubuntu-latest
0 commit comments