From 9a666b26858146a673369094eaa378ddca97e2e0 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 7dc5e6ce4c..7d9b74f5d7 100644 --- a/task-generator/remote/main.go +++ b/task-generator/remote/main.go @@ -151,7 +151,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 c2f5605461..000ea36bf3 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 fbb14b4699..5bdad24676 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 @@ -234,7 +234,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 f33216b025..aa3cdb0ceb 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 04e9fa1f06..aafc9baedb 100644 --- a/task/buildah-remote/0.2/buildah-remote.yaml +++ b/task/buildah-remote/0.2/buildah-remote.yaml @@ -216,7 +216,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"