mirror of https://github.com/milvus-io/milvus.git
Print Milvus banner when start service (#5953)
* print Milvus banner when start service Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update banner Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update messages Signed-off-by: yudong.cai <yudong.cai@zilliz.com>pull/5968/head
parent
cdc89648cf
commit
438e7fb4da
9
Makefile
9
Makefile
|
@ -83,9 +83,16 @@ binlog:
|
|||
@echo "Building binlog ..."
|
||||
@mkdir -p $(INSTALL_PATH) && go env -w CGO_ENABLED="1" && GO111MODULE=on $(GO) build -o $(INSTALL_PATH)/binlog $(PWD)/cmd/binlog/main.go 1>/dev/null
|
||||
|
||||
BUILD_TAGS = $(shell git describe --tags --always --dirty="-dev")
|
||||
BUILD_TIME = $(shell date)
|
||||
GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||
GO_VERSION = $(shell go version)
|
||||
|
||||
milvus: build-cpp
|
||||
@echo "Building Milvus ..."
|
||||
@mkdir -p $(INSTALL_PATH) && go env -w CGO_ENABLED="1" && GO111MODULE=on $(GO) build -o $(INSTALL_PATH)/milvus $(PWD)/cmd/main.go 1>/dev/null
|
||||
@mkdir -p $(INSTALL_PATH) && go env -w CGO_ENABLED="1" && GO111MODULE=on $(GO) build \
|
||||
-ldflags="-X 'main.BuildTags=$(BUILD_TAGS)' -X 'main.BuildTime=$(BUILD_TIME)' -X 'main.GitCommit=$(GIT_COMMIT)' -X 'main.GoVersion=$(GO_VERSION)'" \
|
||||
-o $(INSTALL_PATH)/milvus $(PWD)/cmd/main.go 1>/dev/null
|
||||
|
||||
build-go: milvus
|
||||
|
||||
|
|
23
cmd/main.go
23
cmd/main.go
|
@ -37,6 +37,28 @@ const (
|
|||
roleStandalone = "standalone"
|
||||
)
|
||||
|
||||
var (
|
||||
BuildTags = "unknown"
|
||||
BuildTime = "unknown"
|
||||
GitCommit = "unknown"
|
||||
GoVersion = "unknown"
|
||||
)
|
||||
|
||||
func printBanner() {
|
||||
fmt.Println()
|
||||
fmt.Println(" __ _________ _ ____ ______ ")
|
||||
fmt.Println(" / |/ / _/ /| | / / / / / __/ ")
|
||||
fmt.Println(" / /|_/ // // /_| |/ / /_/ /\\ \\ ")
|
||||
fmt.Println(" /_/ /_/___/____/___/\\____/___/ ")
|
||||
fmt.Println()
|
||||
fmt.Println("Welcome to use Milvus!")
|
||||
fmt.Println("Version: " + BuildTags)
|
||||
fmt.Println("Built: " + BuildTime)
|
||||
fmt.Println("GitCommit: " + GitCommit)
|
||||
fmt.Println("GoVersion: " + GoVersion)
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
func getPidFileName(serverType string, alias string) string {
|
||||
var filename string
|
||||
if len(alias) != 0 {
|
||||
|
@ -239,6 +261,7 @@ func main() {
|
|||
filename := getPidFileName(serverType, svrAlias)
|
||||
switch command {
|
||||
case "run":
|
||||
printBanner()
|
||||
fd, err := createPidFile(filename, runtimeDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Reference in New Issue