fix(ci): add SSH keepalive to deploy-dev + deploy-prd ssh commands - #112
Merged
Conversation
deploy_dev_node + deploy_prd_node steps hit `client_loop: send disconnect: Broken pipe` exit 255 when `docker compose recreate` runs longer than the cloudflared tunnel's idle timeout (~60s with no remote stdout). The host-side deploy script keeps running and the container comes up correctly, but CI marks the step failed. Add ServerAliveInterval=30 + ServerAliveCountMax=8 — keepalive every 30s, 8 retries before declaring dead = 4 min of network silence tolerated. The deploy script's longest silent stretch (`docker compose pull` of a fresh image + container recreate) is bounded by the host's network + disk speed, comfortably under that ceiling. Observed on the PR #111 merge auto-deploy: run 26419696840 failed with the broken-pipe pattern, but ssh dfxdev-remote showed the container was already `Up (healthy)` — purely a CI-side artefact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents the
client_loop: send disconnect: Broken pipeexit-255 failure mode wheredocker compose recreateruns long enough that the cloudflared SSH tunnel (or OpenSSH client default) drops the idle session even though the host-side deploy is still running and the container ends up Up + healthy.Observed on PR #111 merge auto-deploy (run 26419696840): SSH dropped mid-recreate, exit 255, container actually came up server-side — required a manual
docker start+gh run rerunto mark the deploy green.Fix
Add to both ssh invocations:
= keepalive packet every 30s, 8 retries before declaring dead = 4 min of network silence tolerated. The deploy script's longest silent stretch (image pull + container recreate) is comfortably under that ceiling.
Files
.github/workflows/deploy-dev.yaml.github/workflows/deploy-prd.yamlTest plan
Lint & Buildgreen