Skip to content

Restore optimized workers, prepare 2 GiB resize, and patch legacy Next.js - #76

Open
vicdenz wants to merge 3 commits into
mainfrom
fix/optimized-worker-profile
Open

vicdenz wants to merge 3 commits into
mainfrom
fix/optimized-worker-profile

Conversation

@vicdenz

@vicdenz vicdenz commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

  • Make the optimized research worker opt-in with Compose's existing COMPOSE_PROFILES=temporal flag; leave its code and documentation unchanged.
  • Restore application-container access to Valkey on the private Compose network and remove an existing research worker when the systemd service restarts.
  • Change the optimized EC2 target from t3a.medium (4 GiB) to t3a.small (2 GiB), lower the host memory preflight to 1.75 GiB, and update the Terraform test and optimized capacity guidance.
  • Update the retained legacy Next.js dependency from 15.5.24 to patched 15.5.27 and regenerate only its matching lockfile entries.
  • Check the default and opt-in Compose profiles, Valkey port exposure, and cross-container Valkey access in optimized CI.

Verification

  • actionlint .github/workflows/optimized-verify.yml
  • git diff --check
  • bash -n scripts/optimized/install-release.sh infra/optimized/runtime/bootstrap.sh
  • bash scripts/optimized/validate-isolation.sh
  • node --test scripts/capacity/*.test.mjs (11 passed)
  • terraform fmt -check -recursive infra/optimized/terraform
  • Backend-free Terraform init and validate for bootstrap and environment; environment test (4 passed)
  • Local Compose rendering confirmed the default profile excludes research-worker, the opt-in profile includes it, and Valkey has no published port.
  • Cross-container Valkey PING passed in optimized CI; the local Docker daemon is unavailable.
  • bun install --frozen-lockfile, bun run lint, bun run typecheck, bun run test (213 passed), bun run build with CI fixture environment, and bun audit --production passed locally.

Migration impact

No database or schema migration. A later optimized application deployment restarts Compose services and removes the existing research worker while retaining the Valkey volume. A separate, reviewed Terraform apply of the 2 GiB target stops and starts the EC2 host and causes downtime. Private Terraform variables may override the repository default.

Rollout

  1. Merge only after review and required checks pass. Manually dispatch optimized-application with deploy from main.
  2. Confirm Sidekiq and report creation, then measure host and container memory for 24 hours, including a report run. Keep the 4 GiB host if peak used memory exceeds 1.5 GiB, any process is OOM killed, or Sidekiq does not drain.
  3. Check the private optimized Terraform variables for an instance_type override. Dispatch optimized-infrastructure with plan from main and verify an in-place t3a.medium to t3a.small update with no unrelated changes. Only then dispatch apply, review its saved plan, and approve the production environment.
  4. Verify application and report health after the host starts.

Rollback

For app configuration, revert and redeploy the prior optimized release configuration; that would restore the earlier Valkey behavior, so prefer a forward correction if Valkey needs adjustment. For capacity, set the optimized instance type back to t3a.medium and apply a reviewed Terraform plan; the host stops and starts again. The legacy Next.js update can be reverted separately if it causes a regression, subject to the dependency audit gate.

Deferred work

This PR does not deploy to production, run a production report, collect the 24-hour memory series, or resize the live instance. Those operational steps require a merged release and reviewed production changes.

@vicdenz vicdenz changed the title Keep optimized Temporal worker opt-in and restore Valkey access Restore optimized workers and prepare 2 GiB EC2 resize Oct 16, 2026
@vicdenz vicdenz changed the title Restore optimized workers and prepare 2 GiB EC2 resize Restore optimized workers, prepare 2 GiB resize, and patch legacy Next.js Oct 17, 2026

This branch has not been deployed

No deployments
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.

1 participant