Skip to content

Commit cb68301

Browse files
authored
[TKN-702] Build project using Docker (#1090)
* Add working docker-compose * Revert core package.json * Base * Complete * remove lint step * Add dependency * Add changeset * Add whirlpools-rust-integration to build-integration. Add all deps to final build stage. * Update changeset
1 parent c6f6df4 commit cb68301

File tree

5 files changed

+194
-0
lines changed

5 files changed

+194
-0
lines changed

.changeset/tender-states-attack.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@orca-so/whirlpools": patch
3+
"@orca-so/whirlpools-client": patch
4+
---
5+
6+
Update deps

docker-compose.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
name: whirlpools
2+
3+
services:
4+
5+
build-solana-program:
6+
image: backpackapp/build:v0.29.0
7+
working_dir: /usr/src/whirlpools
8+
command: >
9+
anchor build
10+
profiles: [build]
11+
volumes:
12+
- ./:/usr/src/whirlpools
13+
14+
yarn-install:
15+
image: rust:1.84.0
16+
working_dir: /usr/src/whirlpools
17+
command: >
18+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
19+
&& apt-get update && apt-get install -y nodejs
20+
&& corepack enable && corepack prepare [email protected] --activate
21+
&& yarn install"
22+
profiles: [build]
23+
volumes:
24+
- ./:/usr/src/whirlpools
25+
- node_modules:/usr/src/whirlpools/node_modules
26+
- yarn_cache:/usr/src/whirlpools/.yarn/cache
27+
28+
build-ts-sdk:
29+
image: rust:1.84.0
30+
working_dir: /usr/src/whirlpools
31+
command: >
32+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
33+
&& apt-get update && apt-get install -y nodejs
34+
&& corepack enable && corepack prepare [email protected] --activate
35+
&& rustup target add wasm32-unknown-unknown
36+
&& yarn workspace @orca-so/whirlpools-client build
37+
&& yarn workspace @orca-so/whirlpools-core build
38+
&& yarn workspace @orca-so/tx-sender build
39+
&& yarn workspace @orca-so/whirlpools build
40+
&& yarn workspace @orca-so/whirlpools-lint format"
41+
profiles: [build]
42+
depends_on:
43+
build-solana-program:
44+
condition: service_completed_successfully
45+
yarn-install:
46+
condition: service_completed_successfully
47+
volumes:
48+
- ./:/usr/src/whirlpools
49+
- node_modules:/usr/src/whirlpools/node_modules:ro
50+
- yarn_cache:/usr/src/whirlpools/.yarn/cache:ro
51+
52+
build-legacy-sdk:
53+
image: rust:1.84.0
54+
working_dir: /usr/src/whirlpools
55+
command: >
56+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
57+
&& apt-get update && apt-get install -y nodejs
58+
&& corepack enable && corepack prepare [email protected] --activate
59+
&& yarn workspace @orca-so/common-sdk build
60+
&& yarn workspace @orca-so/whirlpools-sdk build
61+
&& yarn workspace @orca-so/whirlpools-sdk-cli build"
62+
profiles: [build]
63+
depends_on:
64+
build-solana-program:
65+
condition: service_completed_successfully
66+
yarn-install:
67+
condition: service_completed_successfully
68+
volumes:
69+
- ./:/usr/src/whirlpools
70+
- node_modules:/usr/src/whirlpools/node_modules:ro
71+
- yarn_cache:/usr/src/whirlpools/.yarn/cache:ro
72+
73+
build-rust-sdk:
74+
image: rust:1.84.0
75+
working_dir: /usr/src/whirlpools
76+
command: >
77+
sh -c "rustup component add clippy rustfmt
78+
&& cargo build --manifest-path rust-sdk/macros/Cargo.toml --locked
79+
&& cargo build --manifest-path rust-sdk/core/Cargo.toml --locked
80+
&& cargo build --manifest-path rust-sdk/client/Cargo.toml --locked
81+
&& cargo build --manifest-path rust-sdk/whirlpool/Cargo.toml --locked
82+
&& cargo build --manifest-path rust-sdk/tx-sender/Cargo.toml --locked
83+
&& cargo clippy --fix --allow-dirty --allow-staged
84+
&& cargo fmt"
85+
profiles: [build]
86+
depends_on:
87+
build-solana-program:
88+
condition: service_completed_successfully
89+
volumes:
90+
- ./:/usr/src/whirlpools
91+
92+
build-integration:
93+
image: rust:1.84.0
94+
working_dir: /usr/src/whirlpools
95+
command: >
96+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
97+
&& apt-get update && apt-get install -y nodejs
98+
&& corepack enable && corepack prepare [email protected] --activate
99+
&& yarn workspace @orca-so/whirlpools-integration build
100+
&& yarn workspace @orca-so/whirlpools-rust-integration build"
101+
profiles: [build]
102+
depends_on:
103+
build-rust-sdk:
104+
condition: service_completed_successfully
105+
build-ts-sdk:
106+
condition: service_completed_successfully
107+
volumes:
108+
- ./:/usr/src/whirlpools
109+
- node_modules:/usr/src/whirlpools/node_modules:ro
110+
- yarn_cache:/usr/src/whirlpools/.yarn/cache:ro
111+
112+
build-docs:
113+
image: rust:1.84.0
114+
working_dir: /usr/src/whirlpools
115+
command: >
116+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
117+
&& apt-get update && apt-get install -y nodejs
118+
&& corepack enable && corepack prepare [email protected] --activate
119+
&& yarn workspace @orca-so/whirlpools-docs-ts build
120+
&& yarn workspace @orca-so/whirlpools-docs-rust build
121+
&& yarn workspace @orca-so/whirlpools-docs-legacy build
122+
&& yarn workspace @orca-so/whirlpools-docs build"
123+
profiles: [build]
124+
depends_on:
125+
build-rust-sdk:
126+
condition: service_completed_successfully
127+
build-ts-sdk:
128+
condition: service_completed_successfully
129+
build-legacy-sdk:
130+
condition: service_completed_successfully
131+
volumes:
132+
- ./:/usr/src/whirlpools
133+
- node_modules:/usr/src/whirlpools/node_modules:ro
134+
- yarn_cache:/usr/src/whirlpools/.yarn/cache:ro
135+
136+
build-examples:
137+
image: rust:1.84.0
138+
working_dir: /usr/src/whirlpools
139+
command: >
140+
sh -c "curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
141+
&& apt-get update && apt-get install -y nodejs
142+
&& corepack enable && corepack prepare [email protected] --activate
143+
&& yarn workspace @orca-so/whirlpools-example-ts-next build
144+
&& cargo build --manifest-path examples/rust-sdk/whirlpool_repositioning_bot/Cargo.toml --locked"
145+
profiles: [build]
146+
depends_on:
147+
build-rust-sdk:
148+
condition: service_completed_successfully
149+
build-ts-sdk:
150+
condition: service_completed_successfully
151+
volumes:
152+
- ./:/usr/src/whirlpools
153+
- node_modules:/usr/src/whirlpools/node_modules:ro
154+
- yarn_cache:/usr/src/whirlpools/.yarn/cache:ro
155+
156+
build:
157+
image: alpine:3
158+
working_dir: /usr/src/whirlpools
159+
command: >
160+
echo "Build Completed"
161+
depends_on:
162+
build-solana-program:
163+
condition: service_completed_successfully
164+
yarn-install:
165+
condition: service_completed_successfully
166+
build-rust-sdk:
167+
condition: service_completed_successfully
168+
build-ts-sdk:
169+
condition: service_completed_successfully
170+
build-legacy-sdk:
171+
condition: service_completed_successfully
172+
build-integration:
173+
condition: service_completed_successfully
174+
build-docs:
175+
condition: service_completed_successfully
176+
build-examples:
177+
condition: service_completed_successfully
178+
profiles: [build]
179+
volumes:
180+
- ./:/usr/src/whirlpools
181+
182+
volumes:
183+
node_modules:
184+
yarn_cache:

ts-sdk/client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@orca-so/whirlpools-program": "*",
3939
"@solana/kit": "^2.1.0",
4040
"codama": "^1.2.11",
41+
"tsup": "^8.4.0",
4142
"typescript": "^5.8.2"
4243
},
4344
"repository": {

ts-sdk/whirlpool/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"devDependencies": {
4545
"@solana/kit": "^2.1.0",
4646
"solana-bankrun": "^0.4.0",
47+
"tsup": "^8.4.0",
4748
"typescript": "^5.8.2"
4849
},
4950
"repository": {

yarn.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4015,6 +4015,7 @@ __metadata:
40154015
"@orca-so/whirlpools-program": "npm:*"
40164016
"@solana/kit": "npm:^2.1.0"
40174017
codama: "npm:^1.2.11"
4018+
tsup: "npm:^8.4.0"
40184019
typescript: "npm:^5.8.2"
40194020
peerDependencies:
40204021
"@solana/kit": ^2.1.0
@@ -4275,6 +4276,7 @@ __metadata:
42754276
"@solana/kit": "npm:^2.1.0"
42764277
"@solana/sysvars": "npm:^2.1.0"
42774278
solana-bankrun: "npm:^0.4.0"
4279+
tsup: "npm:^8.4.0"
42784280
typescript: "npm:^5.8.2"
42794281
peerDependencies:
42804282
"@solana/kit": ^2.1.0

0 commit comments

Comments
 (0)