cluster

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

README

cluster/ — engineer harness verbs

This subtree holds seictl's engineer-facing harness for harbor workloads — verbs an engineer runs to provision, run, and inspect ephemeral testing workloads on the shared harbor EKS cluster (benchmarks today; stress and integration tests later).

It is intentionally quarantined from the rest of seictl, which is the node-operator's tool (sidecar HTTP server, config/genesis patching, state-sync). The two share a binary and a Go module today, but their audiences, contracts, and lifecycles are different.

Why it lives here (for now)

The shape of the eventual user-facing API — likely a generic CRD wrapping benchmarks / stress tests / integration tests — is still emerging. Until the workload abstraction stabilizes, we hand-roll per verb under cluster/. When the abstraction crystallizes, this directory is the unit that splits out into its own binary (and probably its own module).

Layout intent:

cluster/
  bench.go, context.go, …    # exported cli.Command vars (BenchCmd, ContextCmd)
  *_test.go                   # in-package tests
  internal/                   # importable only from cluster/...
    clioutput/                # JSON envelope contract (the MCP tool surface)
    config/                   # ~/.seictl/config.json
    validate/                 # input policy
    kube/                     # kubeconfig loading
    aws/                      # STS GetCaller, ECR digest resolver
    render/                   # ${VAR} template renderer + YAML splitter
  templates/                  # vendored autobake templates

Rules

  • New cluster-facing verb? Add a top-level *.go here exporting a cli.Command var, register it in ../main.go. Don't put cluster verbs at the repo root.
  • New shared helper used only by cluster verbs? It goes in cluster/internal/<package>/. Go's internal/ rules will keep node-ops code from accidentally depending on it.
  • Need something from node-ops? That's a smell — surface it via a small parent-level package both can import, or copy the function. The whole point of this directory is that future-you can git mv cluster ../seictl-harness without needing to detangle.
  • Don't import github.com/sei-protocol/seictl/internal/... from here. Those packages belong to node-ops and won't move with us.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BenchCmd = cli.Command{
	Name:  "bench",
	Usage: "Manage benchmark workloads on the harbor cluster",
	Commands: []*cli.Command{
		benchDownCmd,
		benchListCmd,
		{
			Name:  "up",
			Usage: "Render or apply a benchmark workload",
			Flags: append(kubeconfigFlags(),
				&cli.StringFlag{Name: "image", Required: true, Usage: "ECR image ref"},
				&cli.StringFlag{Name: "name", Required: true, Usage: "Bench name"},
				&cli.StringFlag{Name: "size", Value: "s", Usage: "s|m|l"},
				&cli.IntFlag{Name: "duration", Value: 30, Usage: "Bench duration in minutes (1-240)"},
				&cli.BoolFlag{Name: "apply", Usage: "Server-side apply the rendered manifests"},
			),
			Action: func(ctx context.Context, command *cli.Command) error {
				return runBenchUp(ctx, benchUpInput{
					Image:      command.String("image"),
					Name:       command.String("name"),
					Size:       command.String("size"),
					Duration:   int(command.Int("duration")),
					Apply:      command.Bool("apply"),
					Kubeconfig: command.String("kubeconfig"),
					Context:    command.String("context"),
				}, os.Stdout, defaultBenchDeps)
			},
		},
	},
}
View Source
var ChainCmd = cli.Command{
	Name:  "chain",
	Usage: "Manage standalone validator chains on the harbor cluster",
	Commands: []*cli.Command{
		chainDownCmd,
		{
			Name:  "up",
			Usage: "Render or apply a validator-only SeiNodeDeployment",
			Flags: append(kubeconfigFlags(),
				&cli.StringFlag{Name: "image", Required: true, Usage: "ECR image ref"},
				&cli.StringFlag{Name: "name", Required: true, Usage: "Chain name"},
				&cli.IntFlag{Name: "validators", Required: true, Usage: "Validator count (1-21)"},
				&cli.BoolFlag{Name: "apply", Usage: "Server-side apply the rendered manifest"},
			),
			Action: func(ctx context.Context, command *cli.Command) error {
				return runChainUpCmd(ctx, chainUpInput{
					Image:      command.String("image"),
					Name:       command.String("name"),
					Validators: int(command.Int("validators")),
					Apply:      command.Bool("apply"),
					Kubeconfig: command.String("kubeconfig"),
					Context:    command.String("context"),
				}, os.Stdout, defaultChainDeps)
			},
		},
	},
}
View Source
var ContextCmd = cli.Command{
	Name:  "context",
	Usage: "Print cluster + config ground truth as a JSON envelope",
	Flags: kubeconfigFlags(),
	Action: func(ctx context.Context, command *cli.Command) error {
		return runContext(ctx, command.String("kubeconfig"), command.String("context"), os.Stdout, defaultContextDeps)
	},
}
View Source
var OnboardCmd = cli.Command{
	Name:  "onboard",
	Usage: "Provision a new engineer's harbor footprint (IAM + namespace cell)",
	Flags: []cli.Flag{
		&cli.StringFlag{Name: "alias", Required: true, Usage: "Engineer alias"},
		&cli.StringFlag{Name: "platform-repo", Usage: "Path to local sei-protocol/platform clone"},
		&cli.BoolFlag{Name: "no-pr", Usage: "Skip PR creation"},
		&cli.BoolFlag{Name: "apply", Usage: "Perform side effects"},
	},
	Action: func(ctx context.Context, command *cli.Command) error {
		return runOnboard(ctx, onboardInput{
			Alias:        command.String("alias"),
			PlatformRepo: command.String("platform-repo"),
			NoPR:         command.Bool("no-pr"),
			Apply:        command.Bool("apply"),
		}, os.Stdout, defaultOnboardDeps)
	},
}
View Source
var RPCCmd = cli.Command{
	Name:  "rpc",
	Usage: "Manage RPC fleets peering with an existing chain",
	Commands: []*cli.Command{
		rpcDownCmd,
		{
			Name:  "up",
			Usage: "Render or apply an RPC fleet against a named chain",
			Flags: append(kubeconfigFlags(),
				&cli.StringFlag{Name: "chain", Required: true, Usage: "Chain ID"},
				&cli.StringFlag{Name: "name", Required: true, Usage: "RPC fleet name"},
				&cli.StringFlag{Name: "image", Required: true, Usage: "ECR image ref"},
				&cli.IntFlag{Name: "replicas", Required: true, Usage: "RPC replica count (1-21)"},
				&cli.BoolFlag{Name: "apply", Usage: "Server-side apply the rendered manifest"},
			),
			Action: func(ctx context.Context, command *cli.Command) error {
				return runRPCUpCmd(ctx, rpcUpInput{
					ChainID:    command.String("chain"),
					Name:       command.String("name"),
					Image:      command.String("image"),
					Replicas:   int(command.Int("replicas")),
					Apply:      command.Bool("apply"),
					Kubeconfig: command.String("kubeconfig"),
					Context:    command.String("context"),
				}, os.Stdout, defaultRPCDeps)
			},
		},
	},
}

Functions

This section is empty.

Types

type AWSResource

type AWSResource struct {
	Kind   string `json:"kind"`
	ARN    string `json:"arn"`
	Action string `json:"action"`
}

AWSResource action ∈ {create, exists, would-create}.

type Endpoints

type Endpoints struct {
	TendermintRpc []string         `json:"tendermintRpc"`
	EvmJsonRpc    []string         `json:"evmJsonRpc,omitempty"`
	PerPod        []PerPodEndpoint `json:"perPod,omitempty"`
}

TendermintRpc/EvmJsonRpc field names mirror downstream env-var contracts (SEI_TENDERMINT_RPC, SEI_EVM_JSON_RPC) — renaming breaks them. PerPod has no env-var contract; consumers needing per-replica dial (e.g., WebSocket, which kube-proxy can't load-balance) read it.

type OnboardResult

type OnboardResult struct {
	Alias      string `json:"alias"`
	Namespace  string `json:"namespace"`
	ConfigPath string `json:"configPath"`
	// Idempotent re-runs omit unchanged files (e.g. an aggregator entry
	// already present in the resources list).
	GeneratedFiles []string      `json:"generatedFiles"`
	Branch         string        `json:"branch,omitempty"`
	PRURL          string        `json:"prUrl,omitempty"`
	AWSResources   []AWSResource `json:"awsResources"`
	DryRun         bool          `json:"dryRun"`
}

type PerPodEndpoint added in v0.0.35

type PerPodEndpoint struct {
	Name       string `json:"name"`
	EvmJsonRpc string `json:"evmJsonRpc"`
	EvmWs      string `json:"evmWs"`
}

PerPodEndpoint addresses one child SeiNode via its headless Service. TendermintRpc is intentionally absent — the controller's PerPodServicePorts exposes only EVM HTTP/WS today (sei-k8s-controller#156). Slice order is by pod ordinal ascending.

Directories

Path Synopsis
internal
aws
Package aws holds AWS-side helpers used by cluster-facing seictl commands.
Package aws holds AWS-side helpers used by cluster-facing seictl commands.
clioutput
Package clioutput defines the JSON output envelope for cluster-facing seictl subcommands and the exit-code / category enums that are part of the public CLI contract.
Package clioutput defines the JSON output envelope for cluster-facing seictl subcommands and the exit-code / category enums that are part of the public CLI contract.
config
Package config manages ~/.seictl/config.json — the per-engineer alias and operating namespace seictl reads on every cluster-facing invocation.
Package config manages ~/.seictl/config.json — the per-engineer alias and operating namespace seictl reads on every cluster-facing invocation.
githubpr
Package githubpr wraps the git + gh CLI invocations seictl onboard uses to land an engineer cell as a PR against the platform repo.
Package githubpr wraps the git + gh CLI invocations seictl onboard uses to land an engineer cell as a PR against the platform repo.
kube
SSA orchestration over k8s.io/cli-runtime/pkg/resource.Builder.
SSA orchestration over k8s.io/cli-runtime/pkg/resource.Builder.
onboardmanifests
Package onboardmanifests generates the engineer cell's Kustomize resources for `seictl onboard`.
Package onboardmanifests generates the engineer cell's Kustomize resources for `seictl onboard`.
onboardmanifests/aggregator
Package aggregator updates the cell-aggregator kustomization at `clusters/harbor/engineers/kustomization.yaml` so that each `seictl onboard --apply` PR is fully self-wired into Flux.
Package aggregator updates the cell-aggregator kustomization at `clusters/harbor/engineers/kustomization.yaml` so that each `seictl onboard --apply` PR is fully self-wired into Flux.
render
Package render handles ${VAR}-style substitution and YAML document splitting for templates rendered by `seictl bench up`.
Package render handles ${VAR}-style substitution and YAML document splitting for templates rendered by `seictl bench up`.
validate
Package validate centralises input validation for cluster-facing seictl commands.
Package validate centralises input validation for cluster-facing seictl commands.
Package templates embeds the autobake-derived YAML/JSON templates rendered by `seictl bench up`.
Package templates embeds the autobake-derived YAML/JSON templates rendered by `seictl bench up`.

Jump to

Keyboard shortcuts

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