From 503d7954efa89aad5503a5ec4d11c5378b4ef263 Mon Sep 17 00:00:00 2001 From: Max Shaposhnyk Date: Fri, 9 Aug 2024 16:55:31 +0300 Subject: [PATCH] Add ssh keepalives to prevent or debug the ssh disconnects Signed-off-by: Max Shaposhnyk --- task-generator/remote/main.go | 2 +- task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml | 2 +- task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml | 2 +- task/buildah-remote/0.1/buildah-remote.yaml | 2 +- task/buildah-remote/0.2/buildah-remote.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/task-generator/remote/main.go b/task-generator/remote/main.go index d03c0e4359..024375b35f 100644 --- a/task-generator/remote/main.go +++ b/task-generator/remote/main.go @@ -118,7 +118,7 @@ fi chmod 0400 ~/.ssh/id_rsa export SSH_HOST=$(cat /ssh/host) export BUILD_DIR=$(cat /ssh/user-dir) -export SSH_ARGS="-o StrictHostKeyChecking=no" +export SSH_ARGS="-o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10" mkdir -p scripts echo "$BUILD_DIR" ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes" diff --git a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml index ea578df2c0..c76917243d 100644 --- a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml @@ -229,7 +229,7 @@ spec: chmod 0400 ~/.ssh/id_rsa export SSH_HOST=$(cat /ssh/host) export BUILD_DIR=$(cat /ssh/user-dir) - export SSH_ARGS="-o StrictHostKeyChecking=no" + export SSH_ARGS="-o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10" mkdir -p scripts echo "$BUILD_DIR" ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes" diff --git a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml index 3df48706a9..c5c0214eae 100644 --- a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml @@ -229,7 +229,7 @@ spec: chmod 0400 ~/.ssh/id_rsa export SSH_HOST=$(cat /ssh/host) export BUILD_DIR=$(cat /ssh/user-dir) - export SSH_ARGS="-o StrictHostKeyChecking=no" + export SSH_ARGS="-o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10" mkdir -p scripts echo "$BUILD_DIR" ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes" diff --git a/task/buildah-remote/0.1/buildah-remote.yaml b/task/buildah-remote/0.1/buildah-remote.yaml index 233f5d1728..8a6686e739 100644 --- a/task/buildah-remote/0.1/buildah-remote.yaml +++ b/task/buildah-remote/0.1/buildah-remote.yaml @@ -217,7 +217,7 @@ spec: chmod 0400 ~/.ssh/id_rsa export SSH_HOST=$(cat /ssh/host) export BUILD_DIR=$(cat /ssh/user-dir) - export SSH_ARGS="-o StrictHostKeyChecking=no" + export SSH_ARGS="-o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10" mkdir -p scripts echo "$BUILD_DIR" ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes" diff --git a/task/buildah-remote/0.2/buildah-remote.yaml b/task/buildah-remote/0.2/buildah-remote.yaml index 2c5ae789c5..55ea16001d 100644 --- a/task/buildah-remote/0.2/buildah-remote.yaml +++ b/task/buildah-remote/0.2/buildah-remote.yaml @@ -211,7 +211,7 @@ spec: chmod 0400 ~/.ssh/id_rsa export SSH_HOST=$(cat /ssh/host) export BUILD_DIR=$(cat /ssh/user-dir) - export SSH_ARGS="-o StrictHostKeyChecking=no" + export SSH_ARGS="-o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10" mkdir -p scripts echo "$BUILD_DIR" ssh $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/volumes"