Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToWorkerCacheResult(ctx context.Context, res *solverresult.Result[*ref]) (*solverresult.Result[bkcache.ImmutableRef], error)
- func ProgrockForwarder(sockPath string, w progrock.Writer) (progrock.Writer, func() error, error)
- func RecordVertexes(recorder *progrock.Recorder, def *pb.Definition)
- type BK2Progrock
- type BlobOp
- type Client
- func (c *Client) Close() error
- func (c *Client) CombinedResult(ctx context.Context) (*Result, error)
- func (c *Client) ContainerImageToTarball(ctx context.Context, engineHostPlatform specs.Platform, fileName string, ...) (*bksolverpb.Definition, error)
- func (c *Client) DefToBlob(ctx context.Context, pbDef *bksolverpb.Definition) (_ *bksolverpb.Definition, desc specs.Descriptor, _ error)
- func (c *Client) EngineContainerLocalImport(ctx context.Context, recorder *progrock.Recorder, platform specs.Platform, ...) (*bksolverpb.Definition, specs.Descriptor, error)
- func (c *Client) ExportContainerImage(ctx context.Context, inputByPlatform map[string]ContainerExport, ...) (map[string]string, error)
- func (c *Client) GetSessionCaller(ctx context.Context, clientID string) (bksession.Caller, error)
- func (c *Client) ID() string
- func (c *Client) IOReaderExport(ctx context.Context, r io.Reader, destPath string, destMode os.FileMode) (rerr error)
- func (c *Client) ListenHostToContainer(ctx context.Context, hostListenAddr, proto, upstream string) (*session.ListenResponse, func() error, error)
- func (c *Client) LocalDirExport(ctx context.Context, def *bksolverpb.Definition, destPath string, merge bool) (rerr error)
- func (c *Client) LocalFileExport(ctx context.Context, def *bksolverpb.Definition, destPath string, ...) (rerr error)
- func (c *Client) LocalImport(ctx context.Context, recorder *progrock.Recorder, platform specs.Platform, ...) (*bksolverpb.Definition, specs.Descriptor, error)
- func (c *Client) NewContainer(ctx context.Context, req bkgw.NewContainerRequest) (bkgw.Container, error)
- func (c *Client) PublishContainerImage(ctx context.Context, inputByPlatform map[string]ContainerExport, ...) (map[string]string, error)
- func (c *Client) ReadCallerHostFile(ctx context.Context, path string) ([]byte, error)
- func (c *Client) ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt) (string, digest.Digest, []byte, error)
- func (c *Client) Solve(ctx context.Context, req bkgw.SolveRequest) (_ *Result, rerr error)
- func (c *Client) StatCallerHostPath(ctx context.Context, path string, returnAbsPath bool) (*fsutiltypes.Stat, error)
- func (c *Client) UpstreamCacheExport(ctx context.Context, cacheExportFuncs []ResolveCacheExporterFunc) error
- func (c *Client) WriteStatusesTo(ctx context.Context, recorder *progrock.Recorder)
- type ContainerExecUncachedMetadata
- type ContainerExport
- type DiffOp
- type ExecError
- type ExecOp
- type FileOp
- type GitOp
- type HTTPOp
- type ImageOp
- type LocalOp
- type MergeOp
- type OCIOp
- type OpDAG
- func (dag *OpDAG) AsBlob() (*BlobOp, bool)
- func (dag *OpDAG) AsDiff() (*DiffOp, bool)
- func (dag *OpDAG) AsExec() (*ExecOp, bool)
- func (dag *OpDAG) AsFile() (*FileOp, bool)
- func (dag *OpDAG) AsGit() (*GitOp, bool)
- func (dag *OpDAG) AsHTTP() (*HTTPOp, bool)
- func (dag *OpDAG) AsImage() (*ImageOp, bool)
- func (dag *OpDAG) AsLocal() (*LocalOp, bool)
- func (dag *OpDAG) AsMerge() (*MergeOp, bool)
- func (dag *OpDAG) AsOCI() (*OCIOp, bool)
- func (dag *OpDAG) BlobDependencies() (map[digest.Digest]*ocispecs.Descriptor, error)
- func (dag *OpDAG) Marshal() (*pb.Definition, error)
- func (dag *OpDAG) String() string
- func (dag *OpDAG) Walk(f func(*OpDAG) error) error
- type Opts
- type ProgrockLogrusWriter
- type ResolveCacheExporterFunc
- type Result
Constants ¶
const ( FocusPrefix = "[focus] " InternalPrefix = "[internal] " )
const ( // Exec errors will only include the last this number of bytes of output. MaxExecErrorOutputBytes = 100 * 1024 // TruncationMessage is the message that will be prepended to truncated output. TruncationMessage = "[omitting %d bytes]..." // MaxFileContentsChunkSize sets the maximum chunk size for ReadFile calls // Equals around 95% of the max message size (4MB) in // order to keep space for any Protocol Buffers overhead: MaxFileContentsChunkSize = 3984588 // MaxFileContentsSize sets the limit of the maximum file size // that can be retrieved using File.Contents, currently set to 128MB: MaxFileContentsSize = 128 << 20 // MetaMountDestPath is the special path that the shim writes metadata to. MetaMountDestPath = "/.dagger_meta_mount" // MetaSourcePath is a world-writable directory created and mounted to /dagger. MetaSourcePath = "meta" )
const ( // OCIStoreName is the name of the OCI content store used for OCI tarball // imports. OCIStoreName = "dagger-oci" // BuiltinContentOCIStoreName is the name of the OCI content store used for // builtins like SDKs that we package with the engine container but still use // in LLB. BuiltinContentOCIStoreName = "dagger-builtin-content" )
Variables ¶
var SkipInputs = fmt.Errorf("skip inputs") //nolint:stylecheck // Err prefix isn't convention for Walk control errors
Functions ¶
func ConvertToWorkerCacheResult ¶
func ConvertToWorkerCacheResult(ctx context.Context, res *solverresult.Result[*ref]) (*solverresult.Result[bkcache.ImmutableRef], error)
func ProgrockForwarder ¶
func RecordVertexes ¶
func RecordVertexes(recorder *progrock.Recorder, def *pb.Definition)
Types ¶
type BK2Progrock ¶
type BK2Progrock interface {
ConvertStatus(*bkclient.SolveStatus) *progrock.StatusUpdate
}
type BlobOp ¶ added in v0.8.8
func (*BlobOp) OCIDescriptor ¶ added in v0.8.8
func (op *BlobOp) OCIDescriptor() (ocispecs.Descriptor, error)
type Client ¶
type Client struct { *Opts // contains filtered or unexported fields }
Client is dagger's internal interface to buildkit APIs
func (*Client) CombinedResult ¶
CombinedResult returns a buildkit result with all the refs solved by this client so far. This is useful for constructing a result for upstream remote caching.
func (*Client) ContainerImageToTarball ¶ added in v0.9.0
func (c *Client) ContainerImageToTarball( ctx context.Context, engineHostPlatform specs.Platform, fileName string, inputByPlatform map[string]ContainerExport, opts map[string]string, ) (*bksolverpb.Definition, error)
func (*Client) DefToBlob ¶ added in v0.9.8
func (c *Client) DefToBlob( ctx context.Context, pbDef *bksolverpb.Definition, ) (_ *bksolverpb.Definition, desc specs.Descriptor, _ error)
DefToBlob converts the given llb definition to a content addressed blob valid for the duration of the current session. It's useful for converting unstable sources like local dir imports into stable, content-defined sources. NOTE: it's currently assumed that the provided definition is a single layer. Definitions can be squashed into a single layer by copying from them to scratch.
func (*Client) EngineContainerLocalImport ¶ added in v0.9.0
func (c *Client) EngineContainerLocalImport( ctx context.Context, recorder *progrock.Recorder, platform specs.Platform, srcPath string, excludePatterns []string, includePatterns []string, ) (*bksolverpb.Definition, specs.Descriptor, error)
Import a directory from the engine container, as opposed to from a client
func (*Client) ExportContainerImage ¶
func (*Client) GetSessionCaller ¶
func (*Client) IOReaderExport ¶ added in v0.8.8
func (c *Client) IOReaderExport(ctx context.Context, r io.Reader, destPath string, destMode os.FileMode) (rerr error)
IOReaderExport exports the contents of an io.Reader to the caller's local fs as a file TODO: de-dupe this with the above method to extent possible
func (*Client) ListenHostToContainer ¶ added in v0.9.0
func (*Client) LocalDirExport ¶
func (c *Client) LocalDirExport( ctx context.Context, def *bksolverpb.Definition, destPath string, merge bool, ) (rerr error)
func (*Client) LocalFileExport ¶
func (c *Client) LocalFileExport( ctx context.Context, def *bksolverpb.Definition, destPath string, filePath string, allowParentDirPath bool, ) (rerr error)
func (*Client) LocalImport ¶ added in v0.8.8
func (c *Client) LocalImport( ctx context.Context, recorder *progrock.Recorder, platform specs.Platform, srcPath string, excludePatterns []string, includePatterns []string, ) (*bksolverpb.Definition, specs.Descriptor, error)
func (*Client) NewContainer ¶
func (*Client) PublishContainerImage ¶
func (*Client) ReadCallerHostFile ¶
func (*Client) ResolveImageConfig ¶
func (*Client) StatCallerHostPath ¶ added in v0.9.9
func (*Client) UpstreamCacheExport ¶
func (c *Client) UpstreamCacheExport(ctx context.Context, cacheExportFuncs []ResolveCacheExporterFunc) error
type ContainerExecUncachedMetadata ¶ added in v0.8.8
type ContainerExecUncachedMetadata struct { ParentClientIDs []string `json:"parentClientIDs,omitempty"` ServerID string `json:"serverID,omitempty"` // Progrock propagation ProgSockPath string `json:"progSockPath,omitempty"` ProgParent string `json:"progParent,omitempty"` }
Metadata passed to an exec that doesn't count towards the cache key. This should be used with great caution; only for metadata that is safe to be de-duplicated across execs.
Currently, this uses the FTPProxy LLB option to pass without becoming part of the cache key. This is a hack that, while ugly to look at, is simple and robust. Alternatives would be to use secrets or sockets, but they are more complicated, or to create a custom buildkit worker/executor, which is MUCH more complicated.
If a need to add ftp proxy support arises, then we can just also embed the "real" ftp proxy setting in here too and have the shim handle leaving only that set in the actual env var.
func (*ContainerExecUncachedMetadata) FromEnv ¶ added in v0.8.8
func (md *ContainerExecUncachedMetadata) FromEnv(envKV string) (bool, error)
func (ContainerExecUncachedMetadata) ToPBFtpProxyVal ¶ added in v0.8.8
func (md ContainerExecUncachedMetadata) ToPBFtpProxyVal() (string, error)
type ContainerExport ¶
type ContainerExport struct { Definition *bksolverpb.Definition Config specs.ImageConfig }
type ExecError ¶
type ExecError struct { Cmd []string ExitCode int Stdout string Stderr string // contains filtered or unexported fields }
ExecError is an error that occurred while executing an `Op_Exec`.
func (*ExecError) Extensions ¶
type ExecOp ¶ added in v0.8.8
func (*ExecOp) OutputMount ¶ added in v0.8.8
func (*ExecOp) OutputMountBase ¶ added in v0.8.8
type OpDAG ¶ added in v0.8.8
type OpDAG struct { *pb.Op // the root of the DAG OpDigest *digest.Digest // the digest of this root, common across all outputIndexes for this root Metadata *pb.OpMetadata // metadata for the root Inputs []*OpDAG // the inputs to the root // contains filtered or unexported fields }
func (*OpDAG) BlobDependencies ¶ added in v0.8.8
func (dag *OpDAG) BlobDependencies() (map[digest.Digest]*ocispecs.Descriptor, error)
type Opts ¶
type Opts struct { Worker bkworker.Worker SessionManager *bksession.Manager LLBSolver *llbsolver.Solver GenericSolver *bksolver.Solver SecretStore bksecrets.SecretStore AuthProvider *auth.RegistryAuthProvider PrivilegedExecEnabled bool UpstreamCacheImports []bkgw.CacheOptionsEntry ProgSockPath string // MainClientCaller is the caller who initialized the server associated with this // client. It is special in that when it shuts down, the client will be closed and // that registry auth and sockets are currently only ever sourced from this caller, // not any nested clients (may change in future). MainClientCaller bksession.Caller MainClientCallerID string DNSConfig *oci.DNSConfig Frontends map[string]bkfrontend.Frontend // contains filtered or unexported fields }
Opts for a Client that are shared across all instances for a given DaggerServer
type ProgrockLogrusWriter ¶
type ProgrockLogrusWriter struct{}
func (ProgrockLogrusWriter) Close ¶
func (w ProgrockLogrusWriter) Close() error
func (ProgrockLogrusWriter) WriteStatus ¶
func (w ProgrockLogrusWriter) WriteStatus(ev *progrock.StatusUpdate) error
type Result ¶
type Result = solverresult.Result[*ref]