-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
424 changed files
with
10,493 additions
and
14,714 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
pkg/authority/v1alpha1/ca_grpc.pb.go → api/mesh/ca_grpc.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/apache/dubbo-admin/pkg/admin" | ||
"github.com/apache/dubbo-admin/pkg/config" | ||
dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" | ||
"github.com/apache/dubbo-admin/pkg/core/bootstrap" | ||
"github.com/apache/dubbo-admin/pkg/core/cmd" | ||
"github.com/apache/dubbo-admin/pkg/core/logger" | ||
"github.com/spf13/cobra" | ||
"time" | ||
) | ||
|
||
func newConsoleCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { | ||
args := struct { | ||
configPath string | ||
}{} | ||
|
||
cmd := &cobra.Command{ | ||
Use: "console", | ||
Short: "Launch Dubbo Admin console server.", | ||
Long: `Launch Dubbo Admin console server.`, | ||
RunE: func(cmd *cobra.Command, _ []string) error { | ||
cfg := dubbo_cp.DefaultConfig() | ||
err := config.Load(args.configPath, &cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "could not load the configuration") | ||
return err | ||
} | ||
gracefulCtx, ctx := opts.SetupSignalHandler() | ||
|
||
rt, err := bootstrap.Bootstrap(gracefulCtx, &cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to set up Control Plane runtime") | ||
return err | ||
} | ||
cfgForDisplay, err := config.ConfigForDisplay(&cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to prepare config for display") | ||
return err | ||
} | ||
cfgBytes, err := config.ToJson(cfgForDisplay) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to convert config to json") | ||
return err | ||
} | ||
logger.Sugar().Info(fmt.Sprintf("Current config %s", cfgBytes)) | ||
|
||
if err := admin.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up Metrics") | ||
} | ||
logger.Sugar().Info("starting Control Plane") | ||
if err := rt.Start(gracefulCtx.Done()); err != nil { | ||
logger.Sugar().Error(err, "problem running Control Plane") | ||
return err | ||
} | ||
|
||
logger.Sugar().Info("Stop signal received. Waiting 3 seconds for components to stop gracefully...") | ||
select { | ||
case <-ctx.Done(): | ||
case <-time.After(gracefullyShutdownDuration): | ||
} | ||
logger.Sugar().Info("Stopping Control Plane") | ||
return nil | ||
}, | ||
} | ||
|
||
// flags | ||
cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/apache/dubbo-admin/pkg/admin" | ||
"github.com/apache/dubbo-admin/pkg/authority" | ||
"github.com/apache/dubbo-admin/pkg/config" | ||
dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" | ||
"github.com/apache/dubbo-admin/pkg/core/bootstrap" | ||
"github.com/apache/dubbo-admin/pkg/core/cert" | ||
"github.com/apache/dubbo-admin/pkg/core/cmd" | ||
"github.com/apache/dubbo-admin/pkg/core/logger" | ||
"github.com/apache/dubbo-admin/pkg/cp-server" | ||
"github.com/apache/dubbo-admin/pkg/rule" | ||
"github.com/spf13/cobra" | ||
"time" | ||
) | ||
|
||
const gracefullyShutdownDuration = 3 * time.Second | ||
|
||
// This is the open file limit below which the control plane may not | ||
// reasonably have enough descriptors to accept all its clients. | ||
const minOpenFileLimit = 4096 | ||
|
||
func newRunCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { | ||
args := struct { | ||
configPath string | ||
}{} | ||
cmd := &cobra.Command{ | ||
Use: "run", | ||
Short: "Launch Dubbo Admin", | ||
Long: `Launch Dubbo Admin.`, | ||
RunE: func(cmd *cobra.Command, _ []string) error { | ||
cfg := dubbo_cp.DefaultConfig() | ||
err := config.Load(args.configPath, &cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "could not load the configuration") | ||
return err | ||
} | ||
gracefulCtx, ctx := opts.SetupSignalHandler() | ||
|
||
rt, err := bootstrap.Bootstrap(gracefulCtx, &cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to set up Control Plane runtime") | ||
return err | ||
} | ||
cfgForDisplay, err := config.ConfigForDisplay(&cfg) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to prepare config for display") | ||
return err | ||
} | ||
cfgBytes, err := config.ToJson(cfgForDisplay) | ||
if err != nil { | ||
logger.Sugar().Error(err, "unable to convert config to json") | ||
return err | ||
} | ||
logger.Sugar().Info(fmt.Sprintf("Current config %s", cfgBytes)) | ||
|
||
if err := admin.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up Metrics") | ||
} | ||
|
||
if err := cert.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up certProvider") | ||
} | ||
|
||
if err := authority.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up authority") | ||
} | ||
|
||
if err := rule.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up rule") | ||
} | ||
|
||
if err := cp_server.Setup(rt); err != nil { | ||
logger.Sugar().Error(err, "unable to set up grpc server") | ||
} | ||
|
||
logger.Sugar().Info("starting Control Plane") | ||
if err := rt.Start(gracefulCtx.Done()); err != nil { | ||
logger.Sugar().Error(err, "problem running Control Plane") | ||
return err | ||
} | ||
|
||
logger.Sugar().Info("Stop signal received. Waiting 3 seconds for components to stop gracefully...") | ||
select { | ||
case <-ctx.Done(): | ||
case <-time.After(gracefullyShutdownDuration): | ||
} | ||
logger.Sugar().Info("Stopping Control Plane") | ||
return nil | ||
}, | ||
} | ||
|
||
// flags | ||
cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
cmd/ui/dist/echarts-en.min.js → app/dubbo-ui/dist/echarts-en.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion
2
cmd/ui/dist/static/js/app.29227e12.js → app/dubbo-ui/dist/static/js/app.29227e12.js
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
.../dist/static/js/chunk-vendors.491fd433.js → .../dist/static/js/chunk-vendors.491fd433.js
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
0
cmd/ui/fs.go → app/dubbo-ui/fs.go
100755 → 100644
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.