engine

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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"

	SessionAttachablesEndpoint = "/sessionAttachables"
	QueryEndpoint              = "/query"
	ShutdownEndpoint           = "/shutdown"

	// Buildkit-interpreted session keys, can't change
	SessionIDMetaKey         = "X-Docker-Expose-Session-Uuid"
	SessionNameMetaKey       = "X-Docker-Expose-Session-Name"
	SessionSharedKeyMetaKey  = "X-Docker-Expose-Session-Sharedkey"
	SessionMethodNameMetaKey = "X-Docker-Expose-Session-Grpc-Method"
)
View Source
const (
	EngineVersionMetaKey = "X-Dagger-Engine"

	ClientMetadataMetaKey = "X-Dagger-Client-Metadata"

	// socket session attachable keys
	SocketURLEncodedKey = "X-Dagger-Socket-URLEncoded"
)

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.12.0"

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

	// MinimumModuleVersion is used by the engine to determine the minimum
	// allowed module engine version that can connect to this engine.
	//
	// Set to v0.9.9, because this was when the engineVersion field was
	// introduced - if it's present and not a dev version, it must be higher
	// than v0.9.9.
	MinimumModuleVersion = "v0.9.9"
)

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, randomly generated each time a client initializes.
	// It's also used as the *buildkit* session ID (as opposed to the dagger session ID), which
	// is created for each client.
	ClientID string `json:"client_id"`

	// ClientSecretToken is a secret token that is unique to every client.
	// Every request w/ that client ID must also include the same token.
	ClientSecretToken string `json:"client_secret_token"`

	// SessionID is the id of the dagger session that a client and any of its nested
	// module clients connect to
	SessionID string `json:"session_id"`

	// 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"`

	// Interactive mode
	Interactive bool `json:"interactive"`

	// 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 ClientMetadataFromHTTPHeaders added in v0.11.8

func ClientMetadataFromHTTPHeaders(h http.Header) (*ClientMetadata, error)

func (ClientMetadata) AppendToHTTPHeaders added in v0.11.8

func (m ClientMetadata) AppendToHTTPHeaders(h http.Header) http.Header

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