移除nacos
Former-commit-id: e14474817f56db006ac29206ac6c9fe7b855d45e
This commit is contained in:
parent
39f5964d40
commit
febdf409da
115
api/etc/pcm.yaml
115
api/etc/pcm.yaml
|
@ -1,18 +1,97 @@
|
||||||
NacosConfig:
|
Name: pcm.core.api
|
||||||
DataId: pcm-core-api.yaml
|
Host: 0.0.0.0
|
||||||
Group: DEFAULT_GROUP
|
Port: 8999
|
||||||
ServerConfigs:
|
|
||||||
# - IpAddr: 127.0.0.1
|
Timeout: 50000
|
||||||
# Port: 8848
|
|
||||||
# - IpAddr: 10.101.15.7
|
DB:
|
||||||
# Port: 8848
|
DataSource: root:uJpLd6u-J?HC1@(10.206.0.12:3306)/pcm?parseTime=true&loc=Local
|
||||||
- IpAddr: nacos.jcce.dev
|
|
||||||
Port: 8848
|
Redis:
|
||||||
ClientConfig:
|
Host: 10.206.0.12:6379
|
||||||
NamespaceId: test
|
Pass: redisPW123
|
||||||
# NamespaceId: test
|
|
||||||
TimeoutMs: 5000
|
Cache:
|
||||||
NotLoadCacheAtStart: true
|
- Host: 10.206.0.12:6379
|
||||||
LogDir:
|
Pass: redisPW123
|
||||||
CacheDir:
|
|
||||||
LogLevel: debug
|
# k8s rpc
|
||||||
|
K8sNativeConf:
|
||||||
|
# target: nacos://10.206.0.12:8848/pcm.kubenative.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
Endpoints:
|
||||||
|
- pcm-participant-kubernetes-service:2003
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
THRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.th.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ModelArtsRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ModelArtsImgRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ACRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.ac.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
CephRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.ceph.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 50000
|
||||||
|
|
||||||
|
OctopusRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.octopus.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
OpenstackRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.openstack.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
# core rpc
|
||||||
|
PcmCoreRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.core.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
JccScheduleUrl: http://jcce-schedule-service:8082
|
||||||
|
|
||||||
|
|
||||||
|
MinioConf:
|
||||||
|
Secret: minio_xnu122@_
|
||||||
|
AccessKey: minioadmin
|
||||||
|
Endpoint: http://121.89.220.60:9000
|
||||||
|
|
||||||
|
RegistryConf:
|
||||||
|
Username: jointcloudNudt
|
||||||
|
Password: Nudt@123
|
||||||
|
|
||||||
|
SnowflakeConf:
|
||||||
|
MachineId: 1
|
|
@ -39,7 +39,6 @@ type Config struct {
|
||||||
OpenstackRpcConf zrpc.RpcClientConf
|
OpenstackRpcConf zrpc.RpcClientConf
|
||||||
OctopusRpcConf zrpc.RpcClientConf
|
OctopusRpcConf zrpc.RpcClientConf
|
||||||
PcmCoreRpcConf zrpc.RpcClientConf
|
PcmCoreRpcConf zrpc.RpcClientConf
|
||||||
NexusUrl string
|
|
||||||
JccScheduleUrl string
|
JccScheduleUrl string
|
||||||
MinioConf struct {
|
MinioConf struct {
|
||||||
Secret string
|
Secret string
|
||||||
|
|
21
api/pcm.go
21
api/pcm.go
|
@ -26,7 +26,6 @@ import (
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/mqs"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/mqs"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
commonConfig "gitlink.org.cn/jcce-pcm/utils/nacos"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
||||||
|
@ -34,26 +33,8 @@ var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var bootstrapConfig commonConfig.BootstrapConfig
|
|
||||||
conf.MustLoad(*configFile, &bootstrapConfig)
|
|
||||||
|
|
||||||
//解析业务配置
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
|
conf.MustLoad(*configFile, &c)
|
||||||
nacosConfig := bootstrapConfig.NacosConfig
|
|
||||||
serviceConfigContent := nacosConfig.InitConfig(func(data string) {
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(data), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(serviceConfigContent), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注册到nacos
|
|
||||||
nacosConfig.DiscoveryRest(&c.RestConf)
|
|
||||||
|
|
||||||
serviceGroup := service.NewServiceGroup()
|
serviceGroup := service.NewServiceGroup()
|
||||||
defer serviceGroup.Stop()
|
defer serviceGroup.Stop()
|
||||||
|
|
Loading…
Reference in New Issue