Pass in deployment id and version when scheduling runs (supervisor)

This commit is contained in:
Saadi Myftija
2025-12-11 14:59:10 +01:00
parent 5f8edb7924
commit 81a8811df6
6 changed files with 20 additions and 4 deletions
+2
View File
@@ -252,6 +252,8 @@ class ManagedSupervisor {
machine: message.run.machine,
orgId: message.organization.id,
projectId: message.project.id,
deploymentId: message.deployment.friendlyId,
deploymentVersion: message.deployment.version,
runId: message.run.id,
runFriendlyId: message.run.friendlyId,
version: message.version,
@@ -72,6 +72,8 @@ export class DockerWorkloadManager implements WorkloadManager {
`TRIGGER_DEQUEUED_AT_MS=${opts.dequeuedAt.getTime()}`,
`TRIGGER_POD_SCHEDULED_AT_MS=${Date.now()}`,
`TRIGGER_ENV_ID=${opts.envId}`,
`TRIGGER_DEPLOYMENT_ID=${opts.deploymentId}`,
`TRIGGER_DEPLOYMENT_VERSION=${opts.deploymentVersion}`,
`TRIGGER_RUN_ID=${opts.runFriendlyId}`,
`TRIGGER_SNAPSHOT_ID=${opts.snapshotFriendlyId}`,
`TRIGGER_SUPERVISOR_API_PROTOCOL=${this.opts.workloadApiProtocol}`,
@@ -123,6 +123,14 @@ export class KubernetesWorkloadManager implements WorkloadManager {
name: "TRIGGER_ENV_ID",
value: opts.envId,
},
{
name: "TRIGGER_DEPLOYMENT_ID",
value: opts.deploymentId,
},
{
name: "TRIGGER_DEPLOYMENT_VERSION",
value: opts.deploymentVersion,
},
{
name: "TRIGGER_SNAPSHOT_ID",
value: opts.snapshotFriendlyId,
@@ -29,6 +29,8 @@ export interface WorkloadManagerCreateOptions {
envType: EnvironmentType;
orgId: string;
projectId: string;
deploymentId: string;
deploymentVersion: string;
runId: string;
runFriendlyId: string;
snapshotId: string;
@@ -560,8 +560,9 @@ export class DequeueSystem {
version: result.worker.version,
},
deployment: {
id: result.deployment?.id,
friendlyId: result.deployment?.friendlyId,
id: result.deployment?.id ?? "",
friendlyId: result.deployment?.friendlyId ?? "",
version: result.deployment?.version ?? "",
imagePlatform: result.deployment?.imagePlatform,
},
run: {
+3 -2
View File
@@ -246,8 +246,9 @@ export const DequeuedMessage = z.object({
version: z.string(),
}),
deployment: z.object({
id: z.string().optional(),
friendlyId: z.string().optional(),
id: z.string(),
friendlyId: z.string(),
version: z.string(),
imagePlatform: z.string().optional(),
}),
run: z.object({