whirlpools
whirlpools copied to clipboard
[TKN-703, AMM-40, AMM-41] Dockerize CI `build` and `test` jobs
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/amd64for all test services to ensure consistent x86_64 architecture - Ubuntu 24.04 for legacy SDK tests: Required for
litesvmnative 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
:roflag for test services because Vitest writes temporary config bundles tonode_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 teststest-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--libflag
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)