cluster

package
v0.0.536 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 157 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Prefix is the common prefix of nerdctl labels
	Prefix = "nerdctl/"

	// Namespace is the containerd namespace such as "default", "k8s.io"
	Namespace = Prefix + "namespace"

	// Name is a human-friendly name.
	// WARNING: multiple containers may have same the name label
	Name = Prefix + "name"

	// DEPRECATED : https://github.com/containerd/nerdctl/pull/4290
	// Ports is a JSON-marshalled string of []cni.PortMapping.
	Ports = Prefix + "ports"

	// Platform is the normalized platform string like "linux/ppc64le".
	Platform = Prefix + "platform"
)

Copied from https://github.com/containerd/nerdctl/blob/main/pkg/labels/labels.go

View Source
const (
	SSH   gitScheme = "ssh"
	HTTPS gitScheme = "https"
)
View Source
const (
	BazelCredHelperBinary = "bazel-credential-nsc"
)
View Source
const (
	BuildkitProxyPath = "buildkit/" + proxyDir
)

Variables

View Source
var ErrBuildxNodeGroupNotFound = errors.New("buildx node group not found")
View Source
var ErrEmptyClusterList = errors.New("no instances")
View Source
var ErrIsNotRemoteDriver = errors.New("buildx node group does not have 'remote' driver")

Functions

func CreateGrpcClientConn added in v0.0.409

func CreateGrpcClientConn(bc BuilderConfig) (*grpc.ClientConn, error)

func DeleteSessionClientCert added in v0.0.430

func DeleteSessionClientCert() error

func DetermineStateDir added in v0.0.406

func DetermineStateDir(specified string, subdirIfDefault string) (string, error)

Determines the directory to store state in. If "specified" is non-empty, it will be used - for historical reasons, the ${specified}/proxy directory will be returned. If "specified" is empty, a directory that ends with ${subdirIfDefault} will be returned.

func DumpListWorkers added in v0.0.415

func DumpListWorkers(ctx context.Context, bc BuilderConfig) (*controlapi.ListWorkersResponse, error)

func InlineSsh added in v0.0.291

func InlineSsh(ctx context.Context, cluster *api.KubernetesCluster, opts InlineSshOpts, args []string) error

func MakeWireBuilder added in v0.0.426

func MakeWireBuilder(useServerSideProxy bool, experimental string, waitUntilReady bool) func(context.Context, specs.Platform) (*client.Client, error)

func NewArtifactCmd added in v0.0.401

func NewArtifactCmd() *cobra.Command

func NewBareClusterCmd added in v0.0.204

func NewBareClusterCmd(use string, hidden bool) *cobra.Command

Used by `nsc` (and as the basis to `ns cluster`)

func NewBazelCacheCmd added in v0.0.481

func NewBazelCacheCmd() *cobra.Command

NewBazelCacheCmd returns a "bazel" command with setup directly underneath, for use under "nsc cache bazel setup".

func NewBazelCmd added in v0.0.385

func NewBazelCmd() *cobra.Command

func NewBazelCredHelperGetCmd added in v0.0.392

func NewBazelCredHelperGetCmd() *cobra.Command

func NewBuildCmd added in v0.0.178

func NewBuildCmd() *cobra.Command

func NewBuildkitCmd added in v0.0.204

func NewBuildkitCmd() *cobra.Command

func NewClusterCmd

func NewClusterCmd(hidden bool) *cobra.Command

Used as `ns cluster`

func NewCreateCmd added in v0.0.203

func NewCreateCmd() *cobra.Command

func NewDescribeCmd added in v0.0.230

func NewDescribeCmd() *cobra.Command

func NewDestroyCmd added in v0.0.350

func NewDestroyCmd() *cobra.Command

func NewDockerCmd added in v0.0.222

func NewDockerCmd() *cobra.Command

func NewDockerCredHelperEraseCmd added in v0.0.212

func NewDockerCredHelperEraseCmd(hidden bool) *cobra.Command

func NewDockerCredHelperGetCmd added in v0.0.212

func NewDockerCredHelperGetCmd(hidden bool) *cobra.Command

func NewDockerCredHelperListCmd added in v0.0.212

func NewDockerCredHelperListCmd(hidden bool) *cobra.Command

func NewDockerCredHelperStoreCmd added in v0.0.212

func NewDockerCredHelperStoreCmd(hidden bool) *cobra.Command

func NewEgressCmd added in v0.0.535

func NewEgressCmd() *cobra.Command

func NewExecScoped added in v0.0.231

func NewExecScoped() *cobra.Command

func NewExposeCmd added in v0.0.203

func NewExposeCmd() *cobra.Command

func NewExtendDurationCmd added in v0.0.387

func NewExtendDurationCmd(name string) *cobra.Command

func NewGenerateReportCmd added in v0.0.508

func NewGenerateReportCmd() *cobra.Command

func NewGitCheckoutCmd added in v0.0.380

func NewGitCheckoutCmd() *cobra.Command

func NewGradleCacheCmd added in v0.0.481

func NewGradleCacheCmd() *cobra.Command

NewGradleCacheCmd returns a "gradle" command with setup/create-token directly underneath, for use under "nsc cache gradle {setup|create-token}".

func NewGradleCmd added in v0.0.459

func NewGradleCmd() *cobra.Command

func NewIngressCmd added in v0.0.271

func NewIngressCmd() *cobra.Command

func NewInstanceDownloadCmd added in v0.0.476

func NewInstanceDownloadCmd() *cobra.Command

func NewInstanceUploadCmd added in v0.0.476

func NewInstanceUploadCmd() *cobra.Command

func NewKubeconfigCmd added in v0.0.209

func NewKubeconfigCmd() *cobra.Command

func NewKubectlCmd added in v0.0.161

func NewKubectlCmd() *cobra.Command

func NewListCmd added in v0.0.203

func NewListCmd() *cobra.Command

func NewLogsCmd added in v0.0.203

func NewLogsCmd() *cobra.Command

func NewMetadataCmd added in v0.0.203

func NewMetadataCmd() *cobra.Command

func NewPantsCacheCmd added in v0.0.481

func NewPantsCacheCmd() *cobra.Command

NewPantsCacheCmd returns a "pants" command with setup directly underneath, for use under "nsc cache pants setup".

func NewPantsCmd added in v0.0.400

func NewPantsCmd() *cobra.Command

func NewProxyCmd added in v0.0.185

func NewProxyCmd() *cobra.Command

func NewRdpCmd added in v0.0.420

func NewRdpCmd() *cobra.Command

func NewRegistryCmd added in v0.0.441

func NewRegistryCmd() *cobra.Command

func NewRunCmd added in v0.0.203

func NewRunCmd() *cobra.Command

func NewSccacheCmd added in v0.0.481

func NewSccacheCmd() *cobra.Command

func NewSshCmd added in v0.0.203

func NewSshCmd() *cobra.Command

func NewTopCmd added in v0.0.289

func NewTopCmd() *cobra.Command

func NewVncCmd added in v0.0.329

func NewVncCmd() *cobra.Command

func NewVolumeCmd added in v0.0.299

func NewVolumeCmd() *cobra.Command

func ParseImageSelectors added in v0.0.533

func ParseImageSelectors(selectors []string) ([]*api.LabelEntry, error)

func ParseMachineType added in v0.0.445

func ParseMachineType(machineType string) (vcpu int32, memoryMB int32, err error)

ParseMachineType parses a machine type string in the format "CPUxMemoryGB" (e.g., "4x8") and returns the vCPU count and memory in megabytes. This function is used for converting the shorthand format into structured data.

func ParseVolumeFlag added in v0.0.429

func ParseVolumeFlag(def string) (api.VolumeSpec, error)

func PrintCreateClusterMsg added in v0.0.291

func PrintCreateClusterMsg(ctx context.Context)

func PrintCreateContainersResult added in v0.0.291

func PrintCreateContainersResult(ctx context.Context, output string, resp *CreateContainerResult) error

func RefreshSessionClientCert added in v0.0.395

func RefreshSessionClientCert(ctx context.Context) (bool, error)

func SelectRunningCluster added in v0.0.291

func SelectRunningCluster(ctx context.Context, args []string) (*api.KubernetesCluster, []string, error)

func StartBuilds added in v0.0.416

func StartBuilds(ctx context.Context, fragments []BuildFragment, makeClient func(context.Context, specs.Platform) (*client.Client, error)) ([]*client.SolveResponse, error)

func TestServerSideBuildxProxyConnectivity added in v0.0.409

func TestServerSideBuildxProxyConnectivity(ctx context.Context, bc BuilderConfig) (bool, error)

Types

type BuildCluster added in v0.0.341

type BuildCluster interface {
	NewConn(ctx context.Context) (net.Conn, string, error)
	GetPlatform() string
	RunBuildProxy(ctx context.Context, socketPath, controlSocketPath string, useGrpcProxy, annotateBuild bool, workersInfo *controlapi.ListWorkersResponse) (*buildProxy, error)
}

func NewBuildCluster added in v0.0.341

func NewBuildCluster(ctx context.Context, platformStr, buildkitSockPath string, waitUntilReady bool) (BuildCluster, error)

type BuildFragment added in v0.0.416

type BuildFragment struct {
	ContextDir         string
	Dockerfile         string
	DockerfileContents []byte
	BuildArgs          map[string]string
	Platform           specs.Platform
	Exports            []client.ExportEntry
	Secrets            []buildSecret
}

type BuilderConfig added in v0.0.406

type BuilderConfig struct {
	Platform             string // e.g. "linux/amd64"
	Arch                 string // e.g. "amd64"
	FullBuildkitEndpoint string
	ServerCAPath         string
	ClientKeyPath        string
	ClientCertPath       string
}

func PrepareServerSideBuildxProxy added in v0.0.406

func PrepareServerSideBuildxProxy(ctx context.Context, stateDir string, platforms []api.BuildPlatform, conf api.BuilderConfiguration) ([]BuilderConfig, error)

type ConnectBits added in v0.0.440

type ConnectBits struct {
	Conn     net.Conn
	Signer   ssh.Signer
	Username string
}

type ConnectSshFunc added in v0.0.440

type ConnectSshFunc func(context.Context, string) (ConnectBits, error)

type CreateContainerOpts added in v0.0.291

type CreateContainerOpts struct {
	Name                         string
	Image                        string
	Args                         []string
	Env                          map[string]string
	Flags                        []string
	ExportedPorts                []exportContainerPort
	Features                     []string
	DocumentedPurpose            string
	Labels                       map[string]string
	InternalExtra                string
	EnableDocker                 bool
	ForwardNscState              bool
	ExposeNscBins                bool
	Network                      string
	Experimental                 map[string]any
	InstanceExperimental         map[string]any
	ExperimentalInstanceFeatures any
	User                         string
}

type CreateContainerResult added in v0.0.404

type CreateContainerResult struct {
	InstanceId  string
	InstanceUrl string
	ApiEndpoint string

	Containers      []api.CreateInstanceResponse_ContainerReference
	LegacyContainer []*api.Container
}

func CreateContainerInstance added in v0.0.291

func CreateContainerInstance(ctx context.Context, machineType string, duration, waitFor time.Duration, target string, opts CreateContainerOpts) (*CreateContainerResult, error)

type InlineSshOpts added in v0.0.387

type InlineSshOpts struct {
	User            string
	ForwardSshAgent bool
	ForcePty        bool
	DisablePty      bool
	ContainerName   string
}

type LocalBuilderInstance added in v0.0.341

type LocalBuilderInstance struct {
	// contains filtered or unexported fields
}

func NewLocalBuilderInstance added in v0.0.341

func NewLocalBuilderInstance(buildkitSockPath string) (*LocalBuilderInstance, error)

func (*LocalBuilderInstance) GetPlatform added in v0.0.341

func (l *LocalBuilderInstance) GetPlatform() string

func (*LocalBuilderInstance) NewConn added in v0.0.341

func (l *LocalBuilderInstance) NewConn(parentCtx context.Context) (net.Conn, string, error)

func (*LocalBuilderInstance) RunBuildProxy added in v0.0.341

func (l *LocalBuilderInstance) RunBuildProxy(ctx context.Context, socketPath, controlSocketPath string, useGrpcProxy, annotateBuild bool, workersInfo *controlapi.ListWorkersResponse) (*buildProxy, error)

type ProxyStatus added in v0.0.303

type ProxyStatus string
const (
	ProxyStatus_Starting              ProxyStatus = "Starting"
	ProxyStatus_Running               ProxyStatus = "Running"
	ProxyStatus_Failing               ProxyStatus = "Failing"
	ProxyStatus_ServerSide            ProxyStatus = "ServerSideProxy"
	ProxyStatus_ServerSideUnreachable ProxyStatus = "ServerSideProxyUnreachable"
)

type RemoteBuildClusterInstance added in v0.0.341

type RemoteBuildClusterInstance struct {
	// contains filtered or unexported fields
}

func NewRemoteBuildClusterInstance added in v0.0.444

func NewRemoteBuildClusterInstance(p api.BuildPlatform, waitUntilReady bool) *RemoteBuildClusterInstance

func (*RemoteBuildClusterInstance) GetPlatform added in v0.0.341

func (bp *RemoteBuildClusterInstance) GetPlatform() string

func (*RemoteBuildClusterInstance) NewConn added in v0.0.341

func (bp *RemoteBuildClusterInstance) NewConn(parentCtx context.Context) (net.Conn, string, error)

func (*RemoteBuildClusterInstance) RunBuildProxy added in v0.0.341

func (bp *RemoteBuildClusterInstance) RunBuildProxy(ctx context.Context, socketPath, controlSocketPath string, useGrpcProxy, annotateBuild bool, workersInfo *controlapi.ListWorkersResponse) (*buildProxy, error)

type ServerProxyEndpoint added in v0.0.406

type ServerProxyEndpoint struct {
	Platform string
	Endpoint string
}

type StatusData added in v0.0.318

type StatusData struct {
	Platform          string
	IsServerSideProxy bool
	Status            ProxyStatus
	LastError         string
	LogPath           string
	LastInstanceID    string
	LastUpdate        time.Time
	Requests          int
}

type Stream added in v0.0.281

type Stream interface {
	SendMsg(m interface{}) error
	RecvMsg(m interface{}) error
}

Directories

Path Synopsis
Package buildxstore is a minimal, faithful fork of the builder store from github.com/docker/buildx (store, store/storeutil, util/confutil, util/dockerutil, util/platformutil and localstate), at version v0.32.1.
Package buildxstore is a minimal, faithful fork of the builder store from github.com/docker/buildx (store, store/storeutil, util/confutil, util/dockerutil, util/platformutil and localstate), at version v0.32.1.

Jump to

Keyboard shortcuts

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