Skip to content

Commit

Permalink
The Google Cloud Batch backend name was changed from batch to GCPBATC…
Browse files Browse the repository at this point in the history
…H midway through the development work and some references were missed. Updates the backend name in tests and documentation. The second set of changes fixes failing tests. GCP Batch error messages can vary and this behavior was also seen in PAPIv2. The expected failure messages are simplified to catch failed jobs.
  • Loading branch information
dspeck1 committed Jan 20, 2025
1 parent a00a190 commit 0c93ca1
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ metadata {
"calls.required_files.check_it.executionStatus": "Done"
"calls.required_files.do_it.executionStatus": "Failed"
"calls.required_files.do_it.retryableFailure": "false"
"calls.required_files.do_it.failures.0.message": ~~"Job failed due to task failure. Specifically, task with index 0 failed due to the following task event: \"Task state is updated from RUNNING to FAILED"
"calls.required_files.do_it.failures.0.message": ~~"failed"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ metadata {
workflowName: requester_pays_localization
status: Failed
"failures.0.message": "Workflow failed"
"failures.0.causedBy.0.message": ~~"Job failed due to task failure. Specifically, task with index 0 failed due to the following task event: \"Task state is updated from RUNNING to FAILED"
"failures.0.causedBy.0.message": ~~"failed"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata {
workflowName: retry_same_memory_output_failure
status: Failed
"failures.0.message": "Workflow failed"
"failures.0.causedBy.0.message": ~~"exit code 1."
"failures.0.causedBy.0.message": ~~"failed"
"retry_same_memory_output_failure.imitate_oom_error.-1.1.executionStatus": "RetryableFailure"
"retry_same_memory_output_failure.imitate_oom_error.-1.1.runtimeAttributes.memory": "1 GB"
"retry_same_memory_output_failure.imitate_oom_error.-1.2.executionStatus": "RetryableFailure"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: requester_pays_localization_negative
testFormat: workflowfailure
# Papiv2 backend configured SA does not have permission to bill the project, so this workflow should fail
backends: [Papiv2, GCPBATCH_ALT]
backends: [Papiv2]
workflowType: WDL
workflowTypeVersion: 1.0
tags: ["wdl_1.0"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: requester_pays_localization_negative_gcpbatch
testFormat: workflowfailure
# GCP Batch backend configured SA does not have permission to bill the project, so this workflow should fail. Duplicate of PAPI test since different error message.
backends: [GCPBATCH_ALT]
workflowType: WDL
workflowTypeVersion: 1.0
tags: ["wdl_1.0"]

files {
workflow: requester_pays_gcs/localization.wdl
}

metadata {
workflowName: requester_pays_localization
status: Failed
"failures.0.message": "Workflow failed"
"failures.0.causedBy.0.message": "Task requester_pays_localization.localize:NA:1 failed: vmEndTime"
}
2 changes: 1 addition & 1 deletion cromwell.example.backends/GCPBATCH.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ backend {
# Defaults to 7 days; max 30 days
# batch-timeout = 7 days

genomics {
batch {
# A reference to an auth defined in the `google` stanza at the top. This auth is used to create
# Batch Jobs and manipulate auth JSONs.
auth = "application-default"
Expand Down
2 changes: 1 addition & 1 deletion docs/backends/GCPBatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Google Cloud Batch is a fully managed service that lets you schedule, queue, and

This section offers detailed configuration instructions for using Cromwell with the Google Cloud Batch in all supported
authentication modes. Before reading further in this section please see the
[Getting started on Google Cloud Batch](../tutorials/Batch101) for instructions common to all authentication modes
[Getting started on Google Cloud Batch](../tutorials/GcpBatch101) for instructions common to all authentication modes
and detailed instructions for the application default authentication scheme in particular.
The instructions below assume you have created a Google Cloud Storage bucket and a Google project enabled for the appropriate APIs.

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/Batch101.md → docs/tutorials/GcpBatch101.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ engine {
}
backend {
default = batch
default = GCPBATCH
providers {
batch {
GCPBATCH {
actor-factory = "cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory"
config {
# Google project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ class GcpBatchAsyncBackendJobExecutionActorSpec

// TODO: FIXME
// Cause: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
// For some reason this invokes GCP but it should not
// Will be addressed by another ticket
it should "convert local Paths back to corresponding GCS paths in BatchOutputs" in {
pending

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GcpBatchConfigurationAttributesSpec
it should "parse correct Batch config" in {
val backendConfig = ConfigFactory.parseString(configString())

val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.project should be("myProject")
gcpBatchAttributes.executionBucket should be("gs://myBucket")
gcpBatchAttributes.maxPollingInterval should be(600)
Expand All @@ -42,7 +42,7 @@ class GcpBatchConfigurationAttributesSpec

val backendConfig = ConfigFactory.parseString(configString(customContent = "preemptible = 3"))

val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.project should be("myProject")
gcpBatchAttributes.executionBucket should be("gs://myBucket")
gcpBatchAttributes.maxPollingInterval should be(600)
Expand All @@ -61,7 +61,7 @@ class GcpBatchConfigurationAttributesSpec
""".stripMargin

val backendConfig = ConfigFactory.parseString(configString(customContent = customContent))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")

gcpBatchAttributes.batchRequestTimeoutConfiguration.readTimeoutMillis.get.value should be(100.hours.toMillis.toInt)
gcpBatchAttributes.batchRequestTimeoutConfiguration.connectTimeoutMillis.get.value should be(
Expand All @@ -82,23 +82,23 @@ class GcpBatchConfigurationAttributesSpec
""".stripMargin

val backendConfig = ConfigFactory.parseString(configString(customContent = customContent))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")

gcpBatchAttributes.batchRequestTimeoutConfiguration should be(BatchRequestTimeoutConfiguration(None, None))
}

it should "parse batch-timeout" in {

val backendConfig = ConfigFactory.parseString(configString(customContent = "batch-timeout = 3 days"))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")

gcpBatchAttributes.batchTimeout should be(3.days)
}

it should "parse an undefined batch-timeout" in {

val backendConfig = ConfigFactory.parseString(configString())
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")

gcpBatchAttributes.batchTimeout should be(7.days)
}
Expand All @@ -107,27 +107,27 @@ class GcpBatchConfigurationAttributesSpec

val backendConfig = ConfigFactory.parseString(configString(batch = """compute-service-account = "testing" """))

val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.computeServiceAccount should be("testing")
}

it should "parse localization-attempts" in {

val backendConfig = ConfigFactory.parseString(configString(batch = "localization-attempts = 31380"))

val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.gcsTransferConfiguration.transferAttempts.value should be(31380)
}

it should "parse logs-policy = CLOUD_LOGGING" in {
val backendConfig = ConfigFactory.parseString(configString(batch = "logs-policy = CLOUD_LOGGING"))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.logsPolicy should be(GcpBatchLogsPolicy.CloudLogging)
}

it should "parse logs-policy = PATH" in {
val backendConfig = ConfigFactory.parseString(configString(batch = "logs-policy = PATH"))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.logsPolicy should be(GcpBatchLogsPolicy.Path)
}

Expand All @@ -136,7 +136,7 @@ class GcpBatchConfigurationAttributesSpec
"Google Cloud Batch configuration is not valid: Errors:\nUnrecognized logs policy entry: INVALID. Supported strategies are CLOUD_LOGGING and PATH."
val backendConfig = ConfigFactory.parseString(configString(batch = "logs-policy = INVALID"))
val ex = intercept[IllegalArgumentException] {
GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
}

ex.getMessage should be(expected)
Expand Down Expand Up @@ -238,7 +238,7 @@ class GcpBatchConfigurationAttributesSpec
it should s"parse virtual-private-cloud $description" in {

val backendConfig = ConfigFactory.parseString(configString(customConfig))
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
val gcpBatchAttributes = GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
gcpBatchAttributes.virtualPrivateCloudConfiguration should be(vpcConfig)
}
}
Expand All @@ -248,7 +248,7 @@ class GcpBatchConfigurationAttributesSpec

val backendConfig = ConfigFactory.parseString(configString(customConfig))
val exception = intercept[IllegalArgumentException with MessageAggregation] {
GcpBatchConfigurationAttributes(googleConfig, backendConfig, "batch")
GcpBatchConfigurationAttributes(googleConfig, backendConfig, "GCPBATCH")
}
exception.errorMessages.toList should be(errorMessages)
}
Expand All @@ -266,7 +266,7 @@ class GcpBatchConfigurationAttributesSpec
""".stripMargin)

val exception = intercept[IllegalArgumentException with MessageAggregation] {
GcpBatchConfigurationAttributes(googleConfig, nakedConfig, "batch")
GcpBatchConfigurationAttributes(googleConfig, nakedConfig, "GCPBATCH")
}
val errorsList = exception.errorMessages.toList
errorsList should contain("String: 2: No configuration setting found for key 'project'")
Expand All @@ -287,7 +287,6 @@ class GcpBatchConfigurationAttributesSpec
| // Pipelines and manipulate auth JSONs.
| auth = "mock"
| $batch
| endpoint-url = "http://myEndpoint"
| location = "us-central1"
| }
|
Expand Down Expand Up @@ -325,7 +324,7 @@ class GcpBatchConfigurationAttributesSpec

val backendConfig = ConfigFactory.parseString(configString())

val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "batch")
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "GCPBATCH")

validation shouldBe None.validNel
}
Expand All @@ -336,7 +335,7 @@ class GcpBatchConfigurationAttributesSpec

val backendConfig = ConfigFactory.parseString(configString(customContent = manifestConfig))

val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "batch")
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "GCPBATCH")

validation shouldBe Option(List.empty).validNel
}
Expand Down Expand Up @@ -373,7 +372,7 @@ class GcpBatchConfigurationAttributesSpec
|]
|""".stripMargin
val backendConfig = ConfigFactory.parseString(configString(manifestConfig))
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "batch")
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "GCPBATCH")
val manifests: List[ManifestFile] = validation.toEither.toOption.get.get

manifests shouldBe List(
Expand Down Expand Up @@ -442,7 +441,7 @@ class GcpBatchConfigurationAttributesSpec
badValues foreach { badValue =>
val customContent = s""""reference-disk-localization-manifests" = $badValue"""
val backendConfig = ConfigFactory.parseString(configString(customContent))
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "batch")
val validation = GcpBatchConfigurationAttributes.validateReferenceDiskManifestConfigs(backendConfig, "GCPBATCH")
validation.isInvalid shouldBe true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ object GcpBatchTestConfig {
|}
|
|backend {
| default = "batch"
| default = "GCPBATCH"
| providers {
| batch {
| GCPBATCH {
| actor-factory = "cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory"
| config {
| $BatchBackendConfigString
Expand All @@ -108,7 +108,7 @@ object GcpBatchTestConfig {
Await.result(BatchBackendConfigurationDescriptor.pathBuilders(WorkflowOptions.empty), 5.seconds)
val googleConfiguration: GoogleConfiguration = GoogleConfiguration(BatchGlobalConfig)
val batchAttributes: GcpBatchConfigurationAttributes =
GcpBatchConfigurationAttributes(googleConfiguration, BatchBackendConfig, "batch")
GcpBatchConfigurationAttributes(googleConfiguration, BatchBackendConfig, "GCPBATCH")
val gcpBatchConfiguration =
new GcpBatchConfiguration(BatchBackendConfigurationDescriptor, googleConfiguration, batchAttributes)
}

0 comments on commit 0c93ca1

Please sign in to comment.