Skip to content

ci(docker): verify production image starts and serves health checks (WCN-3794) - #296

Closed
mohammadalfaiyazbitgo wants to merge 1 commit into
masterfrom
wcn-3794-docker-image-portability
Closed

mohammadalfaiyazbitgo wants to merge 1 commit into
masterfrom
wcn-3794-docker-image-portability

Conversation

@mohammadalfaiyazbitgo

Copy link
Copy Markdown
Contributor

What

  • PR CI (build-docker-image in .github/workflows/pull_request.yaml) now builds the production image for linux/amd64 explicitly (platforms: linux/amd64) and loads it into the runner Docker daemon (load: true).
  • New Smoke test image step starts both application modes from that image: AWM (APP_MODE=advanced-wallet-manager, port 13080) and Master Express (APP_MODE=master-express, port 13081) with TLS_MODE=disabled, on a temporary bridge network with a DNS alias so Master Express resolves AWM by name.
  • Health checks are polled up to 30s each and must return HTTP 200: POST /ping (AWM), POST /advancedwallet/ping (MBE), and POST /ping/advancedWalletManager (MBE → AWM over the network). Timeout or non-200 fails the job; an EXIT trap prints container logs on failure and always removes both containers and the network.

Why

WCN-3794: confirm the Docker image actually runs. Previously the PR pipeline only built the image (no load, no run), and the release pipeline had no runtime check either. The Dockerfile already pins an AMD64-only Node base digest, so the build target is now explicit instead of implicit.

Verification

  • npm ci / npm run build / lint / npm test (CI environment) — 439 passing
  • Containerized integration suite (docker-compose.integ.yml, same AMD64 base digest) — 29 passing
  • Built advanced-wallets:wcn-3794 with --platform linux/amd64 and smoke-ran both modes locally under emulation: all three health endpoints returned 200, including the cross-container MBE → AWM ping

Ticket: WCN-3794

PR CI built the production image but never loaded or ran it, so the
image runtime was never exercised. The build now targets linux/amd64
explicitly and loads the image into the runner Docker daemon.

A smoke step starts both application modes from that image with TLS
disabled, runs AWM and Master Express on a temporary bridge network
with a DNS alias, and polls three health checks for 200: POST /ping,
POST /advancedwallet/ping, and POST /ping/advancedWalletManager (MBE
to AWM over the network). Non-200 or timeout fails the job; the EXIT
trap prints container logs on failure and removes containers/network.

Ticket: WCN-3794

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

WCN-3794

@Charan-Ratlan

Copy link
Copy Markdown

@claude review

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment on lines +174 to +177
local status="none"
for _ in $(seq 1 30); do
if status="$(curl -s -o /dev/null -w '%{http_code}' -X POST "${url}")" && [ "${status}" = "200" ]; then
echo "${url} -> 200"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 nit (optional): The smoke test's 30-second limit per health check does not hold. A container that accepts a connection but never answers can stall the PR job for hours. The curl call in wait_for has no --max-time, so one hung request blocks the loop with no limit. Nothing else bounds the step: there is no timeout-minutes, so GitHub's 360-minute job default applies. Fix: pass --max-time (for example --connect-timeout 2 --max-time 5) to the curl in wait_for, and add a timeout-minutes on the step so every check stays bounded.

Why this was flagged

The trigger is a container whose port is open while the app never responds. Two examples are an event loop blocked during startup, and master-express hanging while it waits on an unresponsive AWM (its configured timeout defaults to 305 * 1000 ms in src/initConfig.ts). In wait_for, curl -s -o /dev/null -w '%{http_code}' -X POST "${url}" (pull_request.yaml:177) runs with no --max-time or --connect-timeout, and curl sets no total timeout by default. So the for _ in $(seq 1 30) loop never moves to its next iteration, and the "Timed out waiting" branch and the log dump are never reached. The PR description says each check is "polled up to 30s" and that a timeout fails the job. In fact the job runs until the GitHub default limit (no timeout-minutes is set on the step or job), using up runner minutes and leaving the check unresolved without the logs that cleanup would print. The base branch has no run step, so this hang is new.

Verification: Trigger: a PR's image accepts TCP connections but does not answer a health request. In wait_for, the call is curl -s -o /dev/null -w '%{http_code}' -X POST "${url}" with no --max-time and no --connect-timeout. Nothing else bounds the step: the build-docker-image job and the new step set no timeout-minutes, so GitHub's 360-minute default applies.

@mohammadalfaiyazbitgo

Copy link
Copy Markdown
Contributor Author

Closing without merging — this CI-only smoke change is superseded. The actual WCN-3794 scope per the Linear ticket discussion is bumping both Dockerfiles to Node 22.23.4+ with a re-pinned digest (and aligning .nvmrc); a replacement PR will carry that change.

@mohammadalfaiyazbitgo
mohammadalfaiyazbitgo deleted the wcn-3794-docker-image-portability branch October 26, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants