⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
netdata
/
packaging
/
dag
/
View File Name :
build_command.py
import click import asyncio import sys import dagger import pathlib import uuid from nd import ( Distribution, NetdataInstaller, FeatureFlags, Endpoint, AgentContext, SUPPORTED_PLATFORMS, SUPPORTED_DISTRIBUTIONS, ) def run_async(func): def wrapper(*args, **kwargs): return asyncio.run(func(*args, **kwargs)) return wrapper @run_async async def simple_build(platform, distro): config = dagger.Config(log_output=sys.stdout) async with dagger.Connection(config) as client: repo_root = pathlib.Path("/netdata") prefix_path = pathlib.Path("/opt/netdata") installer = NetdataInstaller( platform, distro, repo_root, prefix_path, FeatureFlags.DBEngine ) endpoint = Endpoint("node", 19999) api_key = uuid.uuid4() allow_children = False agent_ctx = AgentContext( client, platform, distro, installer, endpoint, api_key, allow_children ) await agent_ctx.build_container() @click.command() @click.option( "--platform", "-p", type=click.Choice(sorted([str(p) for p in SUPPORTED_PLATFORMS])), help="Specify the platform.", ) @click.option( "--distribution", "-d", type=click.Choice(sorted([str(p) for p in SUPPORTED_DISTRIBUTIONS])), help="Specify the distribution.", ) def build(platform, distribution): platform = dagger.Platform(platform) distro = Distribution(distribution) simple_build(platform, distro)