openlattice-docker 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ export interface DockerProviderConfig {
2
+ /** Docker socket path. Default: /var/run/docker.sock */
3
+ socketPath?: string;
4
+ /** Docker host for TCP/TLS connections. */
5
+ host?: string;
6
+ port?: number;
7
+ protocol?: "http" | "https" | "ssh";
8
+ /** TLS certificates for HTTPS connections. */
9
+ ca?: string | Buffer;
10
+ cert?: string | Buffer;
11
+ key?: string | Buffer;
12
+ /** Docker API version to pin. Default: auto-negotiate. */
13
+ version?: string;
14
+ /** Default network for containers. Default: "bridge". */
15
+ network?: string;
16
+ /** Labels applied to all containers created by this provider. */
17
+ defaultLabels?: Record<string, string>;
18
+ /** Whether nvidia-container-toolkit is available. Default: auto-detect. */
19
+ gpuAvailable?: boolean;
20
+ }
package/dist/config.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ import type { ComputeProvider, ComputeSpec, ExecOpts, ExecResult, ExtensionMap, HealthStatus, LogEntry, LogOpts, ProviderCapabilities, ProviderNode, ProviderNodeStatus, SnapshotRef } from "openlattice";
2
+ import type { DockerProviderConfig } from "./config";
3
+ export declare class DockerProvider implements ComputeProvider {
4
+ readonly name = "docker";
5
+ readonly capabilities: ProviderCapabilities;
6
+ private readonly docker;
7
+ private readonly config;
8
+ constructor(config?: DockerProviderConfig);
9
+ /**
10
+ * Auto-detect GPU availability by checking Docker runtime info.
11
+ * Call after construction to update `capabilities.gpu`.
12
+ */
13
+ detectGpu(): Promise<boolean>;
14
+ provision(spec: ComputeSpec): Promise<ProviderNode>;
15
+ exec(externalId: string, command: string[], opts?: ExecOpts): Promise<ExecResult>;
16
+ destroy(externalId: string): Promise<void>;
17
+ inspect(externalId: string): Promise<ProviderNodeStatus>;
18
+ stop(externalId: string): Promise<void>;
19
+ start(externalId: string): Promise<void>;
20
+ pause(externalId: string): Promise<void>;
21
+ resume(externalId: string): Promise<void>;
22
+ snapshot(externalId: string): Promise<SnapshotRef>;
23
+ restore(snapshotRef: SnapshotRef, spec?: Partial<ComputeSpec>): Promise<ProviderNode>;
24
+ logs(externalId: string, opts?: LogOpts): AsyncIterable<LogEntry>;
25
+ healthCheck(): Promise<HealthStatus>;
26
+ getExtension<K extends keyof ExtensionMap>(externalId: string, extension: K): ExtensionMap[K] | undefined;
27
+ private tailscaleUp;
28
+ private buildDockerOptions;
29
+ private createNetworkExtension;
30
+ private createFileExtension;
31
+ private createMetricsExtension;
32
+ }