engine

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	EngineImageRepo = "registry.dagger.io/engine"
	Package         = "github.com/dagger/dagger"

	DaggerNameEnv = "_EXPERIMENTAL_DAGGER_ENGINE_NAME"

	DaggerVersionEnv        = "_EXPERIMENTAL_DAGGER_VERSION"
	DaggerMinimumVersionEnv = "_EXPERIMENTAL_DAGGER_MIN_VERSION"

	GPUSupportEnv = "_EXPERIMENTAL_DAGGER_GPU_SUPPORT"
	RunnerHostEnv = "_EXPERIMENTAL_DAGGER_RUNNER_HOST"
)
View Source
const (
	StdinPrefix  = "\x00,"
	StdoutPrefix = "\x01,"
	StderrPrefix = "\x02,"
	ResizePrefix = "resize,"
	ExitPrefix   = "exit,"
)
View Source
const (
	HTTPProxyEnvName  = "HTTP_PROXY"
	HTTPSProxyEnvName = "HTTPS_PROXY"
	FTPProxyEnvName   = "FTP_PROXY"
	NoProxyEnvName    = "NO_PROXY"
	AllProxyEnvName   = "ALL_PROXY"
)
View Source
const (
	EngineVersionMetaKey = "x-dagger-engine"

	ClientMetadataMetaKey = "x-dagger-client-metadata"
)

Variables

View Source
var (
	// Version holds the complete version number.
	//
	// Note: this is filled at link-time.
	//
	// - For official tagged releases, this is simple semver like x.y.z
	// - For builds off our repo's main branch, this is the git commit sha
	// - For local dev builds, this is a content hash of the source directory
	Version string

	// MinimumEngineVersion is used by the client to determine the minimum
	// allowed engine version that can be used by that client.
	MinimumEngineVersion = "v0.11.7"

	// MinimumClientVersion is used by the engine to determine the minimum
	// allowed client version that can connect to that engine.
	MinimumClientVersion = "v0.11.7"
)

Functions

func CheckVersionCompatibility added in v0.11.7

func CheckVersionCompatibility(version string, minVersion string) error

func ContextWithClientMetadata added in v0.8.0

func ContextWithClientMetadata(ctx context.Context, clientMetadata *ClientMetadata) context.Context

func RunnerHost added in v0.8.0

func RunnerHost() (string, error)

Types

type ClientMetadata added in v0.8.0

type ClientMetadata struct {
	// ClientID is unique to each client. The main client's ID is the empty string,
	// any module and/or nested exec client's ID is a unique digest.
	ClientID string `json:"client_id"`

	// ClientSecretToken is a secret token that is unique to every client. It's
	// initially provided to the server in the controller.Session request. Every
	// other request w/ that client ID must also include the same token.
	ClientSecretToken string `json:"client_secret_token"`

	// ServerID is the id of the server that a client and any of its nested
	// module clients connect to
	ServerID string `json:"server_id"`

	// If RegisterClient is true, then a call to Session will initialize the
	// server if it hasn't already been initialized and register the session's
	// attachables with it either way. If false, then the session conn will be
	// forwarded to the server
	RegisterClient bool `json:"register_client"`

	// ClientHostname is the hostname of the client that made the request. It's
	// used opportunistically as a best-effort, semi-stable identifier for the
	// client across multiple sessions, which can be useful for debugging and for
	// minimizing occurrences of both excessive cache misses and excessive cache
	// matches.
	ClientHostname string `json:"client_hostname"`

	// ClientVersion is the version string of the client that make the request.
	ClientVersion string `json:"client_version"`

	// (Optional) Pipeline labels for e.g. vcs info like branch, commit, etc.
	Labels map[string]string `json:"labels"`

	// Import configuration for Buildkit's remote cache
	UpstreamCacheImportConfig []*controlapi.CacheOptionsEntry

	// Export configuration for Buildkit's remote cache
	UpstreamCacheExportConfig []*controlapi.CacheOptionsEntry

	// Dagger Cloud Token
	CloudToken string

	// Disable analytics
	DoNotTrack bool
}

func ClientMetadataFromContext added in v0.8.0

func ClientMetadataFromContext(ctx context.Context) (*ClientMetadata, error)

func (ClientMetadata) AppendToMD added in v0.8.0

func (m ClientMetadata) AppendToMD(md metadata.MD) metadata.MD

func (ClientMetadata) BuildkitSessionID added in v0.11.3

func (m ClientMetadata) BuildkitSessionID() string

The ID to use for this client's buildkit session. It's a combination of both the client and the server IDs to account for the fact that the client ID is a content digest for functions/nested-execs, meaning it can reoccur across different servers; that doesn't work because buildkit's SessionManager is global to the whole process.

func (ClientMetadata) ToGRPCMD added in v0.8.0

func (m ClientMetadata) ToGRPCMD() metadata.MD

type LocalExportOpts added in v0.8.0

type LocalExportOpts struct {
	Path               string      `json:"path"`
	IsFileStream       bool        `json:"is_file_stream"`
	FileOriginalName   string      `json:"file_original_name"`
	AllowParentDirPath bool        `json:"allow_parent_dir_path"`
	FileMode           os.FileMode `json:"file_mode"`
	// whether to just merge in contents of a directory to the target on the host
	// or to replace the target entirely such that it matches the source directory,
	// which includes deleting any files that are not in the source directory
	Merge bool
}

func LocalExportOptsFromContext added in v0.8.0

func LocalExportOptsFromContext(ctx context.Context) (*LocalExportOpts, error)

func (LocalExportOpts) AppendToOutgoingContext added in v0.8.0

func (o LocalExportOpts) AppendToOutgoingContext(ctx context.Context) context.Context

func (*LocalExportOpts) FromGRPCMD added in v0.11.2

func (o *LocalExportOpts) FromGRPCMD(md metadata.MD) error

func (LocalExportOpts) ToGRPCMD added in v0.8.0

func (o LocalExportOpts) ToGRPCMD() metadata.MD

type LocalImportOpts added in v0.8.0

type LocalImportOpts struct {
	Path               string   `json:"path"`
	IncludePatterns    []string `json:"include_patterns"`
	ExcludePatterns    []string `json:"exclude_patterns"`
	FollowPaths        []string `json:"follow_paths"`
	ReadSingleFileOnly bool     `json:"read_single_file_only"`
	MaxFileSize        int64    `json:"max_file_size"`
	StatPathOnly       bool     `json:"stat_path_only"`
	StatReturnAbsPath  bool     `json:"stat_return_abs_path"`
}

func LocalImportOptsFromContext added in v0.8.0

func LocalImportOptsFromContext(ctx context.Context) (*LocalImportOpts, error)

func (LocalImportOpts) AppendToOutgoingContext added in v0.8.0

func (o LocalImportOpts) AppendToOutgoingContext(ctx context.Context) context.Context

func (*LocalImportOpts) FromGRPCMD added in v0.11.2

func (o *LocalImportOpts) FromGRPCMD(md metadata.MD) error

func (LocalImportOpts) ToGRPCMD added in v0.8.0

func (o LocalImportOpts) ToGRPCMD() metadata.MD

Directories

Path Synopsis
distconsts module
sources
Package vcs exposes functions for resolving import paths and using version control systems, which can be used to implement behavior similar to the standard "go get" command.
Package vcs exposes functions for resolving import paths and using version control systems, which can be used to implement behavior similar to the standard "go get" command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳