feat: add standalone rebalancer Docker image and workflow#7545
feat: add standalone rebalancer Docker image and workflow#7545paulbalaji merged 31 commits intomainfrom
Conversation
|
2a3bb96 to
a174445
Compare
0d8aca4 to
5dde1c3
Compare
a174445 to
a4ca220
Compare
d177efc to
93d93c7
Compare
9e9ab1e to
e3823dd
Compare
5a8bd28 to
7d3cf0f
Compare
e3823dd to
f4db4b3
Compare
🦀 Rust Agent Docker Image Built SuccessfullyImage Tags: |
76dac84 to
b6cac9a
Compare
7d3cf0f to
36aa15c
Compare
2262552 to
d575434
Compare
36aa15c to
594f40d
Compare
b1fb394 to
c30ec76
Compare
a9c9627 to
9f87fea
Compare
c17a86b to
3d04d24
Compare
- Always build on pushes to main (match monorepo behavior) - Only trigger PR builds for direct rebalancer changes - Remove unnecessary check-changes step 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Additional Comments (1)
-
typescript/infra/src/rebalancer/helm.ts, line 81-84 (link)logic: still referencing old monorepo image instead of standalone
hyperlane-rebalancerimage
13 files reviewed, 1 comment
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
typescript/rebalancer/Dockerfile (2)
72-73: Consider whether package.json is needed in the runtime.You're copying the package.json alongside the bundle. If the bundle is truly standalone (all dependencies compiled in), that file might not be required. Worth verifying whether the runtime actually reads it.
64-83: Runtime stage is lean, but could use a non-root user.The Alpine base keeps things minimal, and the bundled output means no hefty node_modules. For better security posture, consider running as a non-root user—especially in production environments.
🔎 Add a non-root user to the runtime stage
FROM node:20-alpine AS runner WORKDIR /app RUN apk add --no-cache ca-certificates +# Create non-root user +RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001 + # Copy only the bundled output (includes all dependencies) COPY --from=builder /hyperlane-monorepo/typescript/rebalancer/rebalancer-bundle ./rebalancer-bundle COPY --from=builder /hyperlane-monorepo/typescript/rebalancer/package.json ./ +# Set ownership to non-root user +RUN chown -R nodejs:nodejs /app + +USER nodejs + # Environment variables ENV NODE_ENV=production ENV LOG_LEVEL=info
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/rebalancer-docker.ymltypescript/infra/src/rebalancer/helm.tstypescript/rebalancer/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (2)
- typescript/infra/src/rebalancer/helm.ts
- .github/workflows/rebalancer-docker.yml
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-12-22T16:50:19.890Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7565
File: typescript/ccip-server/Dockerfile:10-11
Timestamp: 2025-12-22T16:50:19.890Z
Learning: Standardize Foundry installation in Dockerfiles by using the official curl -L https://foundry.paradigm.xyz | bash followed by foundryup. This pattern is already used across multiple Dockerfiles in the repo and should be retained for consistency and reliability wherever Foundry is installed.
Applied to files:
typescript/rebalancer/Dockerfile
📚 Learning: 2025-08-13T16:53:55.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6891
File: typescript/infra/config/environments/mainnet3/funding.ts:22-22
Timestamp: 2025-08-13T16:53:55.163Z
Learning: In Hyperlane mainnet3 configs, funding.ts uses 'gcr.io/abacus-labs-dev/hyperlane-monorepo' docker image while agent.ts uses 'gcr.io/abacus-labs-dev/hyperlane-agent' docker image. These are different images with independent tag cycles, so tag consistency across them is not expected.
Applied to files:
typescript/rebalancer/Dockerfile
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.
Applied to files:
typescript/rebalancer/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (61)
- GitHub Check: cli-evm-e2e-matrix (warp-check-3)
- GitHub Check: cli-evm-e2e-matrix (core-init)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
- GitHub Check: cli-evm-e2e-matrix (warp-check-2)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-read)
- GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
- GitHub Check: cli-evm-e2e-matrix (warp-check-4)
- GitHub Check: cli-evm-e2e-matrix (core-apply)
- GitHub Check: cli-evm-e2e-matrix (relay)
- GitHub Check: cli-evm-e2e-matrix (warp-send)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
- GitHub Check: cli-evm-e2e-matrix (warp-init)
- GitHub Check: cli-evm-e2e-matrix (core-check)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-evm-e2e-matrix (core-read)
- GitHub Check: cli-evm-e2e-matrix (core-deploy)
- GitHub Check: cli-evm-e2e-matrix (warp-check-5)
- GitHub Check: cli-evm-e2e-matrix (status)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
- GitHub Check: cli-evm-e2e-matrix (warp-check-1)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
- GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
- GitHub Check: env-test-matrix (mainnet3, ethereum, core)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
- GitHub Check: env-test-matrix (testnet4, sepolia, core)
- GitHub Check: env-test-matrix (mainnet3, optimism, core)
- GitHub Check: env-test-matrix (mainnet3, optimism, igp)
- GitHub Check: cli-radix-e2e-matrix (warp-deploy)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-radix-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (warp-read)
- GitHub Check: cli-radix-e2e-matrix (core-apply)
- GitHub Check: cli-cosmos-e2e-matrix (core-read)
- GitHub Check: cli-cosmos-e2e-matrix (core-apply)
- GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-check)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
- GitHub Check: cosmos-sdk-e2e-run
- GitHub Check: pnpm-test-run
- GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
- GitHub Check: aleo-sdk-e2e-run
- GitHub Check: cli-install-test-run
- GitHub Check: infra-test
- GitHub Check: build-and-push-to-gcr
- GitHub Check: build-and-push-to-gcr
- GitHub Check: Socket Security: Pull Request Alerts
- GitHub Check: e2e-matrix (evm)
- GitHub Check: lint-rs
- GitHub Check: lander-coverage
- GitHub Check: test-rs
🔇 Additional comments (4)
typescript/rebalancer/Dockerfile (4)
1-7: Solid foundation for the build stage.The base image and dependencies are well-chosen. Cleaning up apt lists keeps the layer lean, which is proper housekeeping.
9-16: Pinned Foundry binaries are a solid choice here.The direct download from GitHub releases with version pinning gives you reproducible builds, which is what you're after. This differs from the installer pattern in some other Dockerfiles, but the pinning approach is more explicit. The shell switching for pipefail ensures curl failures don't slip through unnoticed, which is good defensive coding.
Based on learnings, other Dockerfiles use the official curl | bash installer, but your approach is intentional for pinning.
18-43: Well-structured dependency caching.The layering here is thoughtful: package.json first, then configs, patches, and workspace package.jsons before the install. Using
--frozen-lockfilekeeps builds reproducible. This approach makes rebuilds faster when only source code changes.
45-62: Bundle strategy looks clean.The source copies align with the package.json dependencies, and the turbo filter targets just the rebalancer. If the bundle step fails, the subsequent COPY will catch it, so there's no need for explicit verification here.
antigremlin
left a comment
There was a problem hiding this comment.
Nice! Please see my comments.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
typescript/rebalancer/scripts/ncc.post-bundle.mjs (1)
11-11: Minor shebang format inconsistency with CLI version.The CLI's post-bundle script uses
#! /usr/bin/env node(with a space after#!), while this uses#!/usr/bin/env node(no space). Both are valid, but for consistency across the monorepo, consider matching the CLI's format.🔎 Optional consistency fix
-const shebang = '#!/usr/bin/env node'; +const shebang = '#! /usr/bin/env node';
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.github/workflows/rebalancer-docker.ymltypescript/rebalancer/.gitignoretypescript/rebalancer/Dockerfiletypescript/rebalancer/package.jsontypescript/rebalancer/scripts/ncc.post-bundle.mjstypescript/rebalancer/src/service.tstypescript/rebalancer/turbo.json
🚧 Files skipped from review as they are similar to previous changes (4)
- typescript/rebalancer/turbo.json
- typescript/rebalancer/Dockerfile
- typescript/rebalancer/src/service.ts
- .github/workflows/rebalancer-docker.yml
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.
Applied to files:
typescript/rebalancer/.gitignore
📚 Learning: 2025-08-26T13:46:37.695Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.
Applied to files:
typescript/rebalancer/.gitignore
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.
Applied to files:
typescript/rebalancer/package.json
🧬 Code graph analysis (1)
typescript/rebalancer/scripts/ncc.post-bundle.mjs (1)
typescript/cli/scripts/ncc.post-bundle.mjs (8)
__filename(6-6)__dirname(7-7)outputFile(9-9)shebang(11-11)dirnameDef(12-15)content(19-19)executable(27-27)newContent(28-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (61)
- GitHub Check: cli-evm-e2e-matrix (warp-check-2)
- GitHub Check: cli-evm-e2e-matrix (warp-init)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
- GitHub Check: cli-evm-e2e-matrix (warp-send)
- GitHub Check: cli-evm-e2e-matrix (warp-read)
- GitHub Check: cli-evm-e2e-matrix (warp-check-3)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
- GitHub Check: cli-evm-e2e-matrix (warp-check-4)
- GitHub Check: cli-evm-e2e-matrix (relay)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
- GitHub Check: cli-evm-e2e-matrix (core-read)
- GitHub Check: cli-evm-e2e-matrix (warp-check-1)
- GitHub Check: cli-evm-e2e-matrix (core-check)
- GitHub Check: cli-evm-e2e-matrix (warp-check-5)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
- GitHub Check: cli-evm-e2e-matrix (core-deploy)
- GitHub Check: cli-evm-e2e-matrix (status)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
- GitHub Check: cli-evm-e2e-matrix (core-apply)
- GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
- GitHub Check: cli-evm-e2e-matrix (core-init)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
- GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
- GitHub Check: env-test-matrix (testnet4, sepolia, core)
- GitHub Check: env-test-matrix (mainnet3, optimism, core)
- GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-apply)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
- GitHub Check: env-test-matrix (mainnet3, ethereum, core)
- GitHub Check: cli-cosmos-e2e-matrix (core-check)
- GitHub Check: env-test-matrix (mainnet3, optimism, igp)
- GitHub Check: cli-cosmos-e2e-matrix (core-read)
- GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (warp-read)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
- GitHub Check: aleo-sdk-e2e-run
- GitHub Check: cli-radix-e2e-matrix (core-deploy)
- GitHub Check: cli-radix-e2e-matrix (warp-deploy)
- GitHub Check: cli-radix-e2e-matrix (core-apply)
- GitHub Check: pnpm-test-run
- GitHub Check: cli-install-test-run
- GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
- GitHub Check: cosmos-sdk-e2e-run
- GitHub Check: infra-test
- GitHub Check: build-and-push-to-gcr
- GitHub Check: build-and-push-to-gcr
- GitHub Check: e2e-matrix (evm)
- GitHub Check: lint-prettier
- GitHub Check: lint-rs
- GitHub Check: lander-coverage
- GitHub Check: test-rs
🔇 Additional comments (5)
typescript/rebalancer/.gitignore (1)
4-4: LGTM! Build artifacts belong in .gitignore.Adding the bundle directory to .gitignore is the right call—keeps generated files out of version control where they belong.
typescript/rebalancer/package.json (3)
18-18: Clean script updated correctly.Good addition of the bundle directory to the clean script.
54-54: NCC dependency added appropriately.The @vercel/ncc devDependency is correctly placed and uses the catalog reference.
17-17: No action needed—the turbo.json already has the bundle task properly configured with"dependsOn": ["build"], so the build step will always run before bundle. Fresh checkouts won't hit errors here.Likely an incorrect or invalid review comment.
typescript/rebalancer/scripts/ncc.post-bundle.mjs (1)
17-36: Post-bundle processing looks solid.The logic correctly validates the shebang, injects the __dirname shim when needed, and properly exits with an error code on failure. Nice work addressing the error handling from the previous review.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
typescript/infra/src/rebalancer/helm.tstypescript/rebalancer/Dockerfiletypescript/rebalancer/package.jsontypescript/rebalancer/src/service.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- typescript/rebalancer/Dockerfile
🧰 Additional context used
📓 Path-based instructions (1)
typescript/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
typescript/**/*.{ts,tsx}: UseChainMapfor per-chain configurations in TypeScript
Import types from@hyperlane-xyz/sdkwhen using TypeScript SDK types
Files:
typescript/rebalancer/src/service.tstypescript/infra/src/rebalancer/helm.ts
🧠 Learnings (3)
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.
Applied to files:
typescript/rebalancer/src/service.ts
📚 Learning: 2025-08-13T16:53:55.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6891
File: typescript/infra/config/environments/mainnet3/funding.ts:22-22
Timestamp: 2025-08-13T16:53:55.163Z
Learning: In Hyperlane mainnet3 configs, funding.ts uses 'gcr.io/abacus-labs-dev/hyperlane-monorepo' docker image while agent.ts uses 'gcr.io/abacus-labs-dev/hyperlane-agent' docker image. These are different images with independent tag cycles, so tag consistency across them is not expected.
Applied to files:
typescript/rebalancer/src/service.tstypescript/infra/src/rebalancer/helm.ts
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.
Applied to files:
typescript/rebalancer/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (62)
- GitHub Check: cli-evm-e2e-matrix (warp-read)
- GitHub Check: cli-evm-e2e-matrix (warp-check-1)
- GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
- GitHub Check: cli-evm-e2e-matrix (warp-check-2)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
- GitHub Check: cli-evm-e2e-matrix (warp-init)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
- GitHub Check: cli-evm-e2e-matrix (warp-check-4)
- GitHub Check: cli-evm-e2e-matrix (warp-send)
- GitHub Check: cli-evm-e2e-matrix (warp-check-3)
- GitHub Check: cli-evm-e2e-matrix (warp-check-5)
- GitHub Check: cli-evm-e2e-matrix (status)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
- GitHub Check: cli-evm-e2e-matrix (core-deploy)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-evm-e2e-matrix (core-read)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
- GitHub Check: cli-evm-e2e-matrix (core-init)
- GitHub Check: cli-evm-e2e-matrix (core-check)
- GitHub Check: cli-evm-e2e-matrix (core-apply)
- GitHub Check: cli-evm-e2e-matrix (relay)
- GitHub Check: cli-radix-e2e-matrix (core-apply)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cli-radix-e2e-matrix (warp-deploy)
- GitHub Check: cli-radix-e2e-matrix (core-deploy)
- GitHub Check: env-test-matrix (mainnet3, optimism, core)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
- GitHub Check: env-test-matrix (testnet4, sepolia, core)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
- GitHub Check: cli-cosmos-e2e-matrix (warp-read)
- GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
- GitHub Check: env-test-matrix (mainnet3, ethereum, core)
- GitHub Check: env-test-matrix (mainnet3, optimism, igp)
- GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-apply)
- GitHub Check: cli-cosmos-e2e-matrix (core-read)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-check)
- GitHub Check: pnpm-test-run
- GitHub Check: aleo-sdk-e2e-run
- GitHub Check: cosmos-sdk-e2e-run
- GitHub Check: cli-install-test-run
- GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
- GitHub Check: infra-test
- GitHub Check: build-and-push-to-gcr
- GitHub Check: build-and-push-to-gcr
- GitHub Check: e2e-matrix (evm)
- GitHub Check: agent-configs (mainnet3)
- GitHub Check: lint-prettier
- GitHub Check: lander-coverage
- GitHub Check: lint-rs
- GitHub Check: test-rs
🔇 Additional comments (11)
typescript/rebalancer/package.json (3)
18-18: Good addition to the clean script.Adding
bundleto the cleanup makes sense with the new bundling step. Keeps things tidy.
17-17: Both concerns are already properly handled—no changes needed.Good news: the build→bundle dependency chain is set up right in turbo.json (
"dependsOn": ["build"]), so that won't blow up mid-pipeline. And the excluded dependency gets handled in the Dockerfile's production stage withRUN npm install @google-cloud/pino-logging-gcp-config, which means it'll be available when the container runs. Everything's layered correctly here.
54-54: @vercel/ncc is secure and actively maintained — Latest version (0.38.4) has no known direct vulnerabilities, and using the catalog versioning keeps your workspace dependencies consistent across the monorepo, which is exactly what you want for build tools.typescript/infra/src/rebalancer/helm.ts (3)
4-4: Import looks good.The DEFAULT_GITHUB_REGISTRY import is used properly in the registryUri construction below.
89-89: Registry URI integration looks solid.The registryUri is properly passed through to the Helm values, replacing the previous registryCommit approach.
77-79: No action needed — the/tree/{commit}format is correct and supported.The @hyperlane-xyz/registry library does support GitHub URLs with
/tree/{ref}(where ref can be a commit, branch, or tag), and this code properly locks the registry to a specific commit snapshot. The codebase even documents this pattern — see the rebalancer service where it notes that REGISTRY_URI can include/tree/{commit}for pinning to specific versions.typescript/rebalancer/src/service.ts (5)
17-17: Nice documentation addition.The REGISTRY_URI environment variable is well-documented, including the
/tree/{commit}pattern for version pinning.
25-25: Import is correct.DEFAULT_GITHUB_REGISTRY import matches the usage pattern in helm.ts.
34-34: Version resolution correctly updated.The VERSION now uses
SERVICE_VERSIONenvironment variable with a 'dev' fallback, which addresses the previous review feedback about Docker image versioning.
133-138: Error handling improvements look good.Explicitly typing errors and including stack traces in the logs will make debugging easier when things go sideways.
Also applies to: 144-146
87-95:enableProxy: trueis the standard configuration across the codebase.This change aligns with registry initialization patterns used consistently throughout the repository (in tests, config files, and other services). The SDK-provided
getRegistryfunction from@hyperlane-xyz/registry/fshandles proxy functionality internally, so no additional documentation is needed here.Likely an incorrect or invalid review comment.
- Add configmap.yaml template to mount rebalancer config - Update stateful-set.yaml with volume mount - Update _helpers.tpl with volumeMounts and hardcoded config path - Update helm.ts to read config content and pass to helm values - Rename rebalancerConfigFile to rebalancerConfig in values.yaml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
♻️ Rebalancer Docker Image Built SuccessfullyImage Tags: |
🐳 Monorepo Docker Image Built SuccessfullyImage Tags: |
Summary
Image Size Comparison
hyperlane-monorepo(yarn)hyperlane-monorepo(pnpm)hyperlane-rebalancer(standalone)Approach
Uses @vercel/ncc to bundle the rebalancer into a single file with all dependencies, then runs on a minimal Alpine image. This eliminates the need for pnpm/node_modules in the final image.
Changes
typescript/rebalancer/Dockerfile- Multi-stage Docker build with ncc bundlingtypescript/rebalancer/package.json- Added ncc and bundle scripttypescript/rebalancer/scripts/ncc.post-bundle.mjs- Post-bundle __dirname fix.github/workflows/rebalancer-docker.yml- CI workflow for building/pushingtypescript/infra/helm/rebalancer/- Updated deployment + valuesturbo.json- Added bundle taskStacked on #7544
Test plan
🐳 Standalone Image Initiative
This PR is part of a wider effort to migrate TypeScript workloads from the 6.39 GB monorepo image to lightweight standalone images:
*20 unique nodes (some overlap between workloads)
Total Infrastructure Savings
🤖 Generated with Claude Code
Greptile Summary
Introduces a standalone Docker image for the rebalancer using
@vercel/nccbundling, achieving a 96.5% reduction in image size (227 MB vs 6.45 GB). The implementation uses a multi-stage build process: first stage builds TypeScript and bundles with ncc, second stage copies just the bundle to an Alpine image.Key Changes:
/tree/{commit}for version pinning)__dirnamepolyfill for ESM compatibilityregistryUriinstead ofregistryCommit@vercel/nccto pnpm catalog for consistencyIssue Found:
typescript/infra/src/rebalancer/helm.tsstill references the old monorepo image (gcr.io/abacus-labs-dev/hyperlane-monorepo) instead of the new standalone image (gcr.io/abacus-labs-dev/hyperlane-rebalancer), which would prevent deployments from using the optimized imageConfidence Score: 3/5
helm.ts(line 82) where the hardcoded monorepo image reference prevents actual deployment of the standalone image significantly impacts the PR's core goal of using the optimized imagetypescript/infra/src/rebalancer/helm.tsneeds the image repository updated to use the standalone rebalancer imageImportant Files Changed
Sequence Diagram
sequenceDiagram participant Dev as Developer participant GH as GitHub Actions participant Depot as Depot Builder participant GCR as Google Container Registry participant K8s as Kubernetes participant Rebalancer as Rebalancer Service Dev->>GH: Push to main / Create PR GH->>GH: Trigger rebalancer-docker.yml workflow GH->>GH: Check GCLOUD_SERVICE_KEY secret GH->>GH: Generate tag (SHA-DATE) GH->>GH: Read Foundry version from .foundryrc GH->>Depot: Build multi-stage Docker image Depot->>Depot: Stage 1: Install deps & build TypeScript Depot->>Depot: Run ncc bundling (creates single file) Depot->>Depot: Run post-bundle script (add __dirname) Depot->>Depot: Stage 2: Copy bundle to Alpine image Depot->>GCR: Push tagged image (227 MB) GCR-->>GH: Image pushed successfully GH->>Dev: Comment image tags on PR Dev->>K8s: Deploy via Helm chart K8s->>GCR: Pull hyperlane-rebalancer image K8s->>Rebalancer: Start container with env vars Rebalancer->>Rebalancer: Validate REBALANCER_CONFIG_FILE & HYP_KEY Rebalancer->>Rebalancer: Load config & initialize registry Rebalancer->>Rebalancer: Create MultiProvider with signer Rebalancer->>Rebalancer: Start daemon mode (check every 60s) Rebalancer->>K8s: Expose metrics on port 9090Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.