whirlpools icon indicating copy to clipboard operation
whirlpools copied to clipboard

[TKN-703, AMM-40, AMM-41] Dockerize CI `build` and `test` jobs

Open calintje opened this issue 2 months ago • 0 comments

Summary

Dockerizes the CI build and test jobs using docker-compose profiles, resolving native runner issues and simplifying the CI configuration.

Changes

1. Add test profile to docker-compose.yml

  • Platform: Uses platform: linux/amd64 for all test services to ensure consistent x86_64 architecture
  • Ubuntu 24.04 for legacy SDK tests: Required for litesvm native bindings which depend on glibc 2.39+ (__isoc23_* symbols). Debian Bookworm (rust:1.84.0) only has glibc 2.36.
    • Using Node 24 in this image to resolve OOM issues with LiteSVM, which are caused by certain node ABI versions [link]
  • Writable node_modules: Removed :ro flag for test services because Vitest writes temporary config bundles to node_modules/.vite-temp/ when loading config files. This is safe in the test environment and necessary for proper test execution.
  • Test services:
    • test-program: Whirlpool Solana program tests
    • test-program-integration: Legacy SDK integration tests (requires Ubuntu 24.04 for litesvm)
    • test-ts-sdk: TypeScript SDK tests (client, core, tx-sender, whirlpool)
    • test-rust-sdk: Rust SDK library tests with --lib flag

2. Fix litesvm test failures

Tests using litesvm were failing on native GitHub runners with OOM errors despite having sufficient memory. Analysis revealed this was a platform/environment issue rather than actual memory exhaustion.

Solution: Dockerizing tests with Ubuntu 24.04 provides:

  • Consistent glibc 2.39 environment
  • Reliable test runs without OOM failures

3. Simplify CI workflows

Replaced multi-step CI jobs with simple docker-compose commands:

Before:

  • Build: 4 steps (checkout, setup Anchor, install deps, build)
  • Test: 9 steps (checkout, add swap, cleanup, setup Anchor, install deps, multiple builds, run tests)

After:

  • Build: 3 steps (checkout, setup Docker, docker compose --profile build up)
  • Test: 3 steps (checkout, setup Docker, docker compose --profile test up)

4. Add dockerized lint job

calintje avatar Nov 05 '25 22:11 calintje