///
import { Flow, Operation, OperationArgsMap, OperationType } from '@nosana/sdk';
import EventEmitter from 'events';
import { NodeRepository } from '../repository/NodeRepository.js';
import { ResourceManager } from '../node/resource/resourceManager.js';
import { ContainerOrchestrationInterface } from './containerOrchestration/interface.js';
export declare class Provider {
containerOrchestration: ContainerOrchestrationInterface;
private repository;
private resourceManager;
private readonly frpcImage;
private proxyStartupAbortController;
constructor(containerOrchestration: ContainerOrchestrationInterface, repository: NodeRepository, resourceManager: ResourceManager);
hasTrustedExecutionEnvCapability(): Promise;
stopReverseProxyApi(address: string): Promise;
setUpReverseProxyApi(address: string, port: string): Promise;
taskManagerContainerRunOperation(flow: Flow, op: Operation<'container/run'>, controller: AbortController, emitter: EventEmitter): Promise;
generateFrpcContainerConfig(name: string, networks: {
[p: string]: {};
}, flow: Flow, proxies: any[], isLoadBalanced: boolean, deploymentHash: string | undefined): {
name: string;
cmd: string[];
networks: {
[p: string]: {};
};
requires_network_mode: boolean;
env: {
FRP_LB_GROUP_KEY?: string | undefined;
FRP_SERVER_ADDR: string;
FRP_SERVER_PORT: string;
NOSANA_ID: string;
FRP_PROXIES: string;
DEPLOYMENT_ID: string;
JOB_ID: string;
};
};
taskManagerContainerStopRunOperation(flow: Flow, op: Operation<'container/run'>, emitter?: EventEmitter): Promise;
/**
* Runs a full container operation lifecycle:
* 1. Starts the container, emits lifecycle events, waits for completion or error.
* 2. Then stops and cleans up the container, network, and associated Docker resources.
*
* This function ties together both the **execution** and **cleanup** stages for a containerized operation.
*
* The steps are:
* - Emits 'start' → Pulls container image (if needed) → Creates volume/network (if needed)
* - Runs container with correct args/env/entrypoint
* - Follows logs and emits 'log' → Waits for completion → Emits 'exit' or 'error'
* - Regardless of outcome, cleans up resources (containers, networks, optional image)
*
* Emits:
* - 'start': when the operation begins
* - 'log': every time stdout/stderr produces output
* - 'updateOpState': to attach container ID
* - 'exit': when the operation finishes successfully or with failure
* - 'error': when something crashes
* - 'end': always, after cleanup
*
* @param flow - The job flow this operation is part of
* @param op - The specific container operation to run
* @param controller - AbortController to support cancellation
* @param emitter - EventEmitter to stream logs and events from the container lifecycle
*/
taskManagerContainerStartRunandStopOperation(flow: Flow, op: Operation<'container/run'>, controller: AbortController, emitter: EventEmitter): Promise;
taskManagerVolumeStartRunandStopOperation(flow: Flow, op: Operation<'container/create-volume'>, controller: AbortController, emitter: EventEmitter): Promise;
taskManagerVolumeCreateOperation(flow: Flow, op: Operation<'container/create-volume'>, controller: AbortController, emitter: EventEmitter): Promise;
taskManagerVolumeStopOperation(flow: Flow, op: Operation<'container/create-volume'>, emitter?: EventEmitter): Promise;
runTaskManagerOperation(flow: Flow, op: Operation, controller: AbortController, emitter: EventEmitter): Promise;
stopTaskManagerOperation(flow: Flow, op: Operation, emitter?: EventEmitter): Promise;
}
export declare function parseOpArgsCmd(cmd: OperationArgsMap['container/run']['cmd']): string[] | undefined;