Skip to content

Conversation

@calintje
Copy link
Contributor

@calintje calintje commented Nov 5, 2025

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

…use docker compose for build and test jobs. Add vitest and tsup to ts-sdk manifests.
@calintje calintje self-assigned this Nov 6, 2025
@calintje calintje added the skip-changeset Skip changeset check for non-package changes (eg. CI, tooling) label Nov 6, 2025
run: yarn install
- name: Run Lint
run: yarn lint --output-style static
- name: Run lint
Copy link
Member

Choose a reason for hiding this comment

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

I don't think lint needs anything that is not already installed on a github runner. Doing it in docker might be a little overkill

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we discussed earlier, I will update this once we can add all the rust projects to the same root workspace.

changeset:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
if: ${{ !(github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels.*.name, 'skip-changeset')) }}
Copy link
Member

Choose a reason for hiding this comment

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

I think you can also just do yarn changeset --empty or something IIRC

@calintje calintje force-pushed the calintje/dockerize-ci-build-test branch from 21b7e61 to 651f0d1 Compare November 8, 2025 06:29
@calintje calintje removed the skip-changeset Skip changeset check for non-package changes (eg. CI, tooling) label Nov 10, 2025
@calintje calintje changed the title [TKN-703, AMM-40, AMM-41] Dockerize CI build and test jobs [TKN-703, AMM-41] Dockerize CI build and test jobs Nov 10, 2025
@calintje calintje changed the title [TKN-703, AMM-41] Dockerize CI build and test jobs [TKN-703, AMM-41] Dockerize CI build, test and lint jobs Nov 10, 2025
"@solana/kit": "^2.3.0",
"codama": "^1.3.7",
"typescript": "^5.9.3"
"tsup": "^8.4.0",
Copy link
Contributor

@jshiohaha jshiohaha Nov 10, 2025

Choose a reason for hiding this comment

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

for my own learning, is there a reason why tsup & vitest were added to some package.json files (other than the root)? maybe smth related to the different docker-compose services?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my own experience, I noticed that NX seems to use the dev deps from the root package.json.

But that doesn't seem to be the case when using yarn workspace <package> build from the root of the repo [link]

@calintje calintje force-pushed the calintje/dockerize-ci-build-test branch from a421ce9 to 118fa30 Compare November 12, 2025 11:44
Copy link
Member

@wjthieme wjthieme left a comment

Choose a reason for hiding this comment

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

Send it!

@calintje calintje merged commit e20268a into main Nov 13, 2025
17 of 18 checks passed
@calintje calintje deleted the calintje/dockerize-ci-build-test branch November 13, 2025 12:02
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.

4 participants