Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr committed Sep 13, 2024
1 parent f532076 commit d818ddb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions backend/src/main/scala/cromwell/backend/io/JobPaths.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ object JobPaths {
val ScriptPathKey = "script"
val StdoutPathKey = "stdout"
val StdErrPathKey = "stderr"
val TaskLogPathKey = "taskLog"
val ReturnCodePathKey = "returnCode"
val CallRootPathKey = "callRootPath"
val DockerCidPathKey = "dockerCidPath"
Expand Down Expand Up @@ -45,6 +46,7 @@ trait JobPaths {
def defaultStderrFilename = "stderr"
def defaultTaskLogFilename = "task.log"
def isDocker: Boolean = false
def implementsTaskLogging: Boolean = false

// In this non-Docker version of `JobPaths` there is no distinction between host and container roots so this is
// just called 'rootWithSlash'.
Expand Down Expand Up @@ -87,9 +89,8 @@ trait JobPaths {
// standard output and error file names.
def standardOutputAndErrorPaths: Map[String, Path] = Map(
CallMetadataKeys.Stdout -> standardPaths.output,
CallMetadataKeys.Stderr -> standardPaths.error,
CallMetadataKeys.TaskLog -> standardPaths.taskLog
)
CallMetadataKeys.Stderr -> standardPaths.error
) ++ (if (implementsTaskLogging) Map(CallMetadataKeys.TaskLog -> standardPaths.taskLog) else Map.empty)

private lazy val commonMetadataPaths: Map[String, Path] =
standardOutputAndErrorPaths + (CallMetadataKeys.CallRoot -> callRoot)
Expand All @@ -102,7 +103,7 @@ trait JobPaths {
JobPaths.StdoutPathKey -> standardPaths.output,
JobPaths.StdErrPathKey -> standardPaths.error,
JobPaths.ReturnCodePathKey -> returnCode
)
) ++ (if (implementsTaskLogging) Map(JobPaths.TaskLogPathKey -> standardPaths.taskLog) else Map.empty)

private lazy val commonLogPaths: Map[String, Path] = Map(
JobPaths.StdoutPathKey -> standardPaths.output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ trait StandardAsyncExecutionActor
|touch $stdoutRedirection $stderrRedirection
|tee $stdoutRedirection < "$$$out" &
|tee $stderrRedirection < "$$$err" >&2 &
|tail -q -f $stdoutRedirection $stderrRedirection > $taskLogRedirection &
|${if (jobPaths.implementsTaskLogging) s"tail -q -f $stdoutRedirection $stderrRedirection > $taskLogRedirection &" else ""}
|(
|cd ${cwd.pathAsString}
|ENVIRONMENT_VARIABLES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object CallMetadataKeys {
val Failures = "failures"
val Stdout = "stdout"
val Stderr = "stderr"
val TaskLog = "task.log"
val TaskLog = "taskLog"
val BackendLogsPrefix = "backendLogs"
val BackendStatus = "backendStatus"
val JobId = "jobId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ case class GcpBatchJobPaths(override val workflowPaths: GcpBatchWorkflowPaths,
s"${jobKey.node.localName}$index"
}

override def implementsTaskLogging: Boolean = true

val batchLogFilename: String = s"$batchLogBasename.log"
lazy val batchLogPath: Path = callExecutionRoot.resolve(batchLogFilename)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,8 @@ class GcpBatchAsyncBackendJobExecutionActorSpec
"runtimeAttributes:zones" -> "us-central1-b,us-central1-a",
"runtimeAttributes:maxRetries" -> "0",
"stderr" -> s"$batchGcsRoot/wf_hello/$workflowId/call-goodbye/stderr",
"stdout" -> s"$batchGcsRoot/wf_hello/$workflowId/call-goodbye/stdout"
"stdout" -> s"$batchGcsRoot/wf_hello/$workflowId/call-goodbye/stdout",
"taskLog" -> s"$batchGcsRoot/wf_hello/$workflowId/call-goodbye/task.log"
)
)

Expand Down

0 comments on commit d818ddb

Please sign in to comment.