From a05f2c6b5c84bfaa76595d43cdb14948f797c042 Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:02:40 -0400 Subject: [PATCH 1/6] feat(ci): update CI to current standards, remove outdated ci, add new testing (#108) * chore(ci): add standard rollkit CI * feat(ci): remove outdated CI and add new test CI * feat(ci): add halt height for test command --- .github/auto_request_review.yml | 15 ++++ .github/pull_request_template.md | 18 +++++ .github/workflows/housekeeping.yml | 66 ++++++++++++++++ .github/workflows/release.yml | 53 ------------- .github/workflows/semantic-pull-request.yml | 20 +++++ .github/workflows/test.yaml | 86 --------------------- .github/workflows/test.yml | 21 +++++ compose.yaml | 2 + 8 files changed, 142 insertions(+), 139 deletions(-) create mode 100644 .github/auto_request_review.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/housekeeping.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/semantic-pull-request.yml delete mode 100644 .github/workflows/test.yaml create mode 100644 .github/workflows/test.yml diff --git a/.github/auto_request_review.yml b/.github/auto_request_review.yml new file mode 100644 index 0000000..bc48a57 --- /dev/null +++ b/.github/auto_request_review.yml @@ -0,0 +1,15 @@ +reviewers: + defaults: + - rollkit + groups: + rollkit: + - team:core +files: + ".github/**": + - MSevey + - rollkit +options: + ignore_draft: true + ignored_keywords: + - WIP + number_of_reviewers: 3 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..0c1cad9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ + + +## Overview + + diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml new file mode 100644 index 0000000..515a40d --- /dev/null +++ b/.github/workflows/housekeeping.yml @@ -0,0 +1,66 @@ +name: Housekeeping + +on: + issues: + types: [opened] + pull_request_target: + types: [opened, ready_for_review] + +jobs: + issue-management: + if: ${{ github.event.issue }} + name: Add issues to project and add triage label + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-labels: true + labels-to-add: "needs-triage" + run-projects: true + project-url: https://github.com/orgs/rollkit/projects/7 + + add-pr-to-project: + # ignore dependabot PRs + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} + name: Add PRs to project + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-projects: true + project-url: https://github.com/orgs/rollkit/projects/7 + + auto-add-reviewer: + name: Auto add reviewer to PR + if: github.event.pull_request + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-auto-request-review: true + + auto-add-assignee: + # ignore dependabot PRs + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} + name: Assign issue and PR to creator + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Set pull_request url and creator login + # yamllint disable rule:line-length + run: | + echo "PR=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV + echo "CREATOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV + # yamllint enable rule:line-length + - name: Assign PR to creator + run: gh pr edit ${{ env.PR }} --add-assignee ${{ env.CREATOR }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d1fd0f1..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This workflow is useful if you want to automate the process of: -# -# a) Creating a new prelease when you push a new tag with a "v" prefix (version). -# -# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases. -# After the prerelease is created, you need to make your changes on the release page at the relevant -# Github page and publish your release. -# -# b) Creating/updating the "latest" prerelease when you push to your default branch. -# -# This type of prelease is useful to make your bleeding-edge binaries available to advanced users. -# -# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your -# default branch. -on: push - -jobs: - might_release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Prepare Release Variables - id: vars - uses: ignite/cli/actions/release/vars@main - - - name: Issue Release Assets - uses: ignite/cli/actions/cli@main - if: ${{ steps.vars.outputs.should_release == 'true' }} - with: - args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 - - - name: Delete the "latest" Release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 - if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }} - with: - tag_name: ${{ steps.vars.outputs.tag_name }} - delete_release: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish the Release - uses: softprops/action-gh-release@v1 - if: ${{ steps.vars.outputs.should_release == 'true' }} - with: - tag_name: ${{ steps.vars.outputs.tag_name }} - files: release/* - prerelease: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 0000000..e11fe30 --- /dev/null +++ b/.github/workflows/semantic-pull-request.yml @@ -0,0 +1,20 @@ +name: Semantic Pull Request + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: conventional-commit-pr-title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 16ad6b5..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,86 +0,0 @@ -name: Test - -# trigger on each push against any branch and any PR -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' - -jobs: - check_logs_job: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install yq - run: | - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq &&\ - chmod +x yq - - - name: Install bc - run: | - sudo apt-get update - sudo apt-get install bc - - - name: Build container - run: | - docker build -t docker-gm:latest . - # change FROM statement in docker/Dockerfile to docker-gm:latest - sed -i 's/FROM ghcr.io\/rollkit\/gm:.*/FROM docker-gm:latest/g' docker/Dockerfile - docker compose -f docker/docker-compose.yaml build - - - name: Start compose - run: docker compose -f docker/docker-compose.yaml up -d - - - name: Let the chain run for some time - run: sleep 30 - - - name: Check if rollup can submit blocks via logs - run: | - # Get logs and remove colorization to compare with a string - logs=$(docker logs docker-gm-1 2>&1 | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g") - line='INF commit synced commit=' - if [[ "$logs" == *"$line"* ]]; then - echo "'commit synced commit' reached" - else - echo "$logs" - echo "'commit synced commit' NOT reached" - exit 1 - fi - - - name: Check if rollup works - run: | - docker compose -f docker/docker-compose.yaml exec gm gmd q gm gm - - - name: Check balance of accounts - run: | - amount=42069 - genesis=$(docker compose -f docker/docker-compose.yaml exec gm cat .gm/config/genesis.json) - addresses=$(echo $genesis | jq -r '.app_state.auth.accounts[].address') - address1=$(echo $addresses | cut -d' ' -f1) - address2=$(echo $addresses | cut -d' ' -f2) - a1balance_old=$(docker compose -f docker/docker-compose.yaml exec gm gmd query bank balances ${address1} | yq '.balances[0].amount' -) - a2balance_old=$(docker compose -f docker/docker-compose.yaml exec gm gmd query bank balances ${address2} | yq '.balances[0].amount' -) - echo "Sending $amount from $address1 to $address2" - docker compose -f docker/docker-compose.yaml exec gm gmd tx bank send ${address1} ${address2} ${amount}stake --keyring-backend test -y > /dev/null - echo "Waiting for block to be committed" - sleep 60 # TODO: Instead of sleeping, wait for a new block to be committed - a1balance_new=$(docker compose -f docker/docker-compose.yaml exec gm gmd query bank balances ${address1} | yq '.balances[0].amount' -) - a2balance_new=$(docker compose -f docker/docker-compose.yaml exec gm gmd query bank balances ${address2} | yq '.balances[0].amount' -) - a1balance_diff=$(echo "$a1balance_new - $a1balance_old" | bc) - a2balance_diff=$(echo "$a2balance_new - $a2balance_old" | bc) - - if [ "$a1balance_diff" -eq "-$amount" ] && [ "$a2balance_diff" -eq "$amount" ]; then - echo "Transfer successful" - else - echo "Transfer failed" - exit 1 - fi - - - name: Cleanup compose - if: always() - run: docker compose -f docker/docker-compose.yaml down --timeout 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cd2d5a1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Test + +on: + push: + branches: + - "main" + pull_request: + +jobs: + gm-docker-compose: + runs-on: ubuntu-latest + steps: + # need checkout before using docker-compose-action + - uses: actions/checkout@v3 + - uses: adambirds/docker-compose-action@v1.3.0 + with: + compose-file: "compose.yaml" + up-flags: "--build" + test-container: gm + # Run the GM tutorial and halt after 10 blocks + test-command: "rollkit start --rollkit.aggregator --rollkit.da_address http://localhost:7980 --halt-height 10" diff --git a/compose.yaml b/compose.yaml index f971df0..3b3c5bc 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,6 +3,7 @@ version: "3" services: gm: + container_name: gm # The build config can be used for debugging and testing changes to the GM Dockerfile build: . @@ -18,6 +19,7 @@ services: - local-da local-da: + container_name: local-da image: ghcr.io/rollkit/local-da:aa37274 ports: - "7980:7980" From c052466feca10d9eb46230c78c30f80d8226d3cc Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:18:15 -0400 Subject: [PATCH 2/6] chore: bump versions of local-da and gm docker files in kurtosis package (#109) * chore: bump local-da docker image tags * chore: bump gm image --- compose.yaml | 2 +- main.star | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compose.yaml b/compose.yaml index 3b3c5bc..508d30d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -19,7 +19,7 @@ services: - local-da local-da: + image: ghcr.io/rollkit/local-da:v0.2.1 container_name: local-da - image: ghcr.io/rollkit/local-da:aa37274 ports: - "7980:7980" diff --git a/main.star b/main.star index 61750fb..a4e26c2 100644 --- a/main.star +++ b/main.star @@ -20,7 +20,7 @@ def run(plan): local_da = plan.add_service( name="local-da", config=ServiceConfig( - image="ghcr.io/rollkit/local-da:aa37274", + image="ghcr.io/rollkit/local-da:v0.2.1", ports=local_da_ports, public_ports=local_da_ports, ), @@ -53,7 +53,8 @@ def run(plan): gm = plan.add_service( name="gm", config=ServiceConfig( - image="ghcr.io/rollkit/gm:49147e3", + # Using rollkit version v0.13.5 + image="ghcr.io/rollkit/gm:05bd40e", cmd=["/bin/sh", "-c", " ".join(gm_start_cmd)], ports=gm_ports, public_ports=gm_ports, From 07a1e800c4713d11f4520691c13d0016c5ba5aa7 Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:19:00 -0400 Subject: [PATCH 3/6] feat: adds gm frontend to kurtosis package (#110) * feat: expose port for frontend app * feat: pulls gm frontend into kurtosis package for tutorial --- main.star | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/main.star b/main.star index a4e26c2..5344645 100644 --- a/main.star +++ b/main.star @@ -47,8 +47,12 @@ def run(plan): gm_port_spec = PortSpec( number=gm_port_number, transport_protocol="TCP", application_protocol="http" ) + gm_frontend_port_spec = PortSpec( + number=1317, transport_protocol="TCP", application_protocol="http" + ) gm_ports = { "jsonrpc": gm_port_spec, + "frontend": gm_frontend_port_spec, } gm = plan.add_service( name="gm", @@ -73,3 +77,25 @@ def run(plan): ), ), ) + + ############# + # GM Frontend + ############# + plan.print("Adding GM Frontend service") + frontend_port_number = 3000 + frontend_port_spec = PortSpec( + number=frontend_port_number, + transport_protocol="TCP", + application_protocol="http", + ) + frontend_ports = { + "server": frontend_port_spec, + } + frontend = plan.add_service( + name="frontend", + config=ServiceConfig( + image="ghcr.io/rollkit/gm-frontend:v0.2.0", + ports=frontend_ports, + public_ports=frontend_ports, + ), + ) From 34b488b601e5f3baeb08e5a4223d1dfd78b69497 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 03:43:05 -0500 Subject: [PATCH 4/6] build(deps): bump rollkit/.github from 0.4.0 to 0.4.1 (#111) Bumps [rollkit/.github](https://github.com/rollkit/.github) from 0.4.0 to 0.4.1. - [Release notes](https://github.com/rollkit/.github/releases) - [Commits](https://github.com/rollkit/.github/compare/v0.4.0...v0.4.1) --- updated-dependencies: - dependency-name: rollkit/.github dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-build-publish.yml | 2 +- .github/workflows/housekeeping.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index 3a8c773..d70e5ac 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -20,7 +20,7 @@ jobs: permissions: contents: write packages: write - uses: rollkit/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.0 + uses: rollkit/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.1 with: dockerfile: Dockerfile secrets: inherit diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 515a40d..16d3904 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -10,7 +10,7 @@ jobs: issue-management: if: ${{ github.event.issue }} name: Add issues to project and add triage label - uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 secrets: inherit permissions: issues: write @@ -25,7 +25,7 @@ jobs: # ignore dependabot PRs if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} name: Add PRs to project - uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 secrets: inherit permissions: issues: write @@ -37,7 +37,7 @@ jobs: auto-add-reviewer: name: Auto add reviewer to PR if: github.event.pull_request - uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.0 + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 secrets: inherit permissions: issues: write From 54a9ec2717463232d2bfdc5dae21451c038644aa Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:48:43 -0400 Subject: [PATCH 5/6] chore: update to reference external local-da kurtosis package (#112) --- main.star | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/main.star b/main.star index 5344645..124b564 100644 --- a/main.star +++ b/main.star @@ -1,35 +1,18 @@ -# This Kurtosis package spins up a minimal GM rollup that connects to a local DA +# This Kurtosis package spins up a minimal GM rollup that connects to a DA node +# +# NOTE: currently this is only connecting to a local DA node +da_node = import_module("github.com/rollkit/local-da/main.star@v0.3.0") def run(plan): ########## - # local DA + # DA ########## - # TODO: this can be pulled into the local da repo and then imported here - plan.print("Adding Local DA service") - local_da_port_number = 7980 - local_da_port_spec = PortSpec( - number=local_da_port_number, - transport_protocol="TCP", - application_protocol="http", - ) - local_da_ports = { - "jsonrpc": local_da_port_spec, - } - local_da = plan.add_service( - name="local-da", - config=ServiceConfig( - image="ghcr.io/rollkit/local-da:v0.2.1", - ports=local_da_ports, - public_ports=local_da_ports, - ), - ) - # Set the local DA address for the GM service - # TODO: this would be returned by the local DA package - local_da_address = "http://{0}:{1}".format( - local_da.ip_address, local_da.ports["jsonrpc"].number + da_address = da_node.run( + plan, ) + plan.print("connecting to da layer via {0}".format(da_address)) ##### # GM @@ -41,7 +24,7 @@ def run(plan): "rollkit", "start", "--rollkit.aggregator", - "--rollkit.da_address {0}".format(local_da_address), + "--rollkit.da_address {0}".format(da_address), ] gm_port_number = 26657 gm_port_spec = PortSpec( From 8f47e48d2e0b7f21c653a5bb09fe96e20130780e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:51:54 -0400 Subject: [PATCH 6/6] build(deps): bump adambirds/docker-compose-action from 1.3.0 to 1.4.0 (#115) Bumps [adambirds/docker-compose-action](https://github.com/adambirds/docker-compose-action) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/adambirds/docker-compose-action/releases) - [Commits](https://github.com/adambirds/docker-compose-action/compare/v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: adambirds/docker-compose-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd2d5a1..1c2663a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: # need checkout before using docker-compose-action - uses: actions/checkout@v3 - - uses: adambirds/docker-compose-action@v1.3.0 + - uses: adambirds/docker-compose-action@v1.4.0 with: compose-file: "compose.yaml" up-flags: "--build"