Skip to content

Commit

Permalink
fix(other): 二进制编译问题 #1602
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Nov 1, 2023
1 parent 4c191ee commit 9fd6f5d
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dbm-services/common/celery-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/mysql/db-remote-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dbm-services/mysql/db-tools/mysql-crond/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/mysql/db-tools/mysql-monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/mysql/db-tools/mysql-rotatebinlog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/mysql/db-tools/mysql-table-checksum/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/mysql/slow-query-parser-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbm-services/riak/db-tools/riak-monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions dbm-ui/backend/db_meta/enums/cluster_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions dbm-ui/backend/db_monitor/views/notice_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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"]
Expand Down Expand Up @@ -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()]
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/backend/db_services/bigdata/resources/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions helm-charts/bk-dbm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-resource/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbconfig/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9fd6f5d

Please sign in to comment.