-
Notifications
You must be signed in to change notification settings - Fork 556
feat: add standalone rebalancer Docker image and workflow #7545
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
92c344e
fix: add @vercel/ncc to catalog for consistency
paulbalaji 58b235a
feat: add standalone rebalancer Docker image and workflow
paulbalaji 5910a19
feat: optimize rebalancer Docker image with ncc bundling
paulbalaji 41ba86c
fix: use GitHub registry by default instead of baked-in clone
paulbalaji f5290b6
chore: optimize builder stage with Alpine and pinned Foundry
paulbalaji 17fd7ec
Revert "chore: optimize builder stage with Alpine and pinned Foundry"
paulbalaji e289583
chore: only comment on PRs with rebalancer or workflow changes
paulbalaji f6ee225
chore: remove .registryrc dependency from rebalancer workflow
paulbalaji f416423
fixes
paulbalaji dba7be4
fix: update rebalancer Dockerfile for pnpm migration
paulbalaji d782e96
fix: update lockfile and add patches to Dockerfile
paulbalaji e10cee9
fix: use pnpm instead of yarn in prepack script
paulbalaji aa72d8b
refactor: use corepack for pnpm installation in Dockerfile
paulbalaji ba776cf
fix: add jq back for starknet-core build dependency
paulbalaji e4b1072
feat: add REGISTRY_URI and REGISTRY_COMMIT env var support for rebala…
paulbalaji 8dc0f69
refactor: simplify registry config to use URL-embedded commit
paulbalaji cffea35
fix: update deploy script to use registryUri with embedded commit
paulbalaji 3c37876
fix: use catalog: reference for @vercel/ncc in rebalancer
paulbalaji fadb5a6
fix: exit non-zero on ncc post-bundle errors
paulbalaji 79fe4c3
Merge remote-tracking branch 'origin/main' into pbio/rebalancer-docke…
paulbalaji 20270db
pin foundry version in rebalancer dockerfile
paulbalaji 427a06d
fix: use bash for pipefail in rebalancer dockerfile
paulbalaji 054a3d9
refine rebalancer workflow triggers
paulbalaji c07ea1d
greptile
paulbalaji bed40c7
CR: andrey
paulbalaji a5fbb1d
Merge remote-tracking branch 'origin/main' into pbio/rebalancer-docke…
paulbalaji da843dc
update rebalancer tag
paulbalaji ae1ee2a
pino logging fix
paulbalaji 863e99c
improve rebalancer entrypoint error log
paulbalaji be84fc0
fix(utils): isFile uses statSync instead of lstatSync
paulbalaji 5d127c2
refactor(rebalancer): use ConfigMap for config instead of baked-in file
paulbalaji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| name: Build and Push Rebalancer Image to GCR | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: | ||
| - '**' | ||
| pull_request: | ||
| paths: | ||
| - 'typescript/rebalancer/**' | ||
| - '.github/workflows/rebalancer-docker.yml' | ||
| workflow_dispatch: | ||
| inputs: | ||
| include_arm64: | ||
| description: 'Include arm64 in the build' | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| concurrency: | ||
| group: build-push-rebalancer-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check-env: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| gcloud-service-key: ${{ steps.gcloud-service-key.outputs.defined }} | ||
| steps: | ||
| - id: gcloud-service-key | ||
| env: | ||
| GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }} | ||
| if: "${{ env.GCLOUD_SERVICE_KEY != '' }}" | ||
| run: echo "defined=true" >> $GITHUB_OUTPUT | ||
|
|
||
| build-and-push-to-gcr: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| pull-requests: write | ||
|
|
||
| needs: [check-env] | ||
| if: needs.check-env.outputs.gcloud-service-key == 'true' | ||
|
|
||
| steps: | ||
| - name: Generate GitHub App Token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@v2 | ||
| with: | ||
| app-id: ${{ secrets.HYPER_GONK_APP_ID }} | ||
| private-key: ${{ secrets.HYPER_GONK_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@v5 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| submodules: recursive | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Generate tag data | ||
| id: taggen | ||
| run: | | ||
| echo "TAG_DATE=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT | ||
| echo "TAG_SHA=$(echo '${{ github.event.pull_request.head.sha || github.sha }}' | cut -b 1-7)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| gcr.io/abacus-labs-dev/hyperlane-rebalancer | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=ref,event=pr | ||
| type=raw,value=${{ steps.taggen.outputs.TAG_SHA }}-${{ steps.taggen.outputs.TAG_DATE }} | ||
|
|
||
| - name: Set up Depot CLI | ||
| uses: depot/setup-action@v1 | ||
|
|
||
| - name: Login to GCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: gcr.io | ||
| username: _json_key | ||
| password: ${{ secrets.GCLOUD_SERVICE_KEY }} | ||
|
|
||
| - name: Determine platforms | ||
| id: determine-platforms | ||
| run: | | ||
| if [ "${{ github.event.inputs.include_arm64 }}" == "true" ]; then | ||
| echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "platforms=linux/amd64" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Get Foundry version | ||
| id: foundry-version | ||
| run: | | ||
| FOUNDRY_VERSION=$(cat solidity/.foundryrc) | ||
| echo "FOUNDRY_VERSION=$FOUNDRY_VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build and push | ||
| id: build | ||
| uses: depot/build-push-action@v1 | ||
| with: | ||
| project: 3cpjhx94qv | ||
| context: ./ | ||
| file: ./typescript/rebalancer/Dockerfile | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: ${{ steps.determine-platforms.outputs.platforms }} | ||
| build-args: | | ||
| FOUNDRY_VERSION=${{ steps.foundry-version.outputs.FOUNDRY_VERSION }} | ||
| SERVICE_VERSION=${{ steps.taggen.outputs.TAG_SHA }}-${{ steps.taggen.outputs.TAG_DATE }} | ||
|
|
||
| - name: Comment image tags on PR | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/actions/docker-image-comment | ||
| with: | ||
| comment_tag: rebalancer-docker-image | ||
| image_name: Rebalancer Docker Image | ||
| emoji: ♻️ | ||
| image_tags: ${{ steps.meta.outputs.tags }} | ||
| pr_number: ${{ github.event.pull_request.number }} | ||
| github_token: ${{ steps.generate-token.outputs.token }} | ||
| job_status: ${{ job.status }} | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "hyperlane.fullname" . }}-config | ||
| labels: | ||
| {{- include "hyperlane.labels" . | nindent 4 }} | ||
| data: | ||
| rebalancer-config.yaml: | | ||
| {{ .Values.hyperlane.rebalancerConfig | indent 4 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| .env | ||
| dist | ||
| cache | ||
| bundle |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.