Skip to content

Commit

Permalink
chore(e2e/types): remove unused pinned manifest tags (#2595)
Browse files Browse the repository at this point in the history
Remove unused manifest `Pinned*` fields.

issue: none
  • Loading branch information
corverroos authored Dec 3, 2024
1 parent e6efac7 commit e7e4fe7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 56 deletions.
5 changes: 0 additions & 5 deletions e2e/app/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ func adaptNode(ctx context.Context, manifest types.Manifest, node *e2e.Node, tag
return nil, err
}

// Pinned tag overrides the cli --omni-image-tag flag.
if manifest.PinnedHaloTag != "" {
tag = manifest.PinnedHaloTag
}

// Override default comet version with our own, see github.com/cometbft/[email protected]/test/e2e/pkg/testnet.go:36
const cometLocalVersion = "cometbft/e2e-node:local-version"
if node.Version == cometLocalVersion {
Expand Down
29 changes: 4 additions & 25 deletions e2e/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ func (p *Provider) Setup() error {
Solver: true,
GethVerbosity: 3, // Info
GethInitTags: gethInitTags,
AnvilProxyTag: p.omniTag,
MonitorTag: p.omniTag,
RelayerTag: p.omniTag,
SolverTag: p.omniTag,
}
def = SetImageTags(def, p.testnet.Manifest, p.omniTag)

bz, err := GenerateComposeFile(def)
if err != nil {
Expand Down Expand Up @@ -237,30 +240,6 @@ func (c ComposeDef) NodeOmniEVMs() map[string]string {
return resp
}

// SetImageTags returns a new ComposeDef with the image tags set.
// This is a convenience function to avoid setting the tags manually.
func SetImageTags(def ComposeDef, manifest types.Manifest, omniImgTag string) ComposeDef {
anvilProxyTag := omniImgTag

// TODO(corver): Remove pinned tags since they are not used.
monitorTag := omniImgTag
if manifest.PinnedMonitorTag != "" {
monitorTag = manifest.PinnedMonitorTag
}

relayerTag := omniImgTag
if manifest.PinnedRelayerTag != "" {
relayerTag = manifest.PinnedRelayerTag
}

def.AnvilProxyTag = anvilProxyTag
def.MonitorTag = monitorTag
def.RelayerTag = relayerTag
def.SolverTag = omniImgTag

return def
}

func GenerateComposeFile(def ComposeDef) ([]byte, error) {
tmpl, err := template.New("compose").Parse(string(composeTmpl))
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions e2e/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ func TestComposeTemplate(t *testing.T) {
const evm0 = "omni_evm_0"
dir := t.TempDir()
testnet := types.Testnet{
Manifest: types.Manifest{
PinnedRelayerTag: "v2",
PinnedMonitorTag: "v3",
},
Testnet: &e2e.Testnet{
Name: "test",
IP: ipNet,
Expand Down
4 changes: 2 additions & 2 deletions e2e/docker/testdata/TestComposeTemplate_commit.golden
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ services:
labels:
e2e: true
container_name: relayer
image: omniops/relayer:v2
image: omniops/relayer:7d1ae53
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand All @@ -131,7 +131,7 @@ services:
labels:
e2e: true
container_name: monitor
image: omniops/monitor:v3
image: omniops/monitor:7d1ae53
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ services:
labels:
e2e: true
container_name: relayer
image: omniops/relayer:v2
image: omniops/relayer:main
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand All @@ -131,7 +131,7 @@ services:
labels:
e2e: true
container_name: monitor
image: omniops/monitor:v3
image: omniops/monitor:main
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ services:
labels:
e2e: true
container_name: relayer
image: omniops/relayer:v2
image: omniops/relayer:main
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand All @@ -131,7 +131,7 @@ services:
labels:
e2e: true
container_name: monitor
image: omniops/monitor:v3
image: omniops/monitor:main
restart: unless-stopped
ports:
- 26660 # Prometheus and pprof
Expand Down
15 changes: 0 additions & 15 deletions e2e/types/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,6 @@ type Manifest struct {
// Perturb defines additional (non-cometBFT) perturbations by service name.
Perturb map[string][]Perturb `json:"perturb"`

// PinnedHaloTag defines the pinned halo docker image tag.
// This allows source code defined versions for protected networks.
// This overrides the --omni-image-tag if non-empty.
PinnedHaloTag string `toml:"pinned_halo_tag"`

// PinnedMonitorTag defines the pinned monitor docker image tag.
// This allows source code defined versions for protected networks.
// This overrides the --omni-image-tag if non-empty.
PinnedMonitorTag string `toml:"pinned_monitor_tag"`

// PinnedRelayerTag defines the pinned relayer docker image tag.
// This allows source code defined versions for protected networks.
// This overrides the --omni-image-tag if non-empty.
PinnedRelayerTag string `toml:"pinned_relayer_tag"`

// NetworkUpgradeHeight defines the network upgrade height, default is genesis, negative is disabled.
// Note that it might be scheduled at a later height.
NetworkUpgradeHeight int64 `toml:"network_upgrade_height"`
Expand Down
5 changes: 4 additions & 1 deletion e2e/vmcompose/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ func (p *Provider) Setup() error {
Solver: services["solver"],
Prometheus: p.Testnet.Prometheus,
GethVerbosity: gethVerbosity,
AnvilProxyTag: p.omniTag,
MonitorTag: p.omniTag,
RelayerTag: p.omniTag,
SolverTag: p.omniTag,
}
def = docker.SetImageTags(def, p.Testnet.Manifest, p.omniTag)

compose, err := docker.GenerateComposeFile(def)
if err != nil {
Expand Down

0 comments on commit e7e4fe7

Please sign in to comment.