build: implement services image build and CI release. (#2920)

* build: implement services image build.

* remove unused tools

* update test.

* update images.

* update dockerfile and go mod.

* update go mod.

* Add comments.

* update go pkg.

* update loadConfig and discovery logic in kubernetes.

* update go pkg and discovery field.

* update Load method args.
This commit is contained in:
Monet Lee
2024-12-07 17:35:42 +08:00
committed by GitHub
parent 59fb9886e5
commit 24ab940875
43 changed files with 1024 additions and 702 deletions
+8 -2
View File
@@ -29,6 +29,7 @@ import (
"github.com/openimsdk/tools/db/mongoutil"
"github.com/openimsdk/tools/db/redisutil"
"github.com/openimsdk/tools/utils/datautil"
"github.com/openimsdk/tools/utils/runtimeenv"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
discRegister "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister"
@@ -51,6 +52,8 @@ type MsgTransfer struct {
historyMongoCH *OnlineHistoryMongoConsumerHandler
ctx context.Context
cancel context.CancelFunc
runTimeEnv string
}
type Config struct {
@@ -64,7 +67,9 @@ type Config struct {
}
func Start(ctx context.Context, index int, config *Config) error {
log.CInfo(ctx, "MSG-TRANSFER server is initializing", "prometheusPorts",
runTimeEnv := runtimeenv.PrintRuntimeEnvironment()
log.CInfo(ctx, "MSG-TRANSFER server is initializing", "runTimeEnv", runTimeEnv, "prometheusPorts",
config.MsgTransfer.Prometheus.Ports, "index", index)
mgocli, err := mongoutil.NewMongoDB(ctx, config.MongodbConfig.Build())
@@ -75,7 +80,7 @@ func Start(ctx context.Context, index int, config *Config) error {
if err != nil {
return err
}
client, err := discRegister.NewDiscoveryRegister(&config.Discovery)
client, err := discRegister.NewDiscoveryRegister(&config.Discovery, runTimeEnv)
if err != nil {
return err
}
@@ -115,6 +120,7 @@ func Start(ctx context.Context, index int, config *Config) error {
msgTransfer := &MsgTransfer{
historyCH: historyCH,
historyMongoCH: historyMongoCH,
runTimeEnv: runTimeEnv,
}
return msgTransfer.Start(index, config)
}