Skip to content

Commit

Permalink
Use unified var for driver / launcher log level + patch user code
Browse files Browse the repository at this point in the history
launcher

Signed-off-by: carter.fendley <carter.fendley@gmail.com>
  • Loading branch information
CarterFendley committed Feb 20, 2025
1 parent 5741ce9 commit d4dacb3
Show file tree
Hide file tree
Showing 8 changed files with 372 additions and 34 deletions.
19 changes: 10 additions & 9 deletions backend/src/v2/cmd/driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,16 @@ func drive() (err error) {
return err
}
options := driver.Options{
PipelineName: *pipelineName,
RunID: *runID,
RunName: *runName,
RunDisplayName: *runDisplayName,
Namespace: namespace,
Component: componentSpec,
Task: taskSpec,
DAGExecutionID: *dagExecutionID,
IterationIndex: *iterationIndex,
PipelineName: *pipelineName,
RunID: *runID,
RunName: *runName,
RunDisplayName: *runDisplayName,
Namespace: namespace,
Component: componentSpec,
Task: taskSpec,
DAGExecutionID: *dagExecutionID,
IterationIndex: *iterationIndex,
PipelineLogLevel: *logLevel,
}
var execution *driver.Execution
var driverErr error
Expand Down
6 changes: 6 additions & 0 deletions backend/src/v2/compiler/argocompiler/argo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func Test_argo_compiler(t *testing.T) {
argoYAMLPath: "testdata/hello_world_run_as_user.yaml",
envVars: map[string]string{"PIPELINE_RUN_AS_USER": "1001"},
},
{
jobPath: "../testdata/hello_world.json",
platformSpecPath: "",
argoYAMLPath: "testdata/hello_world_log_level.yaml",
envVars: map[string]string{"PIPELINE_LOG_LEVEL": "3"},
},
}
for _, tt := range tests {
t.Run(fmt.Sprintf("%+v", tt), func(t *testing.T) {
Expand Down
7 changes: 3 additions & 4 deletions backend/src/v2/compiler/argocompiler/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ const (
DefaultDriverCommand = "driver"
DriverCommandEnvVar = "V2_DRIVER_COMMAND"
PipelineRunAsUserEnvVar = "PIPELINE_RUN_AS_USER"
DriverLogLevelEnvVar = "DRIVER_LOG_LEVEL"
LauncherLogLevelEnvVar = "LAUNCHER_LOG_LEVEL"
PipelineLogLevelEnvVar = "PIPELINE_LOG_LEVEL"
gcsScratchLocation = "/gcs"
gcsScratchName = "gcs-scratch"
s3ScratchLocation = "/s3"
Expand Down Expand Up @@ -181,7 +180,7 @@ func (c *workflowCompiler) addContainerDriverTemplate() string {
"--condition_path", outputPath(paramCondition),
"--kubernetes_config", inputValue(paramKubernetesConfig),
}
if value, ok := os.LookupEnv(DriverLogLevelEnvVar); ok {
if value, ok := os.LookupEnv(PipelineLogLevelEnvVar); ok {
args = append(args, "--log_level", value)
}

Expand Down Expand Up @@ -299,7 +298,7 @@ func (c *workflowCompiler) addContainerExecutorTemplate(refName string) string {
args := []string{
"--copy", component.KFPLauncherPath,
}
if value, ok := os.LookupEnv(LauncherLogLevelEnvVar); ok {
if value, ok := os.LookupEnv(PipelineLogLevelEnvVar); ok {
args = append(args, "--log_level", value)
}
executor := &wfapi.Template{
Expand Down
2 changes: 1 addition & 1 deletion backend/src/v2/compiler/argocompiler/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func (c *workflowCompiler) addDAGDriverTemplate() string {
"--iteration_count_path", outputPath(paramIterationCount),
"--condition_path", outputPath(paramCondition),
}
if value, ok := os.LookupEnv(DriverLogLevelEnvVar); ok {
if value, ok := os.LookupEnv(PipelineLogLevelEnvVar); ok {
args = append(args, "--log_level", value)
}

Expand Down
2 changes: 1 addition & 1 deletion backend/src/v2/compiler/argocompiler/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c *workflowCompiler) addImporterTemplate() string {
"--mlmd_server_port",
fmt.Sprintf("$(%s)", component.EnvMetadataPort),
}
if value, ok := os.LookupEnv(LauncherLogLevelEnvVar); ok {
if value, ok := os.LookupEnv(PipelineLogLevelEnvVar); ok {
args = append(args, "--log_level", value)
}
importerTemplate := &wfapi.Template{
Expand Down
Loading

0 comments on commit d4dacb3

Please sign in to comment.