( ctx context.Context, opts ContainerExecOpts, parent *engineutil.ExecutionMetadata, moduleContext dagql.ObjectResult[*Module], )
| 220 | } |
| 221 | |
| 222 | func (container *Container) execMeta( |
| 223 | ctx context.Context, |
| 224 | opts ContainerExecOpts, |
| 225 | parent *engineutil.ExecutionMetadata, |
| 226 | moduleContext dagql.ObjectResult[*Module], |
| 227 | ) (*engineutil.ExecutionMetadata, error) { |
| 228 | execMD := engineutil.ExecutionMetadata{} |
| 229 | if parent != nil { |
| 230 | execMD = *parent |
| 231 | } |
| 232 | |
| 233 | query, err := CurrentQuery(ctx) |
| 234 | if err != nil { |
| 235 | return nil, err |
| 236 | } |
| 237 | clientMetadata, err := engine.ClientMetadataFromContext(ctx) |
| 238 | if err != nil { |
| 239 | return nil, err |
| 240 | } |
| 241 | if execMD.CallDigest == "" { |
| 242 | if curCall := dagql.CurrentCall(ctx); curCall != nil { |
| 243 | callDigest, err := curCall.RecipeDigest(ctx) |
| 244 | if err != nil { |
| 245 | return nil, fmt.Errorf("compute exec call digest: %w", err) |
| 246 | } |
| 247 | execMD.CallDigest = callDigest |
| 248 | } |
| 249 | } |
| 250 | if execMD.HostAliases == nil { |
| 251 | execMD.HostAliases = make(map[string][]string) |
| 252 | } |
| 253 | execMD.RedirectStdinPath = opts.RedirectStdin |
| 254 | execMD.RedirectStdoutPath = opts.RedirectStdout |
| 255 | execMD.RedirectStderrPath = opts.RedirectStderr |
| 256 | execMD.SystemEnvNames = container.SystemEnvNames |
| 257 | execMD.EnabledGPUs = container.EnabledGPUs |
| 258 | if opts.NoInit { |
| 259 | execMD.NoInit = true |
| 260 | } |
| 261 | |
| 262 | var callerModDigest digest.Digest |
| 263 | if moduleContext.Self() != nil { |
| 264 | implementationScopedMod, err := ImplementationScopedModule(ctx, moduleContext) |
| 265 | if err != nil { |
| 266 | return nil, fmt.Errorf("failed to get implementation-scoped module from exec module context: %w", err) |
| 267 | } |
| 268 | callerModDigest, err = implementationScopedMod.ContentPreferredDigest(ctx) |
| 269 | if err != nil { |
| 270 | return nil, fmt.Errorf("failed to get implementation-scoped module digest from exec module context: %w", err) |
| 271 | } |
| 272 | } else if callerMod, err := query.CurrentModule(ctx); err == nil && callerMod.Self() != nil { |
| 273 | implementationScopedMod, err := ImplementationScopedModule(ctx, callerMod) |
| 274 | if err != nil { |
| 275 | return nil, fmt.Errorf("failed to get caller implementation-scoped module: %w", err) |
| 276 | } |
| 277 | callerModDigest, err = implementationScopedMod.ContentPreferredDigest(ctx) |
| 278 | if err != nil { |
| 279 | return nil, fmt.Errorf("failed to get caller implementation-scoped module digest: %w", err) |
no test coverage detected