Documentation
¶
Index ¶
- Constants
- Variables
- func Init(ctx context.Context, name string, pool bass.RuntimePool, config *bass.Scope) (bass.Runtime, error)
- func NewBuilder(client gwclient.Client, platform ocispecs.Platform, ...) *buildkitBuilder
- func NewBuildkit(ctx context.Context, _ bass.RuntimePool, cfg *bass.Scope) (bass.Runtime, error)
- func NewClient(ctx context.Context, _ bass.RuntimePool, cfg *bass.Scope) (bass.Runtime, error)
- func NewDagger(ctx context.Context, _ bass.RuntimePool, cfg *bass.Scope) (bass.Runtime, error)
- func RegisterRuntime(name string, init InitFunc)
- func Suite(t *testing.T, runtimeConfig bass.RuntimeConfig, opts ...SuiteOpt)
- type AnyDirSource
- type Assoc
- type Buildkit
- func (buildkit *Buildkit) Client() (*bkclient.Client, error)
- func (runtime *Buildkit) Close() error
- func (runtime *Buildkit) Export(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Buildkit) ExportPath(ctx context.Context, w io.Writer, tp bass.ThunkPath) error
- func (runtime *Buildkit) NewBuilder(ctx context.Context, client gwclient.Client) *buildkitBuilder
- func (runtime *Buildkit) Prune(ctx context.Context, opts bass.PruneOpts) error
- func (runtime *Buildkit) Publish(ctx context.Context, ref bass.ImageRef, thunk bass.Thunk) (bass.ImageRef, error)
- func (runtime *Buildkit) Read(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Buildkit) Resolve(ctx context.Context, imageRef bass.ImageRef) (bass.Thunk, error)
- func (runtime *Buildkit) Run(ctx context.Context, thunk bass.Thunk) error
- func (runtime *Buildkit) Start(ctx context.Context, thunk bass.Thunk) (StartResult, error)
- func (runtime *Buildkit) WithGateway(ctx context.Context, ...) error
- type BuildkitConfig
- type Client
- func (client *Client) Close() error
- func (client *Client) Export(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (client *Client) ExportPath(ctx context.Context, w io.Writer, tp bass.ThunkPath) error
- func (client *Client) Prune(context.Context, bass.PruneOpts) error
- func (client *Client) Publish(ctx context.Context, ref bass.ImageRef, thunk bass.Thunk) (bass.ImageRef, error)
- func (client *Client) Read(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (client *Client) Resolve(ctx context.Context, ref bass.ImageRef) (bass.Thunk, error)
- func (client *Client) Run(ctx context.Context, thunk bass.Thunk) error
- type ClientConfig
- type Command
- type CommandHost
- type CommandMount
- type CommandSecretEnv
- type Dagger
- func (runtime *Dagger) Close() error
- func (runtime *Dagger) Export(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Dagger) ExportPath(ctx context.Context, w io.Writer, tp bass.ThunkPath) error
- func (runtime *Dagger) Prune(ctx context.Context, opts bass.PruneOpts) error
- func (runtime *Dagger) Publish(ctx context.Context, ref bass.ImageRef, thunk bass.Thunk) (bass.ImageRef, error)
- func (runtime *Dagger) Read(ctx context.Context, w io.Writer, thunk bass.Thunk) error
- func (runtime *Dagger) Resolve(ctx context.Context, imageRef bass.ImageRef) (bass.Thunk, error)
- func (runtime *Dagger) Run(ctx context.Context, thunk bass.Thunk) error
- func (runtime *Dagger) Start(ctx context.Context, thunk bass.Thunk) (StartResult, error)
- type DaggerConfig
- type InitFunc
- type IntermediateBuild
- func (ib IntermediateBuild) ExportFile(ctx context.Context, gw gwclient.Client, tw *tar.Writer, fsp bass.FilePath) (*gwclient.Result, error)
- func (ib IntermediateBuild) ForExportDir(ctx context.Context, gw gwclient.Client, fsp bass.DirPath) (*gwclient.Result, error)
- func (ib IntermediateBuild) ForPublish(ctx context.Context, gw gwclient.Client) (*gwclient.Result, error)
- func (ib IntermediateBuild) ForRun(ctx context.Context, gw gwclient.Client) (*gwclient.Result, error)
- func (ib IntermediateBuild) ReadStdout(ctx context.Context, gw gwclient.Client, w io.Writer) (*gwclient.Result, error)
- func (ib IntermediateBuild) WithImageConfig(config []byte) (IntermediateBuild, error)
- type NoRuntimeError
- type Pool
- type PortInfos
- type SSHClient
- type Server
- func (srv *Server) Export(p *proto.Thunk, exportSrv proto.Runtime_ExportServer) error
- func (srv *Server) ExportPath(p *proto.ThunkPath, exportSrv proto.Runtime_ExportPathServer) error
- func (srv *Server) Publish(p *proto.PublishRequest, pubSrv proto.Runtime_PublishServer) error
- func (srv *Server) Read(p *proto.Thunk, readSrv proto.Runtime_ReadServer) error
- func (srv *Server) Resolve(ctx context.Context, p *proto.ImageRef) (*proto.Thunk, error)
- func (srv *Server) Run(p *proto.Thunk, runSrv proto.Runtime_RunServer) error
- type StartResult
- type Starter
- type SuiteConfig
- type SuiteOpt
- type SuiteTest
- type UnknownRuntimeError
Constants ¶
const BuildkitName = "buildkit"
const DaggerName = "dagger"
const DefaultBuildkitInstallation = "bass-buildkitd"
const GRPCName = "grpc"
const RuntimeServiceName = "runtime"
RuntimeServiceName is the name given to the forwarded Unix socket that forwards the runtime GRPC service.
Variables ¶
var ErrKeepaliveTimeout = errors.New("client->server keepalive ping timed out")
ErrKeepaliveTimeout is returned when the keepalive loop tries to send a keepalive request but takes too long, indicating a stuck/dead connection.
Functions ¶
func Init ¶
func Init(ctx context.Context, name string, pool bass.RuntimePool, config *bass.Scope) (bass.Runtime, error)
Init initializes the runtime registered under the given name.
func NewBuilder ¶ added in v0.12.0
func NewBuildkit ¶
func RegisterRuntime ¶
Register installs a runtime under a given name.
It should be called in a runtime's init() function with the runtime's constructor.
Types ¶
type AnyDirSource ¶ added in v0.12.0
type AnyDirSource struct{}
type Buildkit ¶
type Buildkit struct { Config BuildkitConfig Platform ocispecs.Platform Inputs map[string]llb.State // contains filtered or unexported fields }
func NewBuildkitFrontend ¶ added in v0.12.0
func (*Buildkit) ExportPath ¶
func (*Buildkit) NewBuilder ¶ added in v0.12.0
type BuildkitConfig ¶
type BuildkitConfig struct { Oneshot bool `json:"oneshot,omitempty"` Debug bool `json:"debug,omitempty"` Addr string `json:"addr,omitempty"` Installation string `json:"installation,omitempty"` DisableCache bool `json:"disable_cache,omitempty"` CertsDir string `json:"certs_dir,omitempty"` OCIStoreDir string `json:"oci_store_dir,omitempty"` }
type Client ¶ added in v0.6.0
type Client struct { Conn *grpc.ClientConn proto.RuntimeClient }
func (*Client) ExportPath ¶ added in v0.6.0
type ClientConfig ¶ added in v0.12.0
type ClientConfig struct {
Target string `json:"target"`
}
type Command ¶
type Command struct { Args []string `json:"args"` Stdin []byte `json:"stdin"` Env []string `json:"env"` Dir *string `json:"dir"` // these don't need to be marshaled, since they're part of the container // setup and not passed to the shim Mounts []CommandMount `json:"-"` Services []bass.Thunk `json:"-"` SecretEnv []CommandSecretEnv `json:"-"` // contains filtered or unexported fields }
Command is a helper type constructed by a runtime by Resolving a Thunk.
It contains the direct values to be provided for the process running in the container.
func NewCommand ¶
Resolve traverses the Thunk, resolving logical path values to their concrete paths in the container, and collecting the requisite mount points along the way.
type CommandHost ¶ added in v0.10.0
type CommandMount ¶
type CommandMount struct { Source bass.ThunkMountSource Target string }
CommandMount configures a thunk path to mount to the command's container.
type CommandSecretEnv ¶ added in v0.12.0
type Dagger ¶ added in v0.11.0
func (*Dagger) ExportPath ¶ added in v0.11.0
type DaggerConfig ¶ added in v0.11.0
type DaggerConfig struct {
Host string `json:"host,omitempty"`
}
type IntermediateBuild ¶ added in v0.12.0
type IntermediateBuild struct { FS llb.State Exec llb.ExecState Output llb.State OutputSourcePath string NeedsInsecure bool Platform ocispecs.Platform Config ocispecs.ImageConfig }
func (IntermediateBuild) ExportFile ¶ added in v0.12.0
func (IntermediateBuild) ForExportDir ¶ added in v0.12.0
func (IntermediateBuild) ForPublish ¶ added in v0.12.0
func (IntermediateBuild) ReadStdout ¶ added in v0.12.0
func (IntermediateBuild) WithImageConfig ¶ added in v0.12.0
func (ib IntermediateBuild) WithImageConfig(config []byte) (IntermediateBuild, error)
type NoRuntimeError ¶
NoRuntimeError is returned when a platform has no runtime associated to it.
func (NoRuntimeError) Error ¶
func (err NoRuntimeError) Error() string
type Pool ¶
type Pool struct {
Runtimes []Assoc
}
Pool is the full set of platform <-> runtime pairs configured by the user.
type SSHClient ¶ added in v0.6.0
type SSHClient struct { Hosts []string User string Config *ssh.ClientConfig // contains filtered or unexported fields }
SSHClient is a client for forwarding runtimes through a SSH gateway.
func (*SSHClient) Dial ¶ added in v0.8.0
Dial establishes a connection to the remote SSH server and starts a keepalive loop monitoring the connection's health.
type Server ¶ added in v0.6.0
type Server struct { Context context.Context Runtime bass.Runtime proto.UnimplementedRuntimeServer }
func (*Server) ExportPath ¶ added in v0.6.0
func (*Server) Publish ¶ added in v0.12.0
func (srv *Server) Publish(p *proto.PublishRequest, pubSrv proto.Runtime_PublishServer) error
type StartResult ¶ added in v0.10.0
type StartResult struct { // A mapping from each port to its address info (host, port, etc.) Ports PortInfos }
type SuiteConfig ¶ added in v0.12.0
type SuiteConfig struct {
Skip map[string]struct{}
}
func (SuiteConfig) ShouldSkip ¶ added in v0.12.0
func (cfg SuiteConfig) ShouldSkip(suite string) bool
type SuiteOpt ¶ added in v0.12.0
type SuiteOpt func(*SuiteConfig)
func SkipSuites ¶ added in v0.12.0
type SuiteTest ¶ added in v0.11.0
type UnknownRuntimeError ¶
type UnknownRuntimeError struct {
Name string
}
UnknownRuntimeError is returned when an unknown runtime is configured.
func (UnknownRuntimeError) Error ¶
func (err UnknownRuntimeError) Error() string