server

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 126 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDiskSpacePercentage int64 = 75

Variables

This section is empty.

Functions

func FormatPlatforms added in v0.11.8

func FormatPlatforms(p []ocispecs.Platform) []string

Types

type ClientInitOpts added in v0.11.8

type ClientInitOpts struct {
	*engine.ClientMetadata

	// If this is a nested client, the call that created the client (i.e. a function call or
	// an exec with nesting enabled)
	CallID *call.ID

	// If this is a nested client, the client ID of the caller that created it
	CallerClientID string

	// If the client is running from a function in a module, this is the encoded dagQL ID
	// of that module.
	EncodedModuleID string

	// If the client is running from a function in a module, this is the encoded function call
	// metadata (of type core.FunctionCall)
	EncodedFunctionCall json.RawMessage

	// Client resource IDs passed to this client from parent object fields.
	// Needed to handle finding any secrets, sockets or other client resources
	// that this client should have access to due to being set in the parent
	// object.
	ParentIDs map[digest.Digest]*call.ID
}

type NewServerOpts added in v0.11.8

type NewServerOpts struct {
	Config *config.Config
	Name   string

	TelemetryPubSub *enginetel.PubSub
}

type Server added in v0.11.8

type Server struct {
	controlapi.UnimplementedControlServer

	SolverCache daggercache.Manager
	// contains filtered or unexported fields
}

func NewServer added in v0.11.8

func NewServer(ctx context.Context, opts *NewServerOpts) (*Server, error)

func (*Server) AddClientResourcesFromID added in v0.12.1

func (srv *Server) AddClientResourcesFromID(ctx context.Context, id *call.ID, sourceClientID string, skipTopLevel bool) error

func (*Server) Auth added in v0.12.0

func (srv *Server) Auth(ctx context.Context) (*auth.RegistryAuthProvider, error)

The auth provider for the current client

func (*Server) Buildkit added in v0.12.0

func (srv *Server) Buildkit(ctx context.Context) (*buildkit.Client, error)

The buildkit APIs for the current client

func (*Server) Cache added in v0.12.0

func (srv *Server) Cache(ctx context.Context) (dagql.Cache, error)

The DagQL query cache for the current client's session

func (*Server) Close added in v0.11.8

func (srv *Server) Close() error

func (*Server) CurrentFunctionCall added in v0.11.8

func (srv *Server) CurrentFunctionCall(ctx context.Context) (*core.FunctionCall, error)

If the current client is coming from a function, return the function call metadata

func (*Server) CurrentModule added in v0.11.8

func (srv *Server) CurrentModule(ctx context.Context) (*core.Module, error)

If the current client is coming from a function, return the module that function is from

func (*Server) CurrentServedDeps added in v0.11.8

func (srv *Server) CurrentServedDeps(ctx context.Context) (*core.ModDeps, error)

Return the list of deps being served to the current client

func (*Server) DefaultDeps added in v0.12.0

func (srv *Server) DefaultDeps(ctx context.Context) (*core.ModDeps, error)

The default deps of every user module (currently just core)

func (*Server) EngineCacheEntrySetMap added in v0.12.0

func (srv *Server) EngineCacheEntrySetMap(ctx context.Context) (*sync.Map, error)

A map of unique IDs for the result of a given cache entry set query, allowing further queries on the result to operate on a stable result rather than the live state.

func (*Server) EngineLocalCacheEntries added in v0.12.0

func (srv *Server) EngineLocalCacheEntries(ctx context.Context) (*core.EngineCacheEntrySet, error)

Return all the cache entries in the local cache. No support for filtering yet.

func (*Server) EngineLocalCacheKeepBytes added in v0.12.0

func (srv *Server) EngineLocalCacheKeepBytes() int64

The KeepBytes setting to use for automatic local cache GC.

func (*Server) Info added in v0.11.8

func (*Server) LeaseManager added in v0.12.0

func (srv *Server) LeaseManager() *leaseutil.Manager

The lease manager for the engine as a whole

func (*Server) ListWorkers added in v0.11.8

func (*Server) LogMetrics added in v0.11.8

func (srv *Server) LogMetrics(l *logrus.Entry) *logrus.Entry

func (*Server) MainClientCallerID added in v0.12.0

func (srv *Server) MainClientCallerID(ctx context.Context) (string, error)

The ClientID of the main client caller (i.e. the one who created the session, typically the CLI invoked by the user)

func (*Server) MuxEndpoint added in v0.11.8

func (srv *Server) MuxEndpoint(ctx context.Context, path string, handler http.Handler) error

Mix in this http endpoint+handler to the current client's session

func (*Server) OCIStore added in v0.12.0

func (srv *Server) OCIStore() content.Store

The content store for the engine as a whole

func (*Server) Platform added in v0.12.0

func (srv *Server) Platform() core.Platform

The default platform for the engine as a whole

func (*Server) PruneEngineLocalCacheEntries added in v0.12.0

func (srv *Server) PruneEngineLocalCacheEntries(ctx context.Context) (*core.EngineCacheEntrySet, error)

Prune everything that is releasable in the local cache. No support for filtering yet.

func (*Server) Register added in v0.11.8

func (srv *Server) Register(server *grpc.Server)

func (*Server) Secrets added in v0.12.0

func (srv *Server) Secrets(ctx context.Context) (*core.SecretStore, error)

The secret store for the current client

func (*Server) ServeHTTP added in v0.11.8

func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves clients directly hitting the engine API (i.e. main client callers, not nested execs like module functions)

func (*Server) ServeHTTPToNestedClient added in v0.11.8

func (srv *Server) ServeHTTPToNestedClient(w http.ResponseWriter, r *http.Request, execMD *buildkit.ExecutionMetadata)

ServeHTTPToNestedClient serves nested clients, including module function calls. The only difference is that additional execution metadata is passed alongside the request from the executor. We don't want to put all this execution metadata in http headers since it includes arbitrary values from users in the function call metadata, which can exceed max header size.

func (*Server) ServeModule added in v0.11.8

func (srv *Server) ServeModule(ctx context.Context, mod *core.Module) error

Stitch in the given module to the list being served to the current client

func (*Server) Services added in v0.12.0

func (srv *Server) Services(ctx context.Context) (*core.Services, error)

The services for the current client's session

func (*Server) Sockets added in v0.12.1

func (srv *Server) Sockets(ctx context.Context) (*core.SocketStore, error)

The socket store for the current client

Jump to

Keyboard shortcuts

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