mirror of
https://github.com/mentos1386/zdravko.git
synced 2025-04-03 11:47:54 +00:00
feat(temporal): temporal needs server worker
This commit is contained in:
parent
7a65cf7186
commit
bf109f5be6
5 changed files with 24 additions and 10 deletions
|
@ -36,7 +36,7 @@ var SettingsPages = []*components.Page{
|
||||||
{Path: "/settings/cronjobs", Title: "Cronjobs", Breadcrumb: "Cronjobs"},
|
{Path: "/settings/cronjobs", Title: "Cronjobs", Breadcrumb: "Cronjobs"},
|
||||||
{Path: "/settings/workers", Title: "Workers", Breadcrumb: "Workers"},
|
{Path: "/settings/workers", Title: "Workers", Breadcrumb: "Workers"},
|
||||||
{Path: "/settings/workers/create", Title: "Workers Create", Breadcrumb: "Create"},
|
{Path: "/settings/workers/create", Title: "Workers Create", Breadcrumb: "Create"},
|
||||||
{Path: "/temporal", Title: "Temporal", Breadcrumb: "Temporal"},
|
{Path: "/settings/temporal", Title: "Temporal", Breadcrumb: "Temporal"},
|
||||||
{Path: "/oauth2/logout", Title: "Logout", Breadcrumb: "Logout"},
|
{Path: "/oauth2/logout", Title: "Logout", Breadcrumb: "Logout"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ func (s *Server) Start() error {
|
||||||
|
|
||||||
r.HandleFunc("/", h.Index).Methods("GET")
|
r.HandleFunc("/", h.Index).Methods("GET")
|
||||||
|
|
||||||
// Authenticated routes
|
// Settings
|
||||||
r.HandleFunc("/settings", h.Authenticated(h.SettingsOverviewGET)).Methods("GET")
|
r.HandleFunc("/settings", h.Authenticated(h.SettingsOverviewGET)).Methods("GET")
|
||||||
r.HandleFunc("/settings/healthchecks", h.Authenticated(h.SettingsHealthchecksGET)).Methods("GET")
|
r.HandleFunc("/settings/healthchecks", h.Authenticated(h.SettingsHealthchecksGET)).Methods("GET")
|
||||||
r.HandleFunc("/settings/healthchecks/create", h.Authenticated(h.SettingsHealthchecksCreateGET)).Methods("GET")
|
r.HandleFunc("/settings/healthchecks/create", h.Authenticated(h.SettingsHealthchecksCreateGET)).Methods("GET")
|
||||||
|
@ -77,15 +77,13 @@ func (s *Server) Start() error {
|
||||||
r.HandleFunc("/settings/workers/create", h.Authenticated(h.SettingsWorkersCreatePOST)).Methods("POST")
|
r.HandleFunc("/settings/workers/create", h.Authenticated(h.SettingsWorkersCreatePOST)).Methods("POST")
|
||||||
r.HandleFunc("/settings/workers/{slug}", h.Authenticated(h.SettingsWorkersDescribeGET)).Methods("GET")
|
r.HandleFunc("/settings/workers/{slug}", h.Authenticated(h.SettingsWorkersDescribeGET)).Methods("GET")
|
||||||
r.HandleFunc("/settings/workers/{slug}/token", h.Authenticated(h.SettingsWorkersTokenGET)).Methods("GET")
|
r.HandleFunc("/settings/workers/{slug}/token", h.Authenticated(h.SettingsWorkersTokenGET)).Methods("GET")
|
||||||
|
r.PathPrefix("/settings/temporal").HandlerFunc(h.Authenticated(h.Temporal))
|
||||||
|
|
||||||
// OAuth2
|
// OAuth2
|
||||||
r.HandleFunc("/oauth2/login", h.OAuth2LoginGET).Methods("GET")
|
r.HandleFunc("/oauth2/login", h.OAuth2LoginGET).Methods("GET")
|
||||||
r.HandleFunc("/oauth2/callback", h.OAuth2CallbackGET).Methods("GET")
|
r.HandleFunc("/oauth2/callback", h.OAuth2CallbackGET).Methods("GET")
|
||||||
r.HandleFunc("/oauth2/logout", h.Authenticated(h.OAuth2LogoutGET)).Methods("GET")
|
r.HandleFunc("/oauth2/logout", h.Authenticated(h.OAuth2LogoutGET)).Methods("GET")
|
||||||
|
|
||||||
// Temporal UI
|
|
||||||
r.PathPrefix("/temporal").HandlerFunc(h.Authenticated(h.Temporal))
|
|
||||||
|
|
||||||
// API
|
// API
|
||||||
r.HandleFunc("/api/v1/workers/connect", h.Authenticated(h.ApiV1WorkersConnectGET)).Methods("GET")
|
r.HandleFunc("/api/v1/workers/connect", h.Authenticated(h.ApiV1WorkersConnectGET)).Methods("GET")
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ const FrontendPort = 7233
|
||||||
const HistoryPort = 7234
|
const HistoryPort = 7234
|
||||||
const MatchingPort = 7235
|
const MatchingPort = 7235
|
||||||
const WorkerPort = 7236
|
const WorkerPort = 7236
|
||||||
|
const InternalFrontendPort = 7237
|
||||||
|
|
||||||
type TokenKeyProvider struct {
|
type TokenKeyProvider struct {
|
||||||
config *internal.TemporalConfig
|
config *internal.TemporalConfig
|
||||||
|
@ -96,6 +97,22 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
||||||
BindOnIP: "",
|
BindOnIP: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"worker": {
|
||||||
|
RPC: config.RPC{
|
||||||
|
GRPCPort: WorkerPort,
|
||||||
|
MembershipPort: WorkerPort + 100,
|
||||||
|
BindOnLocalHost: true,
|
||||||
|
BindOnIP: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"internal-frontend": {
|
||||||
|
RPC: config.RPC{
|
||||||
|
GRPCPort: InternalFrontendPort,
|
||||||
|
MembershipPort: InternalFrontendPort + 100,
|
||||||
|
BindOnLocalHost: true,
|
||||||
|
BindOnIP: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
ClusterMetadata: &cluster.Config{
|
ClusterMetadata: &cluster.Config{
|
||||||
EnableGlobalNamespace: false,
|
EnableGlobalNamespace: false,
|
||||||
|
@ -106,7 +123,7 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
||||||
"active": {
|
"active": {
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
InitialFailoverVersion: 1,
|
InitialFailoverVersion: 1,
|
||||||
RPCAddress: fmt.Sprintf("%s:%d", BroadcastAddress, FrontendPort),
|
RPCAddress: fmt.Sprintf("%s:%d", BroadcastAddress, InternalFrontendPort),
|
||||||
ClusterID: "todo",
|
ClusterID: "todo",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -126,9 +143,6 @@ func NewServerConfig(cfg *internal.TemporalConfig) *config.Config {
|
||||||
Provider: nil,
|
Provider: nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
PublicClient: config.PublicClient{
|
|
||||||
HostPort: fmt.Sprintf("%s:%d", BroadcastAddress, FrontendPort),
|
|
||||||
},
|
|
||||||
NamespaceDefaults: config.NamespaceDefaults{
|
NamespaceDefaults: config.NamespaceDefaults{
|
||||||
Archival: config.ArchivalNamespaceDefaults{
|
Archival: config.ArchivalNamespaceDefaults{
|
||||||
History: config.HistoryArchivalNamespaceDefaults{
|
History: config.HistoryArchivalNamespaceDefaults{
|
||||||
|
|
|
@ -65,6 +65,8 @@ func NewServer(cfg *config.Config, tokenKeyProvider authorization.TokenKeyProvid
|
||||||
string(primitives.FrontendService),
|
string(primitives.FrontendService),
|
||||||
string(primitives.HistoryService),
|
string(primitives.HistoryService),
|
||||||
string(primitives.MatchingService),
|
string(primitives.MatchingService),
|
||||||
|
string(primitives.WorkerService),
|
||||||
|
string(primitives.InternalFrontendService),
|
||||||
}),
|
}),
|
||||||
t.WithLogger(logger),
|
t.WithLogger(logger),
|
||||||
t.InterruptOn(interruptChan),
|
t.InterruptOn(interruptChan),
|
||||||
|
|
|
@ -13,7 +13,7 @@ func NewUiConfig(cfg *internal.TemporalConfig) *config.Config {
|
||||||
Port: 8223,
|
Port: 8223,
|
||||||
TemporalGRPCAddress: "localhost:7233",
|
TemporalGRPCAddress: "localhost:7233",
|
||||||
EnableUI: true,
|
EnableUI: true,
|
||||||
PublicPath: "/temporal",
|
PublicPath: "/settings/temporal",
|
||||||
ForwardHeaders: []string{"Authorization"},
|
ForwardHeaders: []string{"Authorization"},
|
||||||
Codec: config.Codec{
|
Codec: config.Codec{
|
||||||
Endpoint: "",
|
Endpoint: "",
|
||||||
|
|
Loading…
Reference in a new issue