@wpelevator/tug 0.3.0 → 0.4.0
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.
- package/dist/agent.d.ts +9 -10
- package/dist/agent.js +226 -274
- package/dist/cli.js +24 -8
- package/dist/compose.d.ts +6 -19
- package/dist/compose.js +118 -146
- package/dist/container-spec.d.ts +56 -0
- package/dist/container-spec.js +359 -0
- package/dist/control.js +9 -0
- package/dist/docker-api.d.ts +232 -0
- package/dist/docker-api.js +416 -0
- package/dist/ingress.d.ts +6 -6
- package/dist/ingress.js +56 -42
- package/dist/live.d.ts +10 -7
- package/dist/live.js +130 -194
- package/dist/normalize.d.ts +20 -0
- package/dist/normalize.js +75 -0
- package/dist/reconciler.d.ts +89 -0
- package/dist/reconciler.js +362 -0
- package/dist/runners.d.ts +1 -6
- package/dist/runners.js +1 -5
- package/dist/templates/install-docker.sh +12 -7
- package/package.json +1 -1
- package/dist/rollout.d.ts +0 -72
- package/dist/rollout.js +0 -385
package/dist/agent.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { WebSocket } from 'ws';
|
|
3
|
+
import type { ContainerSummary, DockerApi } from './docker-api.ts';
|
|
3
4
|
import type { AgentLiveCommand, AgentLiveFrame } from './protocol.ts';
|
|
4
5
|
import type { LiveEngineOptions } from './live.ts';
|
|
5
6
|
import { parseDuration } from './util.ts';
|
|
6
|
-
import type {
|
|
7
|
+
import type { HostRunner, HttpClient } from './runners.ts';
|
|
7
8
|
import type { Command, CommandResult, DesiredState, HealthCheck, ProjectStatus, ImageArtifact, PortBinding, ServiceEndpoint } from './protocol.ts';
|
|
8
9
|
export interface AgentContext {
|
|
9
|
-
docker:
|
|
10
|
+
docker: DockerApi;
|
|
10
11
|
http: HttpClient;
|
|
11
12
|
nodeName: string;
|
|
12
13
|
stateDir: string;
|
|
@@ -57,25 +58,23 @@ export declare class AgentLiveOperations {
|
|
|
57
58
|
private readonly emit;
|
|
58
59
|
private readonly engine;
|
|
59
60
|
private readonly sessions;
|
|
60
|
-
constructor(ctx: AgentContext, emit: (frame: AgentLiveOutputFrame) => void, options?: Omit<LiveEngineOptions, 'emit'>);
|
|
61
|
+
constructor(ctx: AgentContext, emit: (frame: AgentLiveOutputFrame) => void, options?: Omit<LiveEngineOptions, 'emit' | 'docker'>);
|
|
61
62
|
handle(frame: AgentLiveControlFrame): Promise<void>;
|
|
62
63
|
dispose(): void;
|
|
63
64
|
private fail;
|
|
64
65
|
private open;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
export declare function
|
|
67
|
+
/** The container's address on the project network, which health checks dial. */
|
|
68
|
+
export declare function containerIp(ctx: AgentContext, project: string, container: string): Promise<string>;
|
|
69
|
+
export declare function waitForHealth(ctx: AgentContext, project: string, container: string, service: string, health: HealthCheck | null | undefined): Promise<void>;
|
|
68
70
|
export { parseDuration };
|
|
69
71
|
export interface PublicListener {
|
|
70
72
|
project: string;
|
|
71
73
|
container: string;
|
|
72
74
|
listen: string;
|
|
73
75
|
}
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
* listen on all interfaces or on a public IP, from `docker ps --format '{{.Label "com.docker.compose.project"}}\t{{.Names}}\t{{.Ports}}'`.
|
|
77
|
-
*/
|
|
78
|
-
export declare function publicListeners(psOutput: string, projects: readonly string[]): PublicListener[];
|
|
76
|
+
/** Containers of Tug projects (`projects`) that publish a port on all interfaces or on a public IP. */
|
|
77
|
+
export declare function publicListeners(containers: ContainerSummary[], projects: readonly string[]): PublicListener[];
|
|
79
78
|
export declare function executeCommand(command: Command, ctx?: AgentContext): Promise<CommandResult>;
|
|
80
79
|
export declare function ensureArtifact(ctx: AgentContext, artifact: ImageArtifact): Promise<void>;
|
|
81
80
|
export declare function pruneManagedImages(ctx: AgentContext, retained: string[]): Promise<void>;
|