import { Market, RequiredResource } from '@nosana/sdk'; import { Resource } from '@nosana/sdk/dist/types/resources.js'; import { ContainerOrchestrationInterface } from '../../provider/containerOrchestration/interface.js'; import { NodeRepository } from '../../repository/NodeRepository.js'; import { ImageManager, RequiredImage } from './image/imageManager.js'; import { JobContext, VolumeManager } from './volume/volumeManager.js'; /** * The market endpoint reports an HF resource's model as `url`, the field it * also uses for S3, while everywhere else in the node — job definitions * included — an HF resource names it `repo`. Translate on the way in, so only * one shape reaches the download path. * * Resources that already carry `repo` are left alone: this is the market * boundary, but the same manager serves job resources. */ export declare function normalizeMarketResources(resources: RequiredResource[]): RequiredResource[]; /** * A required image as the market endpoint reports it. It reported bare image * names before it could carry registry credentials, and the node and the host * manager release independently, so a node has to read both shapes: the string * form outlives the field it was replaced by. */ export type MarketRequiredImage = string | { name: string; server?: string; username?: string; password?: string; }; /** * Translates market required images into the shape the pull path reads. * * Credentials ride along only when the market names an account to pull as. A * `server` on its own names a registry without authenticating to it, and the * node still pulls from it anonymously, so it is not enough on its own to make * the image a private one. */ export declare function normalizeMarketImages(required_images: MarketRequiredImage[]): RequiredImage[]; export declare class ResourceManager { private containerOrchestration; private repository; private required_market; images: ImageManager; volumes: VolumeManager; constructor(containerOrchestration: ContainerOrchestrationInterface, repository: NodeRepository); resyncResourcesDB(): Promise; fetchMarketRequiredResources(market: Market | string): Promise; prune(): Promise; getResourceVolumes(resources: Resource[], controller: AbortController, job?: JobContext): Promise<{ dest: string; name: string; readonly?: boolean; }[]>; }