import { ContainerInspectInfo } from 'dockerode'; import { Resource } from '@nosana/sdk/dist/types/resources.js'; import { RequiredResource } from '@nosana/sdk'; import { ContainerOrchestrationInterface } from '../../../provider/containerOrchestration/interface.js'; import { NodeRepository } from '../../../repository/NodeRepository.js'; /** * Renders the runtime state that says why the download stopped, for inclusion in * the error message. A process that is killed rather than failing logs nothing, * so this is the only evidence of an OOM; a container the runtime could not * create or start logs nothing either, and `State.Error` is Docker's only * account of that. The run duration separates a download that died on contact * from one the network dropped an hour in. * * Optional because the caller inspects on a best-effort basis; the fields * themselves are always present when it succeeds. */ export declare function describeContainerState(state?: ContainerInspectInfo['State']): string; /** * The reasons the resource manager gave for failing, if it gave any. * * It reports failures as a JSON line on stderr — `{"event":"error","message": * "..."}` — from every service it implements, then exits non-zero. Parallel * download workers can each report their own failure before the run dies, so * every such line is collected, in the order logged; the last is the one the * run gave up on. */ export declare function findReportedErrors(logs: { log?: string; }[]): string[]; /** * The fallback reason for a container that died without reporting through the * envelope — a crash before the handlers install, or output lost to the kill. * The raw stderr tail is the only account left of what happened, so the last * few lines ride along rather than being discarded. */ export declare function describeUnreportedExit(logs: { log?: string; }[], statusCode: number): string; /** * The op a download is running for. Passed only for job resources — a market * preload has no op state to write errors to. */ export interface JobContext { id: string; opIndex: number; } export declare class VolumeManager { private containerOrchestration; private repository; private fetched; private market_required_volumes; private progressBarReporter; constructor(containerOrchestration: ContainerOrchestrationInterface, repository: NodeRepository); pullMarketRequiredVolumes(remoteResources: RequiredResource[]): Promise; createRemoteVolume(resource: RequiredResource, controller: AbortController, job?: JobContext): Promise; private runResourceManagerContainer; setVolume(bucket: string, volume: string): Promise; hasVolume(resource: Resource): Promise; getVolume(resource: RequiredResource | Resource): Promise; pruneVolumes(): Promise; resyncResourcesDB(): Promise; }