runner

package
v1.0.0-rc.18 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runner runs sessions as the host of a registered Beekeeper runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deregister

func Deregister(ctx context.Context, cfg Config, name string) error

Deregister deregisters a runner of the configuration's organization with the configuration's credential.

func ReadCredential

func ReadCredential(path string) (string, error)

ReadCredential reads a single host-owned credential file.

func Register

Register registers a runner, or updates the registered one, with the configuration's credential: normally its login, the host.

func Run

func Run(ctx context.Context, cfg Config, exec executor.Executor, log *slog.Logger) error

Run holds one stream until ctx ends. Sessions belong to the process and keep reporting across stream reconnects and coordinator handoffs. A runner with an offer registers it first, and again after a refusal with not_registered.

Types

type Config

type Config struct {
	ServerURL string `json:"serverURL"`
	// Organization and Name are the registered runner this process is.
	Organization string `json:"organization"`
	Name         string `json:"name"`
	// TokenFile holds the runner's bearer for Beekeeper, read on every
	// request: a projected ServiceAccount token for a cluster runner, or
	// the host's own ID token. A runner has a TokenFile or a Login.
	TokenFile string `json:"tokenFile,omitempty"`
	// Login logs the host in, so the runner's bearer is the host's ID token.
	Login *login.Config `json:"login,omitempty"`
	// Offer is the runner's offer, which it registers when it starts.
	Offer          *Offer            `json:"offer,omitempty"`
	ReadingsFile   string            `json:"readingsFile"`
	ExecutorConfig json.RawMessage   `json:"executorConfig,omitempty"`
	ContextFiles   map[string]string `json:"contextFiles,omitempty"`
	Git            Git               `json:"git,omitempty"`
	// contains filtered or unexported fields
}

Config names the coordinator, the registered runner and files owned by this runner's host.

func Load

func Load(path string) (Config, error)

func (Config) Registration

func (c Config) Registration() api.RegisterRequest

Registration is the runner's own registration: its organization, name and offer.

func (Config) ResolveContext

func (c Config) ResolveContext(_ context.Context, ref string) (json.RawMessage, error)

ResolveContext reads only a bundle explicitly mapped by the host.

type Git

type Git struct {
	// Access is none (the default), read or write.
	Access executor.GitAccess `json:"access,omitempty"`
}

Git bounds the host's git power in this runner's sessions.

type Offer

type Offer struct {
	Kind         v1alpha1.RunnerKind     `json:"kind,omitempty"`
	Slots        int32                   `json:"slots"`
	Focus        string                  `json:"focus,omitempty"`
	Purposes     []string                `json:"purposes,omitempty"`
	Harnesses    []api.Harness           `json:"harnesses,omitempty"`
	Capabilities []string                `json:"capabilities,omitempty"`
	Limits       v1alpha1.PressureLimits `json:"limits,omitempty"`
}

Offer is what a runner offers: a registration without its organization, name and ServiceAccount (api.RegisterRequest).

type Readings

type Readings struct {
	Pressure *v1alpha1.Pressure `json:"pressure"`
	Usage    []api.UsageReport  `json:"usage,omitempty"`
}

Readings is the latest snapshot published by the host's pressure and subscription sources. Replacing it wakes an otherwise idle runner.

Directories

Path Synopsis
Package login logs a runner's host in at their OIDC issuer and keeps the login.
Package login logs a runner's host in at their OIDC issuer and keeps the login.
logintest
Package logintest is an OIDC issuer for tests of a runner host's login: discovery, the authorization endpoint with PKCE, and a token endpoint that rotates refresh tokens and refuses a spent one.
Package logintest is an OIDC issuer for tests of a runner host's login: discovery, the authorization endpoint with PKCE, and a token endpoint that rotates refresh tokens and refuses a spent one.

Jump to

Keyboard shortcuts

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