Skip to content

Commit

Permalink
WX-927 monitor log fixes for GCP Batch backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr committed Sep 18, 2024
1 parent dde735a commit 0c87129
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Test to confirm the output of the monitoring script will be written to a monitoring.log file

name: gcpbatch_monitoring_log
testFormat: workflowsuccess
backends: [GCPBATCH]

files {
workflow: monitoring_log/monitoring_log.wdl
options: monitoring_log/monitoring_log.options
}

metadata {
"calls.monitoring_log.get_stats.gcpBatch.monitoringScript": "gs://cloud-cromwell-dev/some/rounding_script_int.sh"
"calls.monitoring_log.get_stats.monitoringLog": "gs://cloud-cromwell-dev-self-cleaning/cromwell_execution/ci/monitoring_log/<<UUID>>/call-get_stats/monitoring.log"
"outputs.monitoring_log.get_stats.stats.0": "CPU: 1"
"outputs.monitoring_log.get_stats.stats.1": "Total Memory: 2G"
"outputs.monitoring_log.get_stats.stats.2": "Total Disk space: 9G"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

name: monitoring_log
testFormat: workflowsuccess
# see doc 2.14
backends: [Papiv2, GCPBATCH_FAIL]
backends: [Papiv2, GCPBATCH_ALT]

files {
workflow: monitoring_log/monitoring_log.wdl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cromwell.backend.google.batch.models

import cromwell.backend.BackendJobDescriptorKey
import cromwell.backend.google.batch.runnable.GcpBatchMetadataKeys
import cromwell.backend.io.JobPaths
import cromwell.core.path.Path

Expand Down Expand Up @@ -36,5 +37,21 @@ case class GcpBatchJobPaths(override val workflowPaths: GcpBatchWorkflowPaths,
val batchMonitoringScriptFilename: String = s"${GcpBatchJobPaths.BatchMonitoringKey}.sh"
val batchMonitoringImageScriptFilename: String = s"${GcpBatchJobPaths.BatchMonitoringImageKey}.sh"

val jesMonitoringLogFilename: String = s"${GcpBatchJobPaths.BatchMonitoringKey}.log"
lazy val jesMonitoringLogPath: Path = callExecutionRoot.resolve(jesMonitoringLogFilename)

override lazy val customMetadataPaths =
workflowPaths.monitoringScriptPath map { p =>
Map(GcpBatchMetadataKeys.MonitoringScript -> p,
GcpBatchMetadataKeys.MonitoringLog -> jesMonitoringLogPath
)
} getOrElse Map.empty

override def standardOutputAndErrorPaths: Map[String, Path] =
super.standardOutputAndErrorPaths map { case (k, v) =>
val updated = workflowPaths.standardStreamNameToFileNameMetadataMapper(this, k)
k -> v.parent.resolve(updated)

Check warning on line 53 in supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchJobPaths.scala

View check run for this annotation

Codecov / codecov/patch

supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchJobPaths.scala#L51-L53

Added lines #L51 - L53 were not covered by tests
}

override def forCallCacheCopyAttempts: JobPaths = this.copy(isCallCacheCopyAttempt = true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ object GcpBatchMetadataKeys {
val GoogleProject = "gcpBatch:googleProject"
val ExecutionBucket = "gcpBatch:executionBucket"
val MonitoringScript = "gcpBatch:monitoringScript"
val MonitoringLog = "monitoringLog"

Check warning on line 7 in supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/runnable/GcpBatchMetadataKeys.scala

View check run for this annotation

Codecov / codecov/patch

supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/runnable/GcpBatchMetadataKeys.scala#L7

Added line #L7 was not covered by tests
// TODO unused metadata keys below, this is probably not right and there may not be tests to cover these
val MachineType = "gcpBatch:machineType"
val Zone = "gcpBatch:zone"
val InstanceName = "gcpBatch:instanceName"
val MonitoringLog = "monitoringLog"
}

0 comments on commit 0c87129

Please sign in to comment.