Skip to content
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

ci: multichain-testing with go-relayer #10182

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/multichain-e2e-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Multichain E2E Workflow Template

on:
workflow_call:
inputs:
config:
required: true
type: string
relayer-type:
required: true
type: string

jobs:
multichain-e2e:
runs-on: ubuntu-latest-16core

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
path: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-node
with:
node-version: 18.x
path: ./agoric-sdk

- name: yarn link
run: |
yarn link-cli ~/bin/agoric
echo "/home/runner/bin" >> $GITHUB_PATH
working-directory: ./agoric-sdk

- name: Enable Corepack
run: corepack enable
working-directory: ./agoric-sdk/multichain-testing

- name: Install @agoric/multichain-testing deps
run: yarn install
working-directory: ./agoric-sdk/multichain-testing

- name: Lint @agoric/multichain-testing
run: yarn lint
working-directory: ./agoric-sdk/multichain-testing

- name: Setup Starship Infrastructure
id: starship-infra
uses: cosmology-tech/[email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@0xpatrickdev 0xpatrickdev Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I bumped to 0.5.3 here and will see what CI thinks: #10216

It looks the ability to specify a helm chart version may have been lost starting 0.5.4 (the latest is 0.5.7). I filed an cosmology-tech/starship-action#34 asking for clarification.

We can also bump the helm chart version. We're on 0.2.10 but it's up to 0.2.14. I ran into issues with the new readinessProbe - it seem the approach we provided is not working on my local. I filed cosmology-tech/starship#563 to track this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

563 was merged last week. Let's see if we can get an answer on 34 soon enough to incorporate it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with:
# uses ghcr.io/agoric/agoric-sdk:dev image (latest master)
values: ./agoric-sdk/multichain-testing/${{ inputs.config }}
port-forward: true
version: 0.2.10
timeout: 30m
namespace: agoric-multichain-${{ inputs.relayer-type }}

- name: Fund Provision Pool
run: |
kubectl config set-context --current --namespace=agoric-multichain-${{ inputs.relayer-type }}
kubectl get pods
make fund-provision-pool
working-directory: ./agoric-sdk/multichain-testing

- name: Ensure ports are forwarded
run: |
curl --fail --retry 3 --retry-delay 10 http://localhost:26657/status || (echo "agoriclocal node is available")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/agoriclocal || (echo "agoriclocal URL check failed")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/osmosislocal || (echo "osmosislocal URL check failed")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/gaialocal || (echo "gaialocal URL check failed")

- name: Override Chain Registry
run: make override-chain-registry
working-directory: ./agoric-sdk/multichain-testing

- name: Run @agoric/multichain-testing E2E Tests
run: yarn test
working-directory: ./agoric-sdk/multichain-testing
env:
FILE: ${{ inputs.config }}
RELAYER_TYPE: ${{ inputs.relayer-type }}

- name: Capture and print agoric validator logs
if: always()
run: kubectl logs agoriclocal-genesis-0 --container=validator || true
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print agoric-osmosis relayer logs
if: always()
run: kubectl logs ${{ inputs.relayer-type }}-agoric-osmosis-0 --container=relayer || true
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print agoric-cosmos relayer logs
if: always()
run: kubectl logs ${{ inputs.relayer-type }}-agoric-gaia-0 --container=relayer || true
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print osmosis-cosmos relayer logs
if: always()
run: kubectl logs ${{ inputs.relayer-type }}-osmosis-gaia-0 --container=relayer || true
working-directory: ./agoric-sdk/multichain-testing
91 changes: 13 additions & 78 deletions .github/workflows/multichain-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,81 +5,16 @@ on:
workflow_call:

jobs:
multichain-e2e:
runs-on: ubuntu-latest-16core

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
path: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-node
with:
node-version: 18.x
path: ./agoric-sdk

- name: yarn link
run: |
yarn link-cli ~/bin/agoric
echo "/home/runner/bin" >> $GITHUB_PATH
working-directory: ./agoric-sdk

- name: Enable Corepack
run: corepack enable
working-directory: ./agoric-sdk/multichain-testing

- name: Install @agoric/multichain-testing deps
run: yarn install
working-directory: ./agoric-sdk/multichain-testing

- name: Lint @agoric/multichain-testing
run: yarn lint
working-directory: ./agoric-sdk/multichain-testing

- name: Setup Starship Infrastructure
id: starship-infra
uses: cosmology-tech/[email protected]
with:
# uses ghcr.io/agoric/agoric-sdk:dev image (latest master)
values: ./agoric-sdk/multichain-testing/config.yaml
port-forward: true
version: 0.2.10
timeout: 30m
namespace: agoric-multichain

- name: Fund Provision Pool
run: |
kubectl config set-context --current --namespace=agoric-multichain
kubectl get pods
make fund-provision-pool
working-directory: ./agoric-sdk/multichain-testing

- name: Ensure ports are forwarded
run: |
curl --fail --retry 3 --retry-delay 10 http://localhost:26657/status || (echo "agoriclocal node is available")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/agoriclocal || (echo "agoriclocal URL check failed")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/osmosislocal || (echo "osmosislocal URL check failed")
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/gaialocal || (echo "gaialocal URL check failed")

- name: Override Chain Registry
run: make override-chain-registry
working-directory: ./agoric-sdk/multichain-testing

- name: Run @agoric/multichain-testing E2E Tests
run: yarn test
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print agoric validator logs
if: always()
run: kubectl logs agoriclocal-genesis-0 --container=validator || true
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print agoric-osmosis relayer logs
if: always()
run: kubectl logs hermes-agoric-osmosis-0 --container=relayer || true
working-directory: ./agoric-sdk/multichain-testing

- name: Capture and print agoric-cosmos relayer logs
if: always()
run: kubectl logs hermes-agoric-gaia-0 --container=relayer || true
working-directory: ./agoric-sdk/multichain-testing
hermes-test:
name: Multichain E2E (hermes)
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.yaml
relayer-type: hermes

go-relayer-test:
name: Multichain E2E (go-relayer)
uses: ./.github/workflows/multichain-e2e-template.yml
with:
config: config.gorelayer.yaml
relayer-type: go-relayer
3 changes: 1 addition & 2 deletions multichain-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ add-address:
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd keys add user1

fund-provision-pool:
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd tx bank send faucet $(PROVISION_POOL_ADDR) 1000000000uist -y -b block
node_modules/.bin/tsx scripts/fund-provision-pool.ts

override-chain-registry:
node_modules/.bin/tsx scripts/fetch-starship-chain-info.ts && \
Expand Down Expand Up @@ -102,4 +102,3 @@ wait-for-pods:

.PHONY: start
start: install wait-for-pods port-forward fund-provision-pool override-chain-registry

10 changes: 10 additions & 0 deletions multichain-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ kubectl logs hermes-agoric-gaia-0 --container=relayer --follow
kubectl logs hermes-osmosis-gaia-0 --container=relayer --follow
```

## Running with a Different Config File

```sh
# start starship with go-relayer configuration
make start FILE=config.gorelayer.yaml

# run tests with go-relayer configuration
FILE=config.gorelayer.yaml RELAYER_TYPE=go-relayer yarn test
```

## Agoric Smart Wallet

For the steps below, you must import a key to `agd` or create a new one.
Expand Down
116 changes: 116 additions & 0 deletions multichain-testing/config.gorelayer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# mirrors config.yaml, except s/hermes/go-relayer

chains:
- id: agoriclocal
name: agoric
image: ghcr.io/agoric/agoric-sdk:dev
numValidators: 1
env:
- name: DEBUG
value: SwingSet:vat,SwingSet:ls
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
swingset:
params:
bootstrap_vat_config: '@agoric/vm-config/decentral-itest-orchestration-config.json'
scripts:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: true
type: starship
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
faucet: 8082
resources:
cpu: 1
memory: 4Gi
- id: osmosislocal
name: osmosis
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
interchainquery:
host_port: 'icqhost'
params:
host_enabled: true
allow_queries:
- /cosmos.bank.v1beta1.Query/Balance
- /cosmos.bank.v1beta1.Query/AllBalances
faucet:
enabled: true
type: starship
ports:
rest: 1315
rpc: 26655
grpc: 9093
faucet: 8084
resources:
cpu: 1
memory: 1Gi
- id: gaialocal
name: cosmoshub
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
faucet:
enabled: true
type: starship
ports:
rest: 1314
rpc: 26654
grpc: 9092
faucet: 8083
resources:
cpu: 1
memory: 1Gi

relayers:
- name: osmosis-gaia
type: go-relayer
replicas: 1
chains:
- osmosislocal
- gaialocal
- name: agoric-osmosis
type: go-relayer
replicas: 1
chains:
- agoriclocal
- osmosislocal
- name: agoric-gaia
type: go-relayer
replicas: 1
chains:
- agoriclocal
- gaialocal

explorer:
enabled: false

registry:
enabled: true
ports:
rest: 8081
4 changes: 3 additions & 1 deletion multichain-testing/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ chains:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: false
enabled: true
type: starship
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
faucet: 8082
resources:
cpu: 1
memory: 4Gi
Expand Down
2 changes: 1 addition & 1 deletion multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@agoric/cosmic-proto": "0.4.1-dev-08f8549.0",
"@agoric/cosmic-proto": "0.4.1-dev-5b3e4d0.0",
turadg marked this conversation as resolved.
Show resolved Hide resolved
"@cosmjs/crypto": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
Expand Down
Loading
Loading