Skip to content

Commit

Permalink
feature: 提供 2.0 Agent & Proxy 安装包制作能力 (closed #1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Dec 19, 2022
1 parent 1b7691d commit d50dc8f
Show file tree
Hide file tree
Showing 51 changed files with 1,620 additions and 304 deletions.
10 changes: 10 additions & 0 deletions apps/backend/agent/artifact_builder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at https://opensource.org/licenses/MIT
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.
"""
38 changes: 38 additions & 0 deletions apps/backend/agent/artifact_builder/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at https://opensource.org/licenses/MIT
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.
"""
import logging
import os
import tarfile
import typing

from apps.node_man import constants

from . import base

logger = logging.getLogger("app")


class AgentArtifactBuilder(base.BaseArtifactBuilder):

NAME = constants.GsePackageCode.AGENT.value
PKG_DIR = constants.GsePackageDir.AGENT.value
CERT_FILENAMES = [constants.GseCert.CA.value, constants.GseCert.AGENT_CERT.value, constants.GseCert.AGENT_KEY.value]

def extract_initial_artifact(self, initial_artifact_local_path: str, extract_dir: str):
with tarfile.open(name=initial_artifact_local_path) as tf:
tf.extractall(path=extract_dir)
extract_dir: str = os.path.join(extract_dir, self.BASE_PKG_DIR)
self._inject_dependencies(extract_dir)
return extract_dir

def _get_support_files_info(self, extract_dir: str) -> typing.Dict[str, typing.Any]:
# Agent 包管理实现
pass
Loading

0 comments on commit d50dc8f

Please sign in to comment.