2024-10-27 19:50:39 +01:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
|
|
|
|
/**
|
2024-11-18 19:43:52 +01:00
|
|
|
* a deployment happens when a service is deployed
|
2024-10-27 19:50:39 +01:00
|
|
|
* tracks the status of a deployment
|
|
|
|
*/
|
|
|
|
export interface IDeployment {
|
|
|
|
id: string;
|
2025-09-07 17:21:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The service being deployed (single service per deployment)
|
|
|
|
*/
|
|
|
|
serviceId: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The node this deployment is running on
|
|
|
|
*/
|
|
|
|
nodeId: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Docker container ID for this deployment
|
|
|
|
*/
|
|
|
|
containerId?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Image used for this deployment
|
|
|
|
*/
|
2024-10-27 19:50:39 +01:00
|
|
|
usedImageId: string;
|
2025-09-07 17:21:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Version of the service deployed
|
|
|
|
*/
|
|
|
|
version: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Timestamp when deployed
|
|
|
|
*/
|
|
|
|
deployedAt: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deployment log entries
|
|
|
|
*/
|
2024-10-27 19:50:39 +01:00
|
|
|
deploymentLog: string[];
|
2025-09-07 17:21:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Current status of the deployment
|
|
|
|
*/
|
|
|
|
status: 'scheduled' | 'starting' | 'running' | 'stopping' | 'stopped' | 'failed';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Health status of the deployment
|
|
|
|
*/
|
|
|
|
healthStatus?: 'healthy' | 'unhealthy' | 'unknown';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Resource usage for this deployment
|
|
|
|
*/
|
|
|
|
resourceUsage?: {
|
|
|
|
cpuUsagePercent: number;
|
|
|
|
memoryUsedMB: number;
|
|
|
|
lastUpdated: number;
|
|
|
|
};
|
2024-10-27 19:50:39 +01:00
|
|
|
}
|