Share effective Scriptorium request context
This commit is contained in:
@@ -128,15 +128,16 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
boundsStderrLogPath = filepath.Join(runLayout.LogsDir, "scriptorium.bounds.stderr.log")
|
||||
boundsGeneratedConfigPath = filepath.Join(runLayout.ConfigDir, "scriptorium.bounds.generated.yml")
|
||||
}
|
||||
boundsTimeout, err := resolveScriptoriumTimeout(env.Config.Pipeline.Scriptorium.Timeout, boundsCfg.Timeout)
|
||||
requestContext, err := TrimScriptoriumContext(env.Config, sessionID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("trim: resolve bounds timeout: %w", err)
|
||||
return nil, fmt.Errorf("trim: resolve bounds request: %w", err)
|
||||
}
|
||||
boundsTimeout := requestContext.Timeout
|
||||
|
||||
inputPaths := map[string]string{
|
||||
boundsCfg.TranscriptInputName: normalizedPath,
|
||||
}
|
||||
vars := withScriptoriumStickySessionVar(nil, sessionID)
|
||||
vars := requestContext.Vars
|
||||
|
||||
metadata["bounds_prompt_id"] = boundsCfg.PromptID
|
||||
metadata["bounds_profile_id"] = boundsCfg.ProfileID
|
||||
@@ -165,11 +166,11 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
}
|
||||
|
||||
renderReq := scriptorium.RenderArtifactRequest{
|
||||
Binary: env.Config.Pipeline.Scriptorium.Binary,
|
||||
ConfigPath: env.Config.Pipeline.Scriptorium.ConfigPath,
|
||||
Credentials: env.Config.Pipeline.Scriptorium.Credentials,
|
||||
PromptID: boundsCfg.PromptID,
|
||||
ProfileID: boundsCfg.ProfileID,
|
||||
Binary: requestContext.Binary,
|
||||
ConfigPath: requestContext.ConfigPath,
|
||||
Credentials: requestContext.Credentials,
|
||||
PromptID: requestContext.PromptID,
|
||||
ProfileID: requestContext.ProfileID,
|
||||
InputPaths: inputPaths,
|
||||
Vars: vars,
|
||||
OutputPath: renderOutputPath,
|
||||
@@ -209,11 +210,11 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
}
|
||||
|
||||
boundsReq := scriptorium.RunArtifactRequest{
|
||||
Binary: env.Config.Pipeline.Scriptorium.Binary,
|
||||
ConfigPath: env.Config.Pipeline.Scriptorium.ConfigPath,
|
||||
Credentials: env.Config.Pipeline.Scriptorium.Credentials,
|
||||
PromptID: boundsCfg.PromptID,
|
||||
ProfileID: boundsCfg.ProfileID,
|
||||
Binary: requestContext.Binary,
|
||||
ConfigPath: requestContext.ConfigPath,
|
||||
Credentials: requestContext.Credentials,
|
||||
PromptID: requestContext.PromptID,
|
||||
ProfileID: requestContext.ProfileID,
|
||||
InputPaths: inputPaths,
|
||||
Vars: vars,
|
||||
OutputPath: boundsOutputPath,
|
||||
|
||||
Reference in New Issue
Block a user