diff --git a/dbm-services/common/celery-service/Makefile b/dbm-services/common/celery-service/Makefile index 155540a707..2c18190940 100644 --- a/dbm-services/common/celery-service/Makefile +++ b/dbm-services/common/celery-service/Makefile @@ -10,7 +10,7 @@ BK_DH_URL = mirrors.tencent.com/build .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @cp -r collect ${OUTPUT_DIR} @cp external-tasks.yaml ${OUTPUT_DIR} @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PROJ}.tar.gz ${PROJ} external-tasks.yaml collect diff --git a/dbm-services/mysql/db-remote-service/Makefile b/dbm-services/mysql/db-remote-service/Makefile index 3000281973..c0a3d1b423 100644 --- a/dbm-services/mysql/db-remote-service/Makefile +++ b/dbm-services/mysql/db-remote-service/Makefile @@ -11,7 +11,7 @@ BK_DH_URL = mirrors.tencent.com/build .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} ${PROJ} .PHONY: dev-bin diff --git a/dbm-services/mysql/db-tools/mysql-crond/Makefile b/dbm-services/mysql/db-tools/mysql-crond/Makefile index 0e758bf307..a9d77f72f6 100644 --- a/dbm-services/mysql/db-tools/mysql-crond/Makefile +++ b/dbm-services/mysql/db-tools/mysql-crond/Makefile @@ -9,14 +9,14 @@ DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @cp mysql-crond.conf.go.tpl $(OUTPUT_DIR) @cp start.sh $(OUTPUT_DIR) && chmod +x $(OUTPUT_DIR)/start.sh @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} mysql-crond mysql-crond.conf.go.tpl start.sh .PHONY: dev-bin dev-bin: - @CGO_ENABLE=0 go build -ldflags ${DEV_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 go build -ldflags ${DEV_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @cp mysql-crond.conf.go.tpl $(OUTPUT_DIR) @cp start.sh $(OUTPUT_DIR) @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} mysql-crond mysql-crond.conf.go.tpl start.sh diff --git a/dbm-services/mysql/db-tools/mysql-monitor/Makefile b/dbm-services/mysql/db-tools/mysql-monitor/Makefile index e17dedbda0..1c1298776d 100644 --- a/dbm-services/mysql/db-tools/mysql-monitor/Makefile +++ b/dbm-services/mysql/db-tools/mysql-monitor/Makefile @@ -9,7 +9,7 @@ DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @cp pt-config-diff ${OUTPUT_DIR}/pt-config-diff @cp pt-summary ${OUTPUT_DIR}/pt-summary @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} mysql-monitor pt-config-diff pt-summary diff --git a/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile b/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile index baefad396c..5bcb0ea909 100644 --- a/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile +++ b/dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile @@ -10,7 +10,7 @@ BASE_DIR = $(shell pwd) .PHONY: build build: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -gcflags="all=-trimpath=${PWD}" -asmflags="all=-trimpath=${PWD}" -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -gcflags="all=-trimpath=${PWD}" -asmflags="all=-trimpath=${PWD}" -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ}/${PROJ_BIN} .PHONY: release release: build diff --git a/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile b/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile index e2c488f1e9..1de5074a03 100644 --- a/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile +++ b/dbm-services/mysql/db-tools/mysql-table-checksum/Makefile @@ -8,7 +8,7 @@ DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${PROJ} @chmod +x pt-table-checksum pt-table-sync @cp -a pt-table-checksum ${OUTPUT_DIR}/ @cp -a pt-table-sync ${OUTPUT_DIR}/ diff --git a/dbm-services/mysql/slow-query-parser-service/Makefile b/dbm-services/mysql/slow-query-parser-service/Makefile index 7305f64bf0..541dbe3385 100644 --- a/dbm-services/mysql/slow-query-parser-service/Makefile +++ b/dbm-services/mysql/slow-query-parser-service/Makefile @@ -9,7 +9,7 @@ BK_DH_URL = mirrors.tencent.com/build .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PROJ}.tar.gz ${PROJ} .PHONY: dev-bin diff --git a/dbm-services/riak/db-tools/riak-monitor/Makefile b/dbm-services/riak/db-tools/riak-monitor/Makefile index 19af8d1544..f4f00b8328 100644 --- a/dbm-services/riak/db-tools/riak-monitor/Makefile +++ b/dbm-services/riak/db-tools/riak-monitor/Makefile @@ -9,7 +9,7 @@ DEV_BUILD_FLAG = "-X ${MODULE}/cmd.version="develop" -X ${MODULE}/cmd.buildStamp .PHONY: release-bin release-bin: - @CGO_ENABLE=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} + @CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags ${RELEASE_BUILD_FLAG} -o ${OUTPUT_DIR}/${$PROJ} @cp config.yaml.go.tpl ${OUTPUT_DIR}/config.yaml.go.tpl @tar -C ${OUTPUT_DIR} -zcf ${OUTPUT_DIR}/${PKG} riak-monitor config.yaml.go.tpl diff --git a/dbm-ui/backend/db_meta/enums/cluster_phase.py b/dbm-ui/backend/db_meta/enums/cluster_phase.py index d18abed7c0..30f5f5fcc7 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_phase.py +++ b/dbm-ui/backend/db_meta/enums/cluster_phase.py @@ -14,14 +14,14 @@ class ClusterPhase(str, StructuredEnum): # cluster实际可能存在的phase状态 - ONLINE = EnumField("online", _("online")) - OFFLINE = EnumField("offline", _("offline")) + ONLINE = EnumField("online", _("正常")) + OFFLINE = EnumField("offline", _("禁用")) # 仅用作单据校验,不实际写入,销毁集群时,请直接删除Cluster - DESTROY = EnumField("destroy", _("destroy")) + DESTROY = EnumField("destroy", _("销毁")) # scr, gcs 迁移的中间阶段 - TRANS_STAGE = EnumField("trans_stage", _("trans_stage")) + TRANS_STAGE = EnumField("trans_stage", _("scr/gcs迁移中")) @classmethod def cluster_status_transfer_valid(cls, source_phase, target_phase) -> bool: diff --git a/dbm-ui/backend/db_monitor/views/notice_group.py b/dbm-ui/backend/db_monitor/views/notice_group.py index d017947719..e025db9168 100644 --- a/dbm-ui/backend/db_monitor/views/notice_group.py +++ b/dbm-ui/backend/db_monitor/views/notice_group.py @@ -30,9 +30,10 @@ SWAGGER_TAG = _("监控告警组") -class MonitorPolicyListFilter(django_filters.FilterSet): +class MonitorGroupListFilter(django_filters.FilterSet): name = django_filters.CharFilter(field_name="name", lookup_expr="icontains", label=_("告警组名称")) bk_biz_id = django_filters.NumberFilter(method="filter_bk_biz_id", label=_("业务ID")) + db_type = django_filters.CharFilter(method="filter_db_type", label=_("DB类型")) def filter_bk_biz_id(self, queryset, name, value): """ @@ -47,6 +48,10 @@ def filter_bk_biz_id(self, queryset, name, value): ) return queryset.filter(Q(bk_biz_id=value) | Q(id__in=plat_built_in_group_ids)).order_by("is_built_in") + def filter_db_type(self, queryset, name, value): + # 返回告警组时,需同时返回没有 db_type 的 + return queryset.filter(Q(db_type=value) | Q(db_type="")) + class Meta: model = NoticeGroup fields = ["bk_biz_id", "name", "db_type"] @@ -84,7 +89,7 @@ class MonitorNoticeGroupViewSet(viewsets.AuditedModelViewSet): queryset = NoticeGroup.objects.all() serializer_class = NoticeGroupSerializer pagination_class = AuditedLimitOffsetPagination - filter_class = MonitorPolicyListFilter + filter_class = MonitorGroupListFilter def _get_custom_permissions(self): return [DBManageIAMPermission()] diff --git a/dbm-ui/backend/db_services/bigdata/resources/query.py b/dbm-ui/backend/db_services/bigdata/resources/query.py index 71f8d4fceb..7ab7c5d229 100644 --- a/dbm-ui/backend/db_services/bigdata/resources/query.py +++ b/dbm-ui/backend/db_services/bigdata/resources/query.py @@ -246,6 +246,7 @@ def _to_cluster_list(cls, cluster: Cluster, cluster_entry_map: Dict[int, Dict[st cluster_info = { "id": cluster.id, "phase": cluster.phase, + "phase_name": cluster.get_phase_display(), "status": cluster.status, "cluster_name": cluster.name, "cluster_alias": cluster.alias, diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py index 65acc63ca1..bb5a8badd2 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py @@ -251,6 +251,7 @@ def _to_cluster_representation( return { "id": cluster.id, "phase": cluster.phase, + "phase_name": cluster.get_phase_display(), "status": cluster.status, "operations": ClusterOperateRecord.objects.get_cluster_operations(cluster.id), "cluster_name": cluster.name, diff --git a/helm-charts/bk-dbm/Chart.lock b/helm-charts/bk-dbm/Chart.lock index c293da5d8b..3edc47e208 100644 --- a/helm-charts/bk-dbm/Chart.lock +++ b/helm-charts/bk-dbm/Chart.lock @@ -10,7 +10,7 @@ dependencies: version: 16.13.2 - name: etcd repository: https://charts.bitnami.com/bitnami - version: 9.5.7 + version: 9.6.0 - name: reloader repository: https://stakater.github.io/stakater-charts version: 1.0.50 @@ -56,5 +56,5 @@ dependencies: - name: backup-consumer repository: file://charts/backup-consumer version: 0.0.3 -digest: sha256:86a245ae6c44981fdf3f9971e03cf4408fc0f368f4420f0c2c2ef8583ee83250 -generated: "2023-10-31T17:58:25.252622+08:00" +digest: sha256:2980ed56f192ffd9fa531dc1668522eefacd827580a900509ba0e4a78a826946 +generated: "2023-11-01T15:09:09.075761+08:00" diff --git a/helm-charts/bk-dbm/Chart.yaml b/helm-charts/bk-dbm/Chart.yaml index f8daa793e9..a7ba5e9f41 100644 --- a/helm-charts/bk-dbm/Chart.yaml +++ b/helm-charts/bk-dbm/Chart.yaml @@ -79,5 +79,5 @@ dependencies: description: A Helm chart for bkdbm name: bk-dbm type: application -version: 1.2.0-alpha.72 -appVersion: 1.2.0-alpha.72 +version: 1.2.0-alpha.73 +appVersion: 1.2.0-alpha.73 diff --git a/helm-charts/bk-dbm/charts/db-resource/Chart.yaml b/helm-charts/bk-dbm/charts/db-resource/Chart.yaml index 5dbf9b03ee..2234b7b986 100644 --- a/helm-charts/bk-dbm/charts/db-resource/Chart.yaml +++ b/helm-charts/bk-dbm/charts/db-resource/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.0.1-alpha.51 +appVersion: 0.0.1-alpha.50 description: A Helm chart for Kubernetes name: db-resource type: application diff --git a/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml b/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml index ef6b8fff05..49930418de 100644 --- a/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml +++ b/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.0.1-alpha.50 +appVersion: 0.0.1-alpha.51 description: A Helm chart for dbconfig name: dbconfig type: application diff --git a/helm-charts/bk-dbm/charts/dbm/Chart.yaml b/helm-charts/bk-dbm/charts/dbm/Chart.yaml index 9ab6f8f865..b11c75088c 100644 --- a/helm-charts/bk-dbm/charts/dbm/Chart.yaml +++ b/helm-charts/bk-dbm/charts/dbm/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.2.0-alpha.424 +appVersion: 1.2.0-alpha.431 description: A Helm chart for dbm name: dbm type: application