From 0618191483822a9f442038caec32dd28641108e1 Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 23 Nov 2021 14:56:20 +0800 Subject: [PATCH 1/5] remove darwin arm64 --- Jenkinsfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ea315444..18ccdbf7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,7 @@ pipeline { sh label: 'package-linux-arm64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && tar cfz ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-linux-arm64.tar.gz console-linux-arm64 console.yml ' sh label: 'package-mac-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-amd64.zip console-mac-amd64 console.yml ' - sh label: 'package-mac-arm64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-arm64.zip console-mac-arm64 console.yml ' +// sh label: 'package-mac-arm64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-arm64.zip console-mac-arm64 console.yml ' sh label: 'package-win-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-amd64.zip console-windows-amd64 console.yml ' sh label: 'package-win-386', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-386.zip console-windows-386 console.yml ' archiveArtifacts artifacts: 'console-$VERSION-$BUILD_NUMBER-*.tar.gz', fingerprint: true, followSymlinks: true, onlyIfSuccessful: false diff --git a/Makefile b/Makefile index d0fa59d9..4962d9f0 100755 --- a/Makefile +++ b/Makefile @@ -125,7 +125,7 @@ build-arm: config build-darwin: config GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(OUTPUT_DIR)/$(APP_NAME)-mac-amd64 # GOOS=darwin GOARCH=386 $(GOBUILD) -o $(OUTPUT_DIR)/$(APP_NAME)-mac-386 - GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(OUTPUT_DIR)/$(APP_NAME)-mac-arm64 +# GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(OUTPUT_DIR)/$(APP_NAME)-mac-arm64 @$(MAKE) restore-generated-file build-bsd: config From f78112c5c0384a574a445343ac3b8e8cc3549bee Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 23 Nov 2021 15:21:19 +0800 Subject: [PATCH 2/5] update default config --- console.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console.yml b/console.yml index 9664305a..a6b79c24 100644 --- a/console.yml +++ b/console.yml @@ -15,7 +15,7 @@ web: path: .public vfs: true local: true - #api_endpoint: 10.0.2.5:9000 #配置 api_endpoint 可覆盖默认 api 访问地址 + #api_endpoint: 10.0.2.5:2900 #配置 api_endpoint 可覆盖默认 api 访问地址 network: binding: 0.0.0.0:9000 skip_occupied_port: true From 01779036376e2b2ec418a6cf058bb004a0d387b2 Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 23 Nov 2021 15:40:47 +0800 Subject: [PATCH 3/5] archive zip --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 18ccdbf7..3d5403ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { // sh label: 'package-mac-arm64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-arm64.zip console-mac-arm64 console.yml ' sh label: 'package-win-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-amd64.zip console-windows-amd64 console.yml ' sh label: 'package-win-386', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-386.zip console-windows-386 console.yml ' - archiveArtifacts artifacts: 'console-$VERSION-$BUILD_NUMBER-*.tar.gz', fingerprint: true, followSymlinks: true, onlyIfSuccessful: false + archiveArtifacts artifacts: 'console-$VERSION-$BUILD_NUMBER-*.*', fingerprint: true, followSymlinks: true, onlyIfSuccessful: false } } } From 6ec84370b16641d1cb1eb720dbce3d6b7057d087 Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 23 Nov 2021 15:57:33 +0800 Subject: [PATCH 4/5] update build file --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d5403ea..b10d3ac6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,8 +37,8 @@ pipeline { sh label: 'package-mac-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-amd64.zip console-mac-amd64 console.yml ' // sh label: 'package-mac-arm64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-mac-arm64.zip console-mac-arm64 console.yml ' - sh label: 'package-win-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-amd64.zip console-windows-amd64 console.yml ' - sh label: 'package-win-386', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-386.zip console-windows-386 console.yml ' + sh label: 'package-win-amd64', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-amd64.zip console-windows-amd64.exe console.yml ' + sh label: 'package-win-386', script: 'cd /home/jenkins/go/src/infini.sh/search-center/bin && zip -r ${WORKSPACE}/console-$VERSION-$BUILD_NUMBER-windows-386.zip console-windows-386.exe console.yml ' archiveArtifacts artifacts: 'console-$VERSION-$BUILD_NUMBER-*.*', fingerprint: true, followSymlinks: true, onlyIfSuccessful: false } } From a1c5394f70765ededa5267be7330292ad8343794 Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 23 Nov 2021 17:12:10 +0800 Subject: [PATCH 5/5] support embedding api to ui module --- console.yml | 21 ++++----------------- main.go | 19 +++++++++++++++++-- ui.go | 7 +++---- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/console.yml b/console.yml index a6b79c24..ece0db39 100644 --- a/console.yml +++ b/console.yml @@ -1,33 +1,25 @@ -#配置应用存储数据的 Elasticsearch 集群信息 +#存储极限数据平台相关数据的 Elasticsearch 集群信息,版本 v7.0+ elasticsearch: - name: default enabled: true monitored: true - endpoint: http://localhost:9200 + endpoint: http://192.168.3.188:9299 basic_auth: username: elastic password: ZBdkVQUUdF1Sir4X4BGB + #前端 UI HTTP 配置 web: enabled: true + embedding_api: true ui: enabled: true path: .public vfs: true local: true - #api_endpoint: 10.0.2.5:2900 #配置 api_endpoint 可覆盖默认 api 访问地址 network: binding: 0.0.0.0:9000 skip_occupied_port: true -#API IP 地址需要在前端可连通(虚拟机环境安装,宿主机访问) -api: - enabled: true - network: - binding: 0.0.0.0:2900 - skip_occupied_port: true - cors: - allowed_origins: - - "*" elastic: elasticsearch: default @@ -41,11 +33,6 @@ elastic: template_name: ".infini" index_prefix: ".infini_" -search-center: - ui_path: .public - ui_vfs: true - ui_local: true - metrics: enabled: true major_ip_pattern: "192.*" diff --git a/main.go b/main.go index 4e75ab2d..953ca539 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,14 @@ import ( "infini.sh/framework/core/module" "infini.sh/framework/core/orm" pipe "infini.sh/framework/core/pipeline" - "infini.sh/framework/modules" + elastic2 "infini.sh/framework/modules/elastic" + "infini.sh/framework/modules/filter" "infini.sh/framework/modules/metrics" + "infini.sh/framework/modules/pipeline" + "infini.sh/framework/modules/queue" + "infini.sh/framework/modules/stats" + "infini.sh/framework/modules/task" + "infini.sh/framework/modules/ui" "infini.sh/framework/plugins/elastic/json_indexing" "infini.sh/search-center/config" "infini.sh/search-center/model" @@ -40,7 +46,16 @@ func main() { if app.Setup(func() { //load core modules first - modules.Register() + module.RegisterSystemModule(elastic2.ElasticModule{}) + module.RegisterSystemModule(filter.FilterModule{}) + module.RegisterSystemModule(&stats.SimpleStatsModule{}) + module.RegisterSystemModule(&queue.DiskQueue{}) + module.RegisterSystemModule(&queue.RedisModule{}) + module.RegisterSystemModule(&queue.QueueModule{}) + module.RegisterSystemModule(&ui.UIModule{}) + module.RegisterSystemModule(&pipeline.PipeModule{}) + module.RegisterSystemModule(&task.TaskModule{}) + pipe.RegisterProcessorPlugin("json_indexing", json_indexing.New) module.RegisterUserPlugin(&metrics.MetricsModule{}) diff --git a/ui.go b/ui.go index 460cf2d1..d1625365 100644 --- a/ui.go +++ b/ui.go @@ -11,7 +11,6 @@ import ( log "github.com/cihub/seelog" "infini.sh/framework/core/api" - "infini.sh/framework/core/ui" "infini.sh/framework/core/util" "infini.sh/framework/core/vfs" uiapi "infini.sh/search-center/api" @@ -27,7 +26,7 @@ func (h UI) InitUI() { vfs.RegisterFS(public.StaticFS{StaticFolder: h.Config.UI.LocalPath, TrimLeftPath: h.Config.UI.LocalPath, CheckLocalFirst: h.Config.UI.LocalEnabled, SkipVFS: !h.Config.UI.VFSEnabled}) - ui.HandleUI("/", vfs.FileServer(vfs.VFS())) + api.HandleUI("/", vfs.FileServer(vfs.VFS())) uiapi.Init(h.Config) @@ -37,14 +36,14 @@ func (h UI) InitUI() { apiEndpoint = fmt.Sprintf("%s://%s", apiConfig.GetSchema(), apiConfig.NetworkConfig.GetPublishAddr()) } - ui.HandleUIFunc("/config", func(w http.ResponseWriter, req *http.Request){ + api.HandleUIFunc("/config", func(w http.ResponseWriter, req *http.Request){ buf, _ := json.Marshal(util.MapStr{ "api_endpoint": apiEndpoint, }) w.Write(buf) }) - ui.HandleUIFunc("/api/", func(w http.ResponseWriter, req *http.Request) { + api.HandleUIFunc("/api/", func(w http.ResponseWriter, req *http.Request) { log.Warn("api: ", req.URL, " not implemented") request, err := h.GetRawBody(req) if err != nil {