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

Configure list of relayers instead of single one #4737

Merged
2 changes: 1 addition & 1 deletion .github/workflows/e2e-compatibility-workflow-call.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
CHAIN_A_TAG: '${{ matrix.chain-a }}'
CHAIN_B_TAG: '${{ matrix.chain-b }}'
CHAIN_BINARY: 'simd'
RELAYER_TYPE: '${{ matrix.relayer-type }}'
RELAYER_ID: '${{ matrix.relayer-type }}'
- name: Upload Diagnostics
uses: actions/upload-artifact@v3
# we only want to upload logs on test failures.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
CHAIN_B_TAG: '${{ inputs.chain-b-tag }}'
RELAYER_IMAGE: '${{ inputs.relayer-image }}'
RELAYER_TAG: '${{ inputs.relayer-tag }}'
RELAYER_TYPE: '${{ inputs.relayer-type }}'
RELAYER_ID: '${{ inputs.relayer-type }}'
CHAIN_BINARY: '${{ inputs.chain-binary }}'
CHAIN_UPGRADE_TAG: '${{ inputs.chain-upgrade-tag }}'
CHAIN_UPGRADE_PLAN: '${{ inputs.upgrade-plan-name }}'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
upgrade-v5-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -27,7 +27,7 @@ jobs:
relayer-type: hermes

upgrade-v7-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -41,7 +41,7 @@ jobs:
relayer-type: hermes

upgrade-v7_1-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -55,7 +55,7 @@ jobs:
relayer-type: hermes

upgrade-v8-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -69,7 +69,7 @@ jobs:
relayer-type: hermes

upgrade-v5-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -85,7 +85,7 @@ jobs:
relayer-tag: latest

upgrade-v7-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -101,7 +101,7 @@ jobs:
relayer-tag: latest

upgrade-v7_1-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand All @@ -117,7 +117,7 @@ jobs:
relayer-tag: latest

upgrade-v8-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
uses: .github/workflows/e2e-test-workflow-call.yml
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
Expand Down
2 changes: 1 addition & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ options specified in your config file.
| CHAIN_B_TAG | The tag used for chain A | latest |
| CHAIN_BINARY | The binary used in the container | simd |
| RELAYER_TAG | The tag used for the relayer | main |
| RELAYER_TYPE | The type of relayer to use (rly/hermes) | rly |
| RELAYER_ID | The type of relayer to use (rly/hermes) | rly |
chatton marked this conversation as resolved.
Show resolved Hide resolved

> Note: when running tests locally, **no images are pushed** to the `ghcr.io/cosmos/ibc-go-simd` registry.
The images which are used only exist on your machine.
Expand Down
16 changes: 4 additions & 12 deletions e2e/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ const (
type Config struct {
// Tag is the tag used for the relayer image.
Tag string `yaml:"tag"`
// Type specifies the type of relayer that this is.
Type string `yaml:"type"`
// ID specifies the type of relayer that this is.
ID string `yaml:"id"`
// Image is the image that should be used for the relayer.
Image string `yaml:"image"`
}

// New returns an implementation of ibc.Relayer depending on the provided RelayerType.
func New(t *testing.T, cfg Config, logger *zap.Logger, dockerClient *dockerclient.Client, network string) ibc.Relayer {
t.Helper()
switch cfg.Type {
switch cfg.ID {
case Rly:
return newCosmosRelayer(t, cfg.Tag, logger, dockerClient, network, cfg.Image)
case Hermes:
return newHermesRelayer(t, cfg.Tag, logger, dockerClient, network, cfg.Image)
default:
panic(fmt.Sprintf("unknown relayer specified: %s", cfg.Type))
panic(fmt.Sprintf("unknown relayer specified: %s", cfg.ID))
}
}

Expand All @@ -49,10 +49,6 @@ func New(t *testing.T, cfg Config, logger *zap.Logger, dockerClient *dockerclien
func newCosmosRelayer(t *testing.T, tag string, logger *zap.Logger, dockerClient *dockerclient.Client, network, relayerImage string) ibc.Relayer {
t.Helper()

if relayerImage == "" {
relayerImage = RlyRelayerRepository
}

customImageOption := relayer.CustomDockerImage(relayerImage, tag, rlyRelayerUser)
relayerProcessingOption := relayer.StartupFlags("-p", "events") // relayer processes via events

Expand All @@ -67,10 +63,6 @@ func newCosmosRelayer(t *testing.T, tag string, logger *zap.Logger, dockerClient
func newHermesRelayer(t *testing.T, tag string, logger *zap.Logger, dockerClient *dockerclient.Client, network, relayerImage string) ibc.Relayer {
t.Helper()

if relayerImage == "" {
relayerImage = HermesRelayerRepository
}

customImageOption := relayer.CustomDockerImage(relayerImage, tag, hermesRelayerUser)
relayerFactory := interchaintest.NewBuiltinRelayerFactory(ibc.Hermes, logger, customImageOption)

Expand Down
12 changes: 8 additions & 4 deletions e2e/sample.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ chains:
tag: main # override with CHAIN_B_TAG
binary: simd # override with CHAIN_BINARY

relayer:
type: hermes # override with RELAYER_TYPE
image: ghcr.io/informalsystems/hermes # override with RELAYER_IMAGE
tag: "bef2f53" # override with RELAYER_TAG
activeRelayer: hermes # override with RELAYER_ID
relayers:
- id: hermes
image: ghcr.io/informalsystems/hermes
tag: "bef2f53"
- id: rly
image: ghcr.io/cosmos/relayer
tag: "latest"

cometbft:
logLevel: info
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() {
// this restart is a temporary workaround to a limitation in hermes requiring a restart
// in some cases after an upgrade.
tc := testsuite.LoadConfig()
if tc.RelayerConfig.Type == e2erelayer.Hermes {
if tc.GetActiveRelayerConfig().ID == e2erelayer.Hermes {
s.RestartRelayer(ctx, relayer)
}

Expand Down
Loading
Loading