Skip to content

Commit

Permalink
feature: 提供 2.0 Agent & Proxy 安装包制作能力 (closed TencentBlueKing#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Jan 9, 2023
1 parent fdefddc commit 012e3be
Show file tree
Hide file tree
Showing 56 changed files with 1,654 additions and 332 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 012e3be

Please sign in to comment.