From 2bc6c77e4956e90396846f257552b27ca89771b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 6 Jul 2023 16:25:12 +0200 Subject: [PATCH] Deploy: move old worker executable before overwriting Move the old worker out of the way. This should keep the old executable as-is on disk, hopefully keeping currently-running processes happy. I've noticed some workers crashing as soon as the executable got replaced, which made me suspect that it's not 100% loaded to memory before starting the execution. Let's see if this works better. --- deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index d2c5f79c..d1e5a382 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,6 +2,7 @@ MY_DIR="$(dirname "$(readlink -e "$0")")" ADDON_ZIP="$MY_DIR/web/static/flamenco3-addon.zip" +WORKER_TARGET=/shared/software/flamenco3-worker/flamenco-worker set -e @@ -22,7 +23,12 @@ scp flamenco-manager flamenco.farm.blender:/home/flamenco3/ ssh -o ClearAllForwardings=yes flamenco.farm.blender -t sudo systemctl start flamenco3-manager prompt "Deploying Worker" -cp -f flamenco-worker /shared/software/flamenco3-worker +if [ -e "$WORKER_TARGET" ]; then + # Move the old worker out of the way. This should keep the old executable + # as-is on disk, hopefully keeping currently-running processes happy. + mv "$WORKER_TARGET" "$WORKER_TARGET.old" +fi +cp -f flamenco-worker "$WORKER_TARGET" prompt "Deploying Blender Add-on" rm -rf /shared/software/addons/flamenco