mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
🚀 Enhancements in Offline Deployment Documentation, CICD Process Upgrades, Deployment Optimization, and Additional Fixes (#1721)
* feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: support openim prom enbels Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add go formity checker Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim offline deployment docs Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim offline deployment docs Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim offline deployment docs Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim support arm arch Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: fox openim support arm arch Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: fox openim support arm arch Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim v3.4 and v3.5 changelog Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add devcontainer.json file Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim v3.4 and v3.5 changelog Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim v3.4 and v3.5 changelog Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * Update util.sh amend shell get pid command fd on mac. * feat: Add To start developing OpenIM Docs Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * docs: update openim readme and dov container Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: set openim lint Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: fix go release scripts Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: fix go release scripts Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * docs(changelog): add CHANGELOG-3.5.0+6.a09200e.md * docs(changelog): add CHANGELOG-3.5.0+2.e0bd54f.md * docs(changelog): add CHANGELOG-3.5.0+2.e0bd54f-1-g4ce6a0fa6.md * feat: set openim lint Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * docs(changelog): add CHANGELOG-3.5.0+2.e0bd54f-3-g52f9fc209.md * docs(changelog): add CHANGELOG-3.5.0+2.e0bd54f-4-g87f685b17.md * docs(changelog): add CHANGELOG-3.5.0.md * feat: set openim lint Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: fix scripts functions upload Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: fix scripts functions upload Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * docs(changelog): add CHANGELOG-3.5.0.md * fix: fix scripts functions upload Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: fix scripts functions upload Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: set openim lint Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> Co-authored-by: mrwenhui <mr.wenhui@gmail.com>
This commit is contained in:
@@ -33,19 +33,20 @@ import (
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
const (
|
||||
// defaultCfgPath is the default path of the configuration file.
|
||||
defaultCfgPath = "../../../../../config/config.yaml"
|
||||
minioHealthCheckDuration = 1
|
||||
maxRetry = 100
|
||||
maxRetry = 300
|
||||
componentStartErrCode = 6000
|
||||
configErrCode = 6001
|
||||
mongoConnTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -55,8 +56,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
cfgPath = flag.String("c", defaultCfgPath, "Path to the configuration file")
|
||||
|
||||
cfgPath = flag.String("c", defaultCfgPath, "Path to the configuration file")
|
||||
ErrComponentStart = errs.NewCodeError(componentStartErrCode, "ComponentStartErr")
|
||||
ErrConfig = errs.NewCodeError(configErrCode, "Config file is incorrect")
|
||||
)
|
||||
@@ -95,7 +95,7 @@ func main() {
|
||||
|
||||
for i := 0; i < maxRetry; i++ {
|
||||
if i != 0 {
|
||||
time.Sleep(3 * time.Second)
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
fmt.Printf("Checking components Round %v...\n", i+1)
|
||||
|
||||
@@ -141,19 +141,25 @@ func getEnv(key, fallback string) string {
|
||||
return fallback
|
||||
}
|
||||
|
||||
// checkMongo checks the MongoDB connection
|
||||
// checkMongo checks the MongoDB connection without retries
|
||||
func checkMongo() (string, error) {
|
||||
// Use environment variables or fallback to config
|
||||
uri := getEnv("MONGO_URI", buildMongoURI())
|
||||
|
||||
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), mongoConnTimeout)
|
||||
defer cancel()
|
||||
|
||||
str := "ths addr is:" + strings.Join(config.Config.Mongo.Address, ",")
|
||||
|
||||
client, err := mongo.Connect(ctx, options.Client().ApplyURI(uri))
|
||||
if err != nil {
|
||||
return "", errs.Wrap(errStr(err, str))
|
||||
}
|
||||
defer client.Disconnect(context.TODO())
|
||||
defer client.Disconnect(context.Background())
|
||||
|
||||
if err = client.Ping(context.TODO(), nil); err != nil {
|
||||
ctx, cancel = context.WithTimeout(context.Background(), mongoConnTimeout)
|
||||
defer cancel()
|
||||
|
||||
if err = client.Ping(ctx, nil); err != nil {
|
||||
return "", errs.Wrap(errStr(err, str))
|
||||
}
|
||||
|
||||
@@ -222,8 +228,8 @@ func checkMinio() (string, error) {
|
||||
defer cancel()
|
||||
|
||||
if minioClient.IsOffline() {
|
||||
// str := fmt.Sprintf("Minio server is offline;%s", str)
|
||||
// return "", ErrComponentStart.Wrap(str)
|
||||
str := fmt.Sprintf("Minio server is offline;%s", str)
|
||||
return "", ErrComponentStart.Wrap(str)
|
||||
}
|
||||
|
||||
// Check for localhost in API URL and Minio SignEndpoint
|
||||
|
||||
Reference in New Issue
Block a user