server

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 143 Imported by: 0

Documentation

Index

Constants

View Source
const InstrumentationLibrary = "dagger.io/engine.server"

Variables

This section is empty.

Functions

func DetectDefaultGCCap added in v0.13.7

func DetectDefaultGCCap(dstat disk.DiskStat) config.GCSpace

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]*resource.ID

	// corner case: when initializing a module by calling it to get its typedefs, we don't actually
	// have a full EncodedModuleID yet, but some SDKs still call CurrentModule.name then. For this
	// case we just provide the ModuleName and use that to support CurrentModule.name.
	ModuleName string
}

type Fetcher added in v0.12.5

type Fetcher func(ctx context.Context, db *sql.DB, since string) (*sse.Event, bool, error)

type LogsPubSub added in v0.12.5

type LogsPubSub struct {
	*PubSub
	// contains filtered or unexported fields
}

func (LogsPubSub) Export added in v0.12.5

func (ps LogsPubSub) Export(ctx context.Context, logs []sdklog.Record) error

func (LogsPubSub) ForceFlush added in v0.12.5

func (ps LogsPubSub) ForceFlush(ctx context.Context) error

func (LogsPubSub) Shutdown added in v0.12.5

func (ps LogsPubSub) Shutdown(context.Context) error

type MetricsPubSub added in v0.13.6

type MetricsPubSub struct {
	*PubSub
	// contains filtered or unexported fields
}

func (MetricsPubSub) Aggregation added in v0.13.6

func (MetricsPubSub) Export added in v0.13.6

func (ps MetricsPubSub) Export(ctx context.Context, metrics *metricdata.ResourceMetrics) error

func (MetricsPubSub) ForceFlush added in v0.13.6

func (ps MetricsPubSub) ForceFlush(ctx context.Context) error

func (MetricsPubSub) Shutdown added in v0.13.6

func (ps MetricsPubSub) Shutdown(context.Context) error

func (MetricsPubSub) Temporality added in v0.13.6

type NewServerOpts added in v0.11.8

type NewServerOpts struct {
	Name           string
	Config         *config.Config
	BuildkitConfig *bkconfig.Config
}

type PubSub added in v0.12.5

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

func NewPubSub added in v0.12.5

func NewPubSub(srv *Server) *PubSub

func (*PubSub) Logs added in v0.12.5

func (ps *PubSub) Logs(client *daggerClient) sdklog.Exporter

func (*PubSub) LogsHandler added in v0.12.5

func (ps *PubSub) LogsHandler(rw http.ResponseWriter, r *http.Request)

func (*PubSub) LogsSubscribeHandler added in v0.12.5

func (ps *PubSub) LogsSubscribeHandler(w http.ResponseWriter, r *http.Request, client *daggerClient) error

func (*PubSub) Metrics added in v0.13.6

func (ps *PubSub) Metrics(client *daggerClient) sdkmetric.Exporter

func (*PubSub) MetricsHandler added in v0.12.5

func (ps *PubSub) MetricsHandler(rw http.ResponseWriter, r *http.Request)

func (*PubSub) MetricsSubscribeHandler added in v0.13.6

func (ps *PubSub) MetricsSubscribeHandler(w http.ResponseWriter, r *http.Request, client *daggerClient) error

func (*PubSub) ServeHTTP added in v0.12.5

func (ps *PubSub) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*PubSub) Spans added in v0.12.5

func (ps *PubSub) Spans(client *daggerClient) sdktrace.SpanExporter

func (*PubSub) TracesHandler added in v0.12.5

func (ps *PubSub) TracesHandler(rw http.ResponseWriter, r *http.Request)

func (*PubSub) TracesSubscribeHandler added in v0.12.5

func (ps *PubSub) TracesSubscribeHandler(w http.ResponseWriter, r *http.Request, client *daggerClient) error

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 *resource.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.SessionCache, 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) DagqlServer added in v0.16.3

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

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) 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) EngineLocalCachePolicy added in v0.13.7

func (srv *Server) EngineLocalCachePolicy() *bkclient.PruneInfo

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) MainClientCallerMetadata added in v0.17.0

func (srv *Server) MainClientCallerMetadata(ctx context.Context) (*engine.ClientMetadata, error)

The Client metadata 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) NonModuleParentClientMetadata added in v0.12.6

func (srv *Server) NonModuleParentClientMetadata(ctx context.Context) (*engine.ClientMetadata, error)

The nearest ancestor client that is not a module (either a caller from the host like the CLI or a nested exec). Useful for figuring out where local sources should be resolved from through chains of dependency modules.

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) Server added in v0.17.0

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

The DagQL server for the current client's session

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

type SpansPubSub added in v0.12.5

type SpansPubSub struct {
	*PubSub
	// contains filtered or unexported fields
}

func (SpansPubSub) ExportSpans added in v0.12.5

func (ps SpansPubSub) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

func (SpansPubSub) ForceFlush added in v0.12.5

func (ps SpansPubSub) ForceFlush(ctx context.Context) error

func (SpansPubSub) Shutdown added in v0.12.5

func (ps SpansPubSub) Shutdown(context.Context) error

type Topic added in v0.12.5

type Topic struct {
	TraceID  trace.TraceID
	ClientID string
}

func (Topic) String added in v0.12.5

func (t Topic) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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