docker

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "docker"

Variables

This section is empty.

Functions

func CleanCmds

func CleanCmds(sudo bool, isLinux bool) []string

CleanCmds returns generic docker commands to clean up docker containers and networks. This bypasses the need to a specific docker-compose context.

func Exec

func Exec(ctx context.Context, args ...string) error

Exec runs a Docker command.

func ExecCompose

func ExecCompose(ctx context.Context, dir string, args ...string) error

ExecCompose runs a Docker Compose command for a testnet.

func ExecComposeVerbose

func ExecComposeVerbose(ctx context.Context, dir string, args ...string) error

ExecComposeVerbose runs a Docker Compose command for a testnet and displays its output.

func ExecEVMInit

func ExecEVMInit(ctx context.Context, dir string, evmInitFilename string) error

func GenerateComposeFile

func GenerateComposeFile(def ComposeDef) ([]byte, error)

func GenerateOmniEVMInitFile

func GenerateOmniEVMInitFile(def ComposeDef) ([]byte, error)

func NewInfraData

func NewInfraData(manifest types.Manifest) (types.InfrastructureData, error)

NewInfraData returns a new InfrastructureData for the given manifest. In addition to normal.

func ReplaceUpgradeImage

func ReplaceUpgradeImage(dir, service string) error

ReplaceUpgradeImage replaces the docker image of the provided service with the version specified in comments. Expected format below upgrades node0 from main v1.0 to v2.0:

  services:
	 node0:
	   labels:
	     e2e: true
	   container_name: node0
	   image: omniops/halo:main # Upgrade node0:omniops/halo:v1.0
	   restart: unless-stopped

Types

type ComposeDef

type ComposeDef struct {
	Network        bool
	NetworkName    string
	NetworkCIDR    string
	BindAll        bool
	UpgradeVersion string
	GethVerbosity  int // # Geth log level (1=error,2=warn,3=info(default),4=debug,5=trace)

	Nodes    []*e2e.Node
	OmniEVMs []types.OmniEVM
	Anvils   []types.AnvilChain

	Monitor       bool
	AnvilProxyTag string
	RelayerTag    string
	MonitorTag    string
	Relayer       bool
	Prometheus    bool
}

func SetImageTags

func SetImageTags(def ComposeDef, manifest types.Manifest, omniImgTag string) ComposeDef

SetImageTags returns a new ComposeDef with the image tags set. This is a convenience function to avoid setting the tags manually.

func (ComposeDef) GethTag

func (ComposeDef) GethTag() string

func (ComposeDef) NodeOmniEVMs

func (c ComposeDef) NodeOmniEVMs() map[string]string

NodeOmniEVMs returns a map of node name to OmniEVM instance name; map[node_name]omni_evm.

type Provider

type Provider struct {
	*cmtdocker.Provider
	// contains filtered or unexported fields
}

Provider wraps the cometBFT docker provider, writing a different compose file.

func NewProvider

func NewProvider(testnet types.Testnet, infd types.InfrastructureData, imgTag string) *Provider

NewProvider returns a new Provider.

func (*Provider) Clean

func (*Provider) Clean(ctx context.Context) error

func (*Provider) Restart

func (*Provider) Setup

func (p *Provider) Setup() error

Setup generates the docker-compose file and write it to disk, erroring if any of these operations fail.

func (*Provider) StartNodes

func (p *Provider) StartNodes(ctx context.Context, nodes ...*e2e.Node) error

func (*Provider) Upgrade

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL