Skip to content

Commit a727e11

Browse files
committed
Finalize lifecycle management: Add wait loop for container name release and sync submodule
1 parent 0b6f712 commit a727e11

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎ObjectDetectionCoprocessor‎

‎build.gradle‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ tasks.register("deploy-jetson", Exec) {
1414
tasks.register("stop-jetson", Exec) {
1515
description = "Stops and removes all containers running the jetson-vision image."
1616
group = "deploy"
17-
// Use ancestor filter to find containers even if they have random names like 'silly_williams'
18-
commandLine 'sh', '-c', 'docker ps -a -q --filter ancestor=jetson-vision | xargs -r docker rm -f'
17+
// Force kill specific name and any ancestors, then wait for release
18+
commandLine 'sh', '-c', 'docker rm -f jetson-vision 2>/dev/null || true; docker ps -a -q --filter ancestor=jetson-vision | xargs -r docker rm -f 2>/dev/null || true; for i in {1..10}; do if ! docker ps -a --format "{{.Names}}" | grep -q "^jetson-vision$"; then break; fi; sleep 1; done'
1919
}
2020

2121
// Start the container in "Robot Mode" (detached with auto-restart)
2222
tasks.register("start-jetson", Exec) {
2323
description = "Starts the jetson-vision container in detached mode with auto-restart."
2424
group = "deploy"
2525
dependsOn "stop-jetson"
26-
commandLine 'docker', 'run', '-d',
26+
// We add -t (Pseudo-TTY) to ensure output is unbuffered and drivers initialize correctly
27+
commandLine 'docker', 'run', '-d', '-t',
2728
'--name', 'jetson-vision',
2829
'--restart', 'always',
2930
'--runtime', 'nvidia',

0 commit comments

Comments
 (0)