Skip to content

Commit 351f9e8

Browse files
robocanicikun-LgWyRainBowclaudeakshitvigg
authored
Release: tag a version of 0.7.0-release (#1411)
* Fix: Address the admin issues before the release (#1391) * build: Optimize the styles of some tables, adapt to backend changes, format the code, and package it * chore: remove PR_DESCRIPTION.md file as it is no longer needed * fix: update routing rule handling updated routing rule handling to use constants for HTTP status codes in various components. * build: build & format * feat: enhance error handling and data loading in various components - Added a silent error handling mechanism for specific URLs in the HTTP request module to suppress error messages. - Refactored data loading logic in sceneConfig.vue to load configuration data based on the selected tab, improving user experience. - Updated YAMLView.vue and other components to remove unused button code and optimize imports, enhancing code clarity and maintainability. - Improved error handling in routingRule and dynamicConfig components to ensure better user feedback and debugging. * feat: add new components and enhance YAML and XML editing capabilities - Introduced new JavaScript files for YAML and XML syntax highlighting and editing. - Added components for updating YAML configurations with structured editor interfaces. - Updated index.html to reference new JavaScript bundles for improved functionality. - Enhanced error handling and logging in various components for better debugging. - Removed unused code and optimized imports in YAMLView and related components. * feat: enhance UI components and improve error handling - Added global styles for clickable links in tables to improve user interaction. - Updated routing logic to utilize a dynamic header parameter key for better flexibility. - Enhanced error handling in HTTP requests to suppress messages for specific URLs. - Improved internationalization by adding new translation keys for 'Ready Time' in both English and Chinese. - Refactored various components to optimize code structure and maintainability, including updates to YAML and form views. - Adjusted table and form layouts for better responsiveness and user experience. * refactor: streamline component code and enhance condition handling - Simplified iframe rendering in GrafanaPage.vue for improved readability. - Added checks in ConfigModel.ts to skip undefined keys in matches and parameters. - Optimized YAMLView.vue by condensing MonacoEditor properties for better clarity. - Cleared default request and address matching arrays in formView.vue for cleaner initialization. - Enhanced condition parsing and merging logic in updateByFormView.vue to improve maintainability and readability. * build: build admin * fix: add Apache License headers to YAML files in release/kubernetes (#1393) * feat: enhance UI components, improve error handling, and add routing rule management (#1394) * build: Optimize the styles of some tables, adapt to backend changes, format the code, and package it * chore: remove PR_DESCRIPTION.md file as it is no longer needed * fix: update routing rule handling updated routing rule handling to use constants for HTTP status codes in various components. * build: build & format * feat: enhance error handling and data loading in various components - Added a silent error handling mechanism for specific URLs in the HTTP request module to suppress error messages. - Refactored data loading logic in sceneConfig.vue to load configuration data based on the selected tab, improving user experience. - Updated YAMLView.vue and other components to remove unused button code and optimize imports, enhancing code clarity and maintainability. - Improved error handling in routingRule and dynamicConfig components to ensure better user feedback and debugging. * feat: add new components and enhance YAML and XML editing capabilities - Introduced new JavaScript files for YAML and XML syntax highlighting and editing. - Added components for updating YAML configurations with structured editor interfaces. - Updated index.html to reference new JavaScript bundles for improved functionality. - Enhanced error handling and logging in various components for better debugging. - Removed unused code and optimized imports in YAMLView and related components. * feat: enhance UI components and improve error handling - Added global styles for clickable links in tables to improve user interaction. - Updated routing logic to utilize a dynamic header parameter key for better flexibility. - Enhanced error handling in HTTP requests to suppress messages for specific URLs. - Improved internationalization by adding new translation keys for 'Ready Time' in both English and Chinese. - Refactored various components to optimize code structure and maintainability, including updates to YAML and form views. - Adjusted table and form layouts for better responsiveness and user experience. * refactor: streamline component code and enhance condition handling - Simplified iframe rendering in GrafanaPage.vue for improved readability. - Added checks in ConfigModel.ts to skip undefined keys in matches and parameters. - Optimized YAMLView.vue by condensing MonacoEditor properties for better clarity. - Cleared default request and address matching arrays in formView.vue for cleaner initialization. - Enhanced condition parsing and merging logic in updateByFormView.vue to improve maintainability and readability. * build: build admin * fix: improve error handling and UI updates in GrafanaPage and sceneConfig components - Added conditional checks in GrafanaPage.vue to ensure valid baseURL before constructing the Grafana URL. - Enhanced iframe loading logic to prevent errors when accessing undefined elements. - Updated service.vue to handle potential undefined values in versionGroups, ensuring robust data handling. - Refactored sceneConfig.vue to improve the user experience by adding a conditional rendering for parameter routes, including a message for empty configurations and a button for adding new routes. * refactor: Request to update the Grafana URL * build: build * ♻️ refactor: update route parameters to include name and make pathId/appName optional Update routing structure across instance and traffic management views to: - Add :name parameter to routes for better identification - Make :pathId and :appName optional parameters (with ?) - Affects instance detail, monitor, link tracking, and configuration tabs - Updates dynamic config, routing rule, and tag rule views accordingly This change provides more flexible routing and better resource identification. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * ✨ feat(routing): add routing rule list component and composable Add new RoutingRuleList component and useRoutingRule composable to manage routing rule configurations. Updates addByFormView and updateByFormView to integrate with the new components. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: format & build * ✨ feat(routing): enhance routing rule form with comprehensive i18n support Enhance routing rule form functionality with improved internationalization, user interface refinements, and better form handling. - Add comprehensive i18n translations for routing rule fields - Improve form layout and field descriptions - Enhance routing rule list component with better UX - Refactor routing rule composable for better maintainability - Update tab header slots for improved navigation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: format & build --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix/console (#1397) * fix: create tag rule bug * refactor: config refactor; fix: fix console bugs * fix: instance disable traffic * fix: CI promblems * fix: typo * fix(ui): update footer copyright year to 2026 (#1396) * implement counter by key (#1390) * implement counter by key * chore: trigger CI * Fix counter initialization errors and mesh change detection logic --------- Co-authored-by: WyRainBow <your-email@example.com> * feat: kubernetes deployment manifests and docker file (#1410) * refactor: refactor dockerfile and implement dubbo-admin deployment * fix: deploy manifests --------- Co-authored-by: LGgbond <1493170339@qq.com> Co-authored-by: WyRainBow <weiyu9484@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Akshit Vig <akshitvig48@gmail.com> Co-authored-by: WyRainBow <your-email@example.com>
1 parent 2eb4409 commit 351f9e8

401 files changed

Lines changed: 4764 additions & 8453 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ jobs:
5252
if: github.repository == 'apache/dubbo-admin'
5353
steps:
5454
- uses: actions/checkout@v4
55+
- name: Setup Node.js
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: '18'
59+
cache: 'yarn'
60+
cache-dependency-path: ui-vue3/yarn.lock
61+
- name: Build Frontend (Vue3)
62+
working-directory: ui-vue3
63+
run: |
64+
yarn install --frozen-lockfile
65+
yarn build
66+
- name: Copy Dist Directory
67+
run: cp -r ui-vue3/dist/ app/dubbo-ui/
5568
- name: Setup Go ${{ matrix.go_version }}
5669
uses: actions/setup-go@v5
5770
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ bin/
4545
build/
4646
vendor/
4747

48-
48+
app/dubbo-ui/dist/

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Build frontend
17+
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/node:18-alpine AS frontend-builder
18+
19+
WORKDIR /ui-vue3
20+
21+
COPY ui-vue3/package.json ui-vue3/yarn.lock ./
22+
RUN yarn install --frozen-lockfile
23+
COPY ui-vue3/ ./
24+
RUN yarn build
25+
26+
27+
# Build backend
28+
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/golang:1.24 AS builder
29+
ARG TARGETOS
30+
ARG TARGETARCH
31+
32+
WORKDIR /app
33+
ENV GOPROXY=https://goproxy.cn,direct
34+
35+
COPY go.mod go.sum ./
36+
RUN go mod download
37+
38+
COPY . .
39+
COPY --from=frontend-builder /ui-vue3/dist app/dubbo-ui/dist
40+
41+
42+
RUN CGO_ENABLED=0 \
43+
GOOS=${TARGETOS:-linux} \
44+
GOARCH=${TARGETARCH:-amd64} \
45+
go build -a -o dubbo-admin ./app/dubbo-admin/main.go
46+
47+
48+
# Use distroless as minimal base image to package the manager binary
49+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
50+
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/alpine:3.20
51+
RUN addgroup -g 65532 app \
52+
&& adduser -D -u 65532 -G app app
53+
54+
WORKDIR /app
55+
COPY --from=builder /app/dubbo-admin /app/dubbo-admin
56+
USER 65532:65532
57+
58+
ENTRYPOINT ["./dubbo-admin"]

app/dubbo-admin/cmd/root.go

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,24 @@
1818
package cmd
1919

2020
import (
21-
"fmt"
2221
"os"
23-
"path/filepath"
2422

2523
"github.com/spf13/cobra"
2624

27-
dubbolog "github.com/apache/dubbo-admin/pkg/common/log"
28-
"github.com/apache/dubbo-admin/pkg/core"
29-
cmd2 "github.com/apache/dubbo-admin/pkg/core/cmd"
3025
"github.com/apache/dubbo-admin/pkg/core/cmd/version"
3126
)
3227

3328
// newRootCmd represents the base command when called without any subcommands.
3429
func newRootCmd() *cobra.Command {
35-
args := struct {
36-
logLevel string
37-
outputPath string
38-
maxSize int
39-
maxBackups int
40-
maxAge int
41-
}{}
4230
cmd := &cobra.Command{
4331
Use: "dubbo-admin",
4432
Short: "Universal Admin for Dubbo Application",
4533
Long: `Universal Admin for Dubbo Application`,
46-
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
47-
level, err := dubbolog.ParseLogLevel(args.logLevel)
48-
if err != nil {
49-
return err
50-
}
51-
52-
if args.outputPath != "" {
53-
output, err := filepath.Abs(args.outputPath)
54-
if err != nil {
55-
return err
56-
}
57-
58-
fmt.Printf("%s: logs will be stored in %q\n", "dubbo-cp", output)
59-
core.SetLogger(core.NewLoggerWithRotation(level, output, args.maxSize, args.maxBackups, args.maxAge))
60-
} else {
61-
core.SetLogger(core.NewLogger(level))
62-
}
63-
64-
// once command line flags have been parsed,
65-
// avoid printing usage instructions
66-
cmd.SilenceUsage = true
67-
68-
return nil
69-
},
7034
}
7135

7236
cmd.SetOut(os.Stdout)
73-
74-
// root flags
75-
cmd.PersistentFlags().StringVar(&args.logLevel, "log-level", dubbolog.InfoLevel.String(), cmd2.UsageOptions("log level", dubbolog.OffLevel, dubbolog.InfoLevel, dubbolog.DebugLevel))
76-
cmd.PersistentFlags().StringVar(&args.outputPath, "log-output-path", args.outputPath, "path to the file that will be filled with logs. Example: if we set it to /tmp/dubbo.log then after the file is rotated we will have /tmp/dubbo-2021-06-07T09-15-18.265.log")
77-
cmd.PersistentFlags().IntVar(&args.maxBackups, "log-max-retained-files", 1000, "maximum number of the old log files to retain")
78-
cmd.PersistentFlags().IntVar(&args.maxSize, "log-max-size", 100, "maximum size in megabytes of a log file before it gets rotated")
79-
cmd.PersistentFlags().IntVar(&args.maxAge, "log-max-age", 30, "maximum number of days to retain old log files based on the timestamp encoded in their filename")
80-
8137
// sub-commands
82-
cmd.AddCommand(newRunCmdWithOpts(cmd2.DefaultRunCmdOpts))
38+
cmd.AddCommand(newRunCmdWithOpts())
8339
cmd.AddCommand(version.NewVersionCmd())
8440

8541
return cmd

app/dubbo-admin/cmd/run.go

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,24 @@
1818
package cmd
1919

2020
import (
21+
"context"
22+
"os"
23+
"os/signal"
24+
"syscall"
2125
"time"
2226

2327
"github.com/spf13/cobra"
2428

2529
"github.com/apache/dubbo-admin/pkg/config"
2630
"github.com/apache/dubbo-admin/pkg/config/app"
2731
"github.com/apache/dubbo-admin/pkg/core/bootstrap"
28-
dubbocmd "github.com/apache/dubbo-admin/pkg/core/cmd"
2932
"github.com/apache/dubbo-admin/pkg/core/logger"
3033
dubboversion "github.com/apache/dubbo-admin/pkg/version"
3134
)
3235

3336
const gracefullyShutdownDuration = 3 * time.Second
3437

35-
// This is the open file limit below which the control plane may not
36-
// reasonably have enough descriptors to accept all its clients.
37-
const minOpenFileLimit = 4096
38-
39-
func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command {
38+
func newRunCmdWithOpts() *cobra.Command {
4039
args := struct {
4140
configPath string
4241
}{}
@@ -49,10 +48,10 @@ func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command {
4948
cfg := app.DefaultAdminConfig()
5049
err := config.Load(args.configPath, &cfg)
5150
if err != nil {
52-
logger.Errorf("could not load the configuration, cause: %s", err.Error())
5351
return err
54-
5552
}
53+
// 2. configure logger
54+
logger.Init(cfg.Log)
5655
cfgForDisplay, err := config.ConfigForDisplay(&cfg)
5756
if err != nil {
5857
logger.Errorf("unable to prepare config for display, cause: %s", err.Error())
@@ -63,11 +62,10 @@ func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command {
6362
logger.Errorf("unable to convert config to json, cause: %s", err.Error())
6463
return err
6564
}
66-
logger.Infof("Current config %s", cfgBytes)
67-
logger.Infof("Running in mode `%s`", cfg.Mode)
65+
logger.Infof("current config:\n %s", cfgBytes)
6866

6967
// 2. build components
70-
gracefulCtx, ctx := opts.SetupSignalHandler()
68+
gracefulCtx, ctx := setupSignalHandler()
7169
rt, err := bootstrap.Bootstrap(gracefulCtx, cfg)
7270
if err != nil {
7371
logger.Errorf("unable to bootstrap, cause: %s", err.Error())
@@ -91,6 +89,25 @@ func newRunCmdWithOpts(opts dubbocmd.RunCmdOpts) *cobra.Command {
9189
},
9290
}
9391
// flags
94-
cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file")
92+
cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "./dubbo-admin.yaml", "configuration file")
9593
return cmd
9694
}
95+
96+
func setupSignalHandler() (context.Context, context.Context) {
97+
gracefulCtx, gracefulCancel := context.WithCancel(context.Background())
98+
ctx, cancel := context.WithCancel(context.Background())
99+
c := make(chan os.Signal, 3)
100+
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
101+
go func() {
102+
s := <-c
103+
logger.Warnf("received signal %s, stopping instance gracefully", s.String())
104+
gracefulCancel()
105+
s = <-c
106+
logger.Warnf("received second signal %s, stopping instance", s.String())
107+
cancel()
108+
s = <-c
109+
logger.Warnf("received third signal %s, force exit", s.String())
110+
os.Exit(1)
111+
}()
112+
return gracefulCtx, ctx
113+
}

app/dubbo-admin/dubbo-admin-legacy.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)