Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WX-926 GCP Batch Backend Executor Test Fix #7588

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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": "Actual value "Task requester_pays_localization.localize:NA:1 failed: vmEndTime" does not contain 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"
}
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
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 @@ -859,7 +859,6 @@ class GcpBatchAsyncBackendJobExecutionActorSpec
// Cause: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
// For some reason this invokes GCP but it should not
it should "convert local Paths back to corresponding GCS paths in BatchOutputs" in {
pending

val batchOutputs = Set(
GcpBatchFileOutput(
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 @@ -282,7 +282,7 @@ class GcpBatchConfigurationAttributesSpec
| root = "gs://myBucket"
| maximum-polling-interval = 600
| $customContent
| batch {
| GCPBATCH {
| // A reference to an auth defined in the `google` stanza at the top. This auth is used to create
| // Pipelines and manipulate auth JSONs.
| auth = "mock"
Expand Down Expand Up @@ -325,7 +325,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 +336,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 +373,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 +442,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)
}
Loading