-
Notifications
You must be signed in to change notification settings - Fork 293
[TKN-702] Build project using Docker #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.changeset/lucky-points-joke.md
Outdated
| "@orca-so/whirlpools-program": patch | ||
| --- | ||
|
|
||
| Introduce a Docker-based build environment to improve portability, reproducibility, and onboarding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this bump needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI requires a changeset, and changesets are be set by project. Would you prefer to remove this changeset and ignore the CI check?
Updated the changeset to reflect the changes made to the actual packages: moved tsup from devdeps to deps for @orca-so/whirlpools and @orca-so/whirlpools-client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also add an empty changeset if you don't want a version bump
| volumes: | ||
| - ./:/usr/src/whirlpools | ||
|
|
||
| yarn-install: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this yarn intall needed here or can we just run yarn install in the build-ts-sdk container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The final stages build-integration, build-docs, and build-examples also need yarn install.
The nice thing about having it separate is that yarn-install runs in parallel with build-solana-program (which is a dependency for all other build stages). This reduces build times for build-ts-sdk, build-legacy-sdk and the three final build stages mentioned above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgsg if it works it works!
| - yarn_cache:/usr/src/whirlpools/.yarn/cache:ro | ||
|
|
||
| build-legacy-sdk: | ||
| image: rust:1.84.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one can just use a node image right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: You could also add this to build-ts-sdk (see if that is faster, cleaner, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one can just use a node image right?
For stability, I wanted to have all containers that rely on yarn install to use the exact same environment. build-docs is an example build stage that relies on yarn install, but also needs Rust to build the rust docs.
idea: You could also add this to build-ts-sdk (see if that is faster, cleaner, etc.)
Both build-ts-sdk and build-legacy-sdk start at the same time in parallel. Since build-legacy-sdk finishes before build-ts-sdk, I concluded that separation is faster than joining the two. The overhead of starting another container is effectively absorbed into the build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would be in favor of building our own Docker image and pull it from a registry. The docker image would have all the necessary tools pre-installed:
- Rust 1.84 (base image)
- Node 22
- Yarn 4.6.0
- Rust clippy and rustfmt
I believe that would speed up things as well. Not sure what the downside would be.
| working_dir: /usr/src/whirlpools | ||
| command: > | ||
| echo "Build Completed" | ||
| depends_on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would explicitly add all the build containers here and not just the final images (safer in case we change/update something down the line)
| volumes: | ||
| - ./:/usr/src/whirlpools | ||
|
|
||
| yarn-install: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgsg if it works it works!
This PR introduces a Dockerized build system for the Whirlpools repository, aiming to replace the current Nx + Yarn workspaces–based approach. The goal is to make the build process more reliable, reproducible, and accessible across different environments.
Key changes:
solana-sdk,solana-program), improving onboarding for new contributors and external developers.This sets the foundation for future CI/CD integration and ensures that anyone can build the project reliably without complex local setup.
Dependency graph:
Suggested usage: