Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Milvus 2.5 function feature by bypassing SDK #492

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Build
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Build
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Build
Expand Down Expand Up @@ -406,7 +406,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: "true"

- name: Creating kind cluster
Expand Down Expand Up @@ -555,7 +555,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Creating kind cluster
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Creating kind cluster
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.18.0'
go-version: '1.23'
cache: true

- name: Creating kind cluster
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.23
cache: true
- uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.23
cache: true

- name: Set up QEMU
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

FROM golang:1.18 AS builder
FROM golang:1.23 AS builder

ENV CGO_ENABLED=0

Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# Variables
BINARY_NAME=milvus-backup
PKG := github.com/zilliztech/milvus-backup
VERSION=$(shell git describe --tags --always)
COMMIT=$(shell git rev-parse --short HEAD)
DATE=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')

LDFLAGS += -X "$(PKG)/version.Version=$(VERSION)"
LDFLAGS += -X "$(PKG)/version.Commit=$(COMMIT)"
LDFLAGS += -X "$(PKG)/version.Date=$(DATE)"

# Default target
all: gen build

# Build the binary
build:
@echo "Building binary..."
GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)" -o $(BINARY_NAME)
GO111MODULE=on CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o $(BINARY_NAME)

gen:
./scripts/gen_swag.sh
./scripts/gen_proto.sh

fmt:
@echo Formatting code...
@goimports -w --local $(PKG) ./
@echo Format code done

.PHONY: all build gen
3 changes: 2 additions & 1 deletion cmd/backup_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"strings"

"github.com/spf13/cobra"
"github.com/zilliztech/milvus-backup/core/paramtable"
"gopkg.in/yaml.v3"

"github.com/zilliztech/milvus-backup/core/paramtable"
)

var configCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
)
Expand All @@ -20,7 +21,7 @@ var checkCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)

resp := backupContext.Check(context)
fmt.Println(resp)
Expand Down
3 changes: 2 additions & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

jsoniter "github.com/json-iterator/go"
"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
"github.com/zilliztech/milvus-backup/core/proto/backuppb"
Expand Down Expand Up @@ -35,7 +36,7 @@ var createBackupCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)

start := time.Now().Unix()
var collectionNameArr []string
Expand Down
3 changes: 2 additions & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
"github.com/zilliztech/milvus-backup/core/proto/backuppb"
Expand All @@ -24,7 +25,7 @@ var deleteBackupCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)

resp := backupContext.DeleteBackup(context, &backuppb.DeleteBackupRequest{
BackupName: deleteBackName,
Expand Down
3 changes: 2 additions & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
"github.com/zilliztech/milvus-backup/core/proto/backuppb"
Expand All @@ -27,7 +28,7 @@ var getBackupCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)

resp := backupContext.GetBackup(context, &backuppb.GetBackupRequest{
BackupName: getBackName,
Expand Down
3 changes: 2 additions & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
"github.com/zilliztech/milvus-backup/core/proto/backuppb"
Expand All @@ -25,7 +26,7 @@ var listBackupCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)

backups := backupContext.ListBackups(context, &backuppb.ListBackupsRequest{
CollectionName: collectionName,
Expand Down
3 changes: 2 additions & 1 deletion cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

jsoniter "github.com/json-iterator/go"
"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
"github.com/zilliztech/milvus-backup/core/proto/backuppb"
Expand Down Expand Up @@ -43,7 +44,7 @@ var restoreBackupCmd = &cobra.Command{
params.Init()

context := context.Background()
backupContext := core.CreateBackupContext(context, params)
backupContext := core.CreateBackupContext(context, &params)
log.Info("restore cmd input args", zap.Strings("args", args))
start := time.Now().Unix()
var collectionNameArr []string
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var rootCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
Error(cmd, args, errors.New("unrecognized command"))
},
PersistentPreRun: func(cmd *cobra.Command, args []string){
PersistentPreRun: func(cmd *cobra.Command, args []string) {
setEnvs(yamlOverrides)
},
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strconv"

"github.com/spf13/cobra"

"github.com/zilliztech/milvus-backup/core"
"github.com/zilliztech/milvus-backup/core/paramtable"
)
Expand All @@ -31,7 +32,7 @@ var serverCmd = &cobra.Command{
params.Init()

context := context.Background()
server, err := core.NewServer(context, params, core.Port(port))
server, err := core.NewServer(context, &params, core.Port(port))
if err != nil {
fmt.Errorf("fail to create backup server, %s", err.Error())
}
Expand Down
Loading
Loading