MCPcopy Create free account
hub / github.com/dagger/dagger / Playground

Method Playground

toolchains/engine-dev/main.go:105–140  ·  view source on GitHub ↗

Build an ephemeral environment with the Dagger CLI and engine built from source, installed and ready to use

(
	ctx context.Context,
	// Build from a custom base image
	// +optional
	base *dagger.Container,
	// Enable experimental GPU support
	// +optional
	gpuSupport bool,
	// Share cache globally
	// +optional
	sharedCache bool,
	// +optional
	metrics bool,
	//+optional
	version string,
)

Source from the content-addressed store, hash-verified

103
104// Build an ephemeral environment with the Dagger CLI and engine built from source, installed and ready to use
105func (dev *EngineDev) Playground(
106 ctx context.Context,
107 // Build from a custom base image
108 // +optional
109 base *dagger.Container,
110 // Enable experimental GPU support
111 // +optional
112 gpuSupport bool,
113 // Share cache globally
114 // +optional
115 sharedCache bool,
116 // +optional
117 metrics bool,
118 //+optional
119 version string,
120) (*dagger.Container, error) {
121 ctr := base
122 if ctr == nil {
123 ctr = dag.Wolfi().Container(dagger.WolfiContainerOpts{
124 Packages: []string{"apk-tools", "git"},
125 }).WithEnvVariable("HOME", "/root")
126 }
127 ctr = ctr.WithWorkdir("$HOME", dagger.ContainerWithWorkdirOpts{Expand: true})
128 svc, err := dev.Service(
129 ctx,
130 "", // name
131 gpuSupport,
132 sharedCache,
133 metrics,
134 version,
135 )
136 if err != nil {
137 return nil, err
138 }
139 return dev.InstallClient(ctx, ctr, svc, version)
140}
141
142// Build the engine container
143func (dev *EngineDev) Container(

Callers 3

IntrospectionJSONMethod · 0.95
GraphqlSchemaMethod · 0.95
invokeFunction · 0.45

Calls 6

ServiceMethod · 0.95
InstallClientMethod · 0.95
WithEnvVariableMethod · 0.45
ContainerMethod · 0.45
WolfiMethod · 0.45
WithWorkdirMethod · 0.45

Tested by

no test coverage detected