@@ -836,6 +836,185 @@ 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 : [master-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+
904+ if [ "${{ matrix.image_tag }}" == "master-latest" ]; then
905+ yq -i '.common.storage.enablev2 = true' user.yaml
906+ yq -i '.common.storage.useLoonFFI = false' user.yaml
907+ fi
908+ cat user.yaml
909+
910+ # Match official standalone docker deployment:
911+ # https://milvus.io/docs/install_standalone-docker.md
912+ sudo docker run -d \
913+ --name milvus-standalone \
914+ --security-opt seccomp:unconfined \
915+ -e ETCD_USE_EMBED=true \
916+ -e ETCD_DATA_DIR=/var/lib/milvus/etcd \
917+ -e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \
918+ -e COMMON_STORAGETYPE=local \
919+ -e DEPLOY_MODE=STANDALONE \
920+ -v $(pwd)/volumes/milvus:/var/lib/milvus \
921+ -v $(pwd)/embedEtcd.yaml:/milvus/configs/embedEtcd.yaml \
922+ -v $(pwd)/user.yaml:/milvus/configs/user.yaml \
923+ -p 19530:19530 \
924+ -p 9091:9091 \
925+ -p 2379:2379 \
926+ --health-cmd="curl -f http://localhost:9091/healthz" \
927+ --health-interval=30s \
928+ --health-start-period=90s \
929+ --health-timeout=20s \
930+ --health-retries=3 \
931+ milvusdb/milvus:${tag} \
932+ milvus run standalone
933+
934+ # Wait for healthy
935+ for i in $(seq 1 60); do
936+ status=$(sudo docker inspect --format='{{.State.Health.Status}}' milvus-standalone 2>/dev/null || echo "not ready")
937+ echo "Attempt $i: $status"
938+ if [ "$status" = "healthy" ]; then break; fi
939+ sleep 5
940+ done
941+ sudo docker ps -a
942+
943+ - name : Export container status after deploy
944+ if : ${{ always() }}
945+ shell : bash
946+ working-directory : deployment/standalone
947+ run : |
948+ echo "=== Container Status ==="
949+ sudo docker ps -a || true
950+ echo "=== Standalone Container Logs ==="
951+ sudo docker logs milvus-standalone 2>&1 | tail -100 || true
952+
953+ - name : Configure backup.yaml for local storage
954+ timeout-minutes : 1
955+ shell : bash
956+ run : |
957+ yq -i '.log.level = "debug"' configs/backup.yaml
958+ yq -i '.minio.storageType = "local"' configs/backup.yaml
959+ yq -i '.minio.localPath = "deployment/standalone/volumes/milvus/data"' configs/backup.yaml
960+ yq -i '.minio.bucketName = "a-bucket"' configs/backup.yaml
961+ yq -i '.minio.rootPath = "files"' configs/backup.yaml
962+ yq -i '.minio.backupStorageType = "local"' configs/backup.yaml
963+ yq -i '.minio.backupLocalPath = "deployment/standalone/volumes/backup"' configs/backup.yaml
964+ yq -i '.minio.backupBucketName = "milvus-backup"' configs/backup.yaml
965+ yq -i '.minio.backupRootPath = "backup"' configs/backup.yaml
966+ cat configs/backup.yaml
967+
968+ - name : Prepare data
969+ timeout-minutes : 5
970+ shell : bash
971+ run : |
972+ python example/prepare_data.py
973+
974+ - name : Backup
975+ timeout-minutes : 5
976+ shell : bash
977+ run : |
978+ ./milvus-backup check
979+ ./milvus-backup list
980+ ./milvus-backup create -n my_backup
981+ ./milvus-backup list
982+
983+ - name : Restore backup
984+ timeout-minutes : 5
985+ shell : bash
986+ run : |
987+ ./milvus-backup restore -n my_backup -s _recover
988+
989+ - name : Verify data
990+ timeout-minutes : 5
991+ shell : bash
992+ run : |
993+ python example/verify_data.py
994+
995+ - name : Delete backup
996+ timeout-minutes : 5
997+ shell : bash
998+ run : |
999+ ./milvus-backup delete -n my_backup
1000+ ./milvus-backup list
1001+
1002+ - name : Export logs
1003+ if : ${{ always() }}
1004+ shell : bash
1005+ run : |
1006+ mkdir -p /tmp/ci_logs
1007+ sudo docker logs milvus-standalone > /tmp/ci_logs/standalone.log 2>&1 || true
1008+
1009+ - name : Upload logs
1010+ if : ${{ ! success() }}
1011+ uses : actions/upload-artifact@v7
1012+ with :
1013+ name : local-storage-logs-${{ matrix.image_tag }}
1014+ path : |
1015+ /tmp/ci_logs
1016+ ./server.log
1017+
8391018 test-backup-restore-api :
8401019 name : Backup and restore api
8411020 runs-on : ubuntu-latest
0 commit comments