Skip to content

Commit e8b6d4d

Browse files
authored
fix(hatchery/marathon): let hatchery remove worker (#5189)
1 parent 1fd51ed commit e8b6d4d

File tree

5 files changed

+2
-5
lines changed

5 files changed

+2
-5
lines changed

docs/content/docs/tutorials/worker_model-vsphere.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ We will create a worker model called debian8-docker:
5252
set +e
5353
export CDS_FROM_WORKER_IMAGE={{.FromWorkerImage}}
5454
export CDS_SINGLE_USE=1
55-
export CDS_FORCE_EXIT=1
5655
export CDS_API={{.API}}
5756
export CDS_TOKEN={{.Token}}
5857
export CDS_NAME={{.Name}}

engine/api/workermodel/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func insertFirstPatterns(db gorp.SqlExecutor) error {
2121
set +e
2222
export CDS_FROM_WORKER_IMAGE={{.FromWorkerImage}}
2323
export CDS_SINGLE_USE=1
24-
export CDS_FORCE_EXIT=1
2524
export CDS_API={{.API}}
2625
export CDS_TOKEN={{.Token}}
2726
export CDS_NAME={{.Name}}

engine/hatchery/kubernetes/kubernetes.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ func (h *HatcheryKubernetes) SpawnWorker(ctx context.Context, spawnArgs hatchery
299299
spawnArgs.Model.ModelDocker.Envs = map[string]string{}
300300
}
301301
envsWm := map[string]string{}
302-
envsWm["CDS_FORCE_EXIT"] = "1"
303302
envsWm["CDS_MODEL_MEMORY"] = fmt.Sprintf("%d", memory)
304303
envsWm["CDS_API"] = udataParam.API
305304
envsWm["CDS_TOKEN"] = udataParam.Token

engine/hatchery/marathon/marathon.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ func (h *HatcheryMarathon) SpawnWorker(ctx context.Context, spawnArgs hatchery.S
249249
memory = hatchery.MemoryRegisterContainer
250250
}
251251

252+
cmd += "; sleep 120" // sleep 2min, to let marathon hatchery remove the container
253+
252254
//Check if there is a memory requirement
253255
//if there is a service requirement: exit
254256
if spawnArgs.JobID > 0 {
@@ -271,7 +273,6 @@ func (h *HatcheryMarathon) SpawnWorker(ctx context.Context, spawnArgs hatchery.S
271273
}
272274

273275
envsWm := map[string]string{}
274-
envsWm["CDS_FORCE_EXIT"] = "0"
275276
envsWm["CDS_MODEL_MEMORY"] = fmt.Sprintf("%d", memory)
276277
envsWm["CDS_API"] = udataParam.API
277278
envsWm["CDS_TOKEN"] = udataParam.Token

engine/hatchery/swarm/swarm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ func (h *HatcherySwarm) SpawnWorker(ctx context.Context, spawnArgs hatchery.Spaw
393393
}
394394

395395
envsWm := map[string]string{}
396-
envsWm["CDS_FORCE_EXIT"] = "1"
397396
envsWm["CDS_MODEL_MEMORY"] = fmt.Sprintf("%d", memory)
398397
envsWm["CDS_API"] = udataParam.API
399398
envsWm["CDS_TOKEN"] = udataParam.Token

0 commit comments

Comments
 (0)