tasks/agent.py
def omnibus_build(
    ctx,
    flavor=AgentFlavor.base.name,
    agent_binaries=False,
    log_level="info",
    base_dir=None,
    gem_path=None,
    skip_deps=False,
    skip_sign=False,
    release_version="nightly",
    major_version='7',
    python_runtimes='3',
    omnibus_s3_cache=False,
    hardened_runtime=False,
    system_probe_bin=None,
    nikos_path=None,
    go_mod_cache=None,
):
    """
    Build the Agent packages with Omnibus Installer.
    """
    flavor = AgentFlavor[flavor]
    deps_elapsed = None
    bundle_elapsed = None
    omnibus_elapsed = None
    if not skip_deps:
        deps_start = datetime.datetime.now()
        deps(ctx)
        deps_end = datetime.datetime.now()
        deps_elapsed = deps_end - deps_start

    # base dir (can be overridden through env vars, command line takes precedence)
    base_dir = base_dir or os.environ.get("OMNIBUS_BASE_DIR")

    if base_dir is not None and sys.platform == 'win32':
        # On Windows, prevent backslashes in the base_dir path otherwise omnibus will fail with
        # error 'no matched files for glob copy' at the end of the build.
        base_dir = base_dir.replace(os.path.sep, '/')

    env = get_omnibus_env(
        ctx,
        skip_sign=skip_sign,
        release_version=release_version,
        major_version=major_version,
        python_runtimes=python_runtimes,
        hardened_runtime=hardened_runtime,
        system_probe_bin=system_probe_bin,
        nikos_path=nikos_path,
        go_mod_cache=go_mod_cache,
        flavor=flavor,
    )

    target_project = "agent"
    if flavor.is_iot():
        target_project = "iot-agent"
    elif agent_binaries:
        target_project = "agent-binaries"

    bundle_start = datetime.datetime.now()
    bundle_install_omnibus(ctx, gem_path, env)
    bundle_done = datetime.datetime.now()
    bundle_elapsed = bundle_done - bundle_start

    omnibus_start = datetime.datetime.now()
    omnibus_run_task(
        ctx=ctx,
        task="build",
        target_project=target_project,
        base_dir=base_dir,
        env=env,
        omnibus_s3_cache=omnibus_s3_cache,
        log_level=log_level,
    )
    omnibus_done = datetime.datetime.now()
    omnibus_elapsed = omnibus_done - omnibus_start

    print("Build component timing:")
    if not skip_deps:
        print(f"Deps:    {deps_elapsed}")
    print(f"Bundle:  {bundle_elapsed}")
    print(f"Omnibus: {omnibus_elapsed}")

    Build the Agent packages with Omnibus Installer.
    
Build the Agent packages with Omnibus Installer.
Build the Agent packages with Omnibus Installer .
def omnibus_build(
    ctx,
    flavor=AgentFlavor.base.name,
    agent_binaries=False,
    log_level="info",
    base_dir=None,
    gem_path=None,
    skip_deps=False,
    skip_sign=False,
    release_version="nightly",
    major_version='7',
    python_runtimes='3',
    omnibus_s3_cache=False,
    hardened_runtime=False,
    system_probe_bin=None,
    nikos_path=None,
    go_mod_cache=None,
):
    flavor = AgentFlavor[flavor]
    deps_elapsed = None
    bundle_elapsed = None
    omnibus_elapsed = None
    if not skip_deps:
        deps_start = datetime.datetime.now()
        deps(ctx)
        deps_end = datetime.datetime.now()
        deps_elapsed = deps_end - deps_start
    base_dir = base_dir or os.environ.get("OMNIBUS_BASE_DIR")
    if base_dir is not None and sys.platform == 'win32':
        base_dir = base_dir.replace(os.path.sep, '/')
    env = get_omnibus_env(
        ctx,
        skip_sign=skip_sign,
        release_version=release_version,
        major_version=major_version,
        python_runtimes=python_runtimes,
        hardened_runtime=hardened_runtime,
        system_probe_bin=system_probe_bin,
        nikos_path=nikos_path,
        go_mod_cache=go_mod_cache,
        flavor=flavor,
    )
    target_project = "agent"
    if flavor.is_iot():
        target_project = "iot-agent"
    elif agent_binaries:
        target_project = "agent-binaries"
    bundle_start = datetime.datetime.now()
    bundle_install_omnibus(ctx, gem_path, env)
    bundle_done = datetime.datetime.now()
    bundle_elapsed = bundle_done - bundle_start
    omnibus_start = datetime.datetime.now()
    omnibus_run_task(
        ctx=ctx,
        task="build",
        target_project=target_project,
        base_dir=base_dir,
        env=env,
        omnibus_s3_cache=omnibus_s3_cache,
        log_level=log_level,
    )
    omnibus_done = datetime.datetime.now()
    omnibus_elapsed = omnibus_done - omnibus_start
    print("Build component timing:")
    if not skip_deps:
        print(f"Deps:    {deps_elapsed}")
    print(f"Bundle:  {bundle_elapsed}")
    print(f"Omnibus: {omnibus_elapsed}")
def omnibus_build ( ctx , flavor = AgentFlavor . base . name , agent_binaries = False , log_level = "info" , base_dir = None , gem_path = None , skip_deps = False , skip_sign = False , release_version = "nightly" , major_version = '7' , python_runtimes = '3' , omnibus_s3_cache = False , hardened_runtime = False , system_probe_bin = None , nikos_path = None , go_mod_cache = None , ) : flavor = AgentFlavor [ flavor ] deps_elapsed = None bundle_elapsed = None omnibus_elapsed = None if not skip_deps : deps_start = datetime . datetime . now ( ) deps ( ctx ) deps_end = datetime . datetime . now ( ) deps_elapsed = deps_end - deps_start base_dir = base_dir or os . environ . get ( "OMNIBUS_BASE_DIR" ) if base_dir is not None and sys . platform == 'win32' : base_dir = base_dir . replace ( os . path . sep , '/' ) env = get_omnibus_env ( ctx , skip_sign = skip_sign , release_version = release_version , major_version = major_version , python_runtimes = python_runtimes , hardened_runtime = hardened_runtime , system_probe_bin = system_probe_bin , nikos_path = nikos_path , go_mod_cache = go_mod_cache , flavor = flavor , ) target_project = "agent" if flavor . is_iot ( ) : target_project = "iot-agent" elif agent_binaries : target_project = "agent-binaries" bundle_start = datetime . datetime . now ( ) bundle_install_omnibus ( ctx , gem_path , env ) bundle_done = datetime . datetime . now ( ) bundle_elapsed = bundle_done - bundle_start omnibus_start = datetime . datetime . now ( ) omnibus_run_task ( ctx = ctx , task = "build" , target_project = target_project , base_dir = base_dir , env = env , omnibus_s3_cache = omnibus_s3_cache , log_level = log_level , ) omnibus_done = datetime . datetime . now ( ) omnibus_elapsed = omnibus_done - omnibus_start print ( "Build component timing:" ) if not skip_deps : print ( f"Deps:    {deps_elapsed}" ) print ( f"Bundle:  {bundle_elapsed}" ) print ( f"Omnibus: {omnibus_elapsed}" )
Build the Agent packages with Omnibus Installer.
Build the Agent packages with Omnibus Installer .
"""
    Build the Agent packages with Omnibus Installer.
    """ # base dir (can be overridden through env vars, command line takes precedence) # On Windows, prevent backslashes in the base_dir path otherwise omnibus will fail with # error 'no matched files for glob copy' at the end of the build.
ctx
flavor
agent_binaries
log_level
base_dir
gem_path
skip_deps
skip_sign
release_version
major_version
python_runtimes
omnibus_s3_cache
hardened_runtime
system_probe_bin
nikos_path
go_mod_cache