From 5da8a85623a30f4fa49bbe748ee5351abbbf93cf Mon Sep 17 00:00:00 2001 From: Miguel Covarrubias Date: Wed, 25 Sep 2024 11:00:35 -0400 Subject: [PATCH] call cache prefixes --- .../call_cache_hit_prefixes_empty_hint_papi.test | 2 +- ...hit_prefixes_two_roots_empty_hint_cache_hit_papi.test | 2 +- ...it_prefixes_two_roots_empty_hint_cache_miss_papi.test | 2 +- .../google/batch/models/GcpBatchWorkflowPaths.scala | 9 --------- .../google/batch/models/GcpBatchWorkflowPathsSpec.scala | 6 ------ 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_empty_hint_papi.test b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_empty_hint_papi.test index 77d4623f765..66f0e5f3975 100644 --- a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_empty_hint_papi.test +++ b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_empty_hint_papi.test @@ -1,7 +1,7 @@ # A list of call cache hint prefixes is explicitly specified but empty. name: call_cache_hit_prefixes_empty_hint_papi testFormat: runtwiceexpectingcallcaching -backends: [Papi, GCPBATCH] +backends: [Papi, GCPBATCH_CALL_CACHE_PREFIXES_NOT_IMPLEMENTED] files { workflow: call_cache_hit_prefixes/call_cache_hit_prefixes.wdl diff --git a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_hit_papi.test b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_hit_papi.test index 98efc39ea5c..4e27c068f8a 100644 --- a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_hit_papi.test +++ b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_hit_papi.test @@ -4,7 +4,7 @@ name: call_cache_hit_prefixes_two_roots_empty_hint_cache_hit_papi testFormat: runthriceexpectingcallcaching # don't know -backends: [Papi, GCPBATCH_FAIL] +backends: [Papi, GCPBATCH_CALL_CACHE_PREFIXES_NOT_IMPLEMENTED] files { workflow: call_cache_hit_prefixes/call_cache_hit_prefixes.wdl diff --git a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi.test b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi.test index 738f3c38361..6161ecd0ce7 100644 --- a/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi.test +++ b/centaur/src/main/resources/standardTestCases/call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi.test @@ -7,7 +7,7 @@ testFormat: runtwiceexpectingnocallcaching # should NOT call cache the second run of call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi *** FAILED *** (11 minutes, 11 seconds) # centaur.test.CentaurTestException: Found unexpected cache hits for call_cache_hit_prefixes_two_roots_empty_hint_cache_miss_papi: # calls.call_cache_hit_prefixes.yo.callCaching.result: Cache Hit: 19e522ed-685e-4c53-9d49-949d8b05a2a9:call_cache_hit_prefixes.yo:-1 -backends: [Papi, GCPBATCH_FAIL] +backends: [Papi, GCPBATCH_CALL_CACHE_PREFIXES_NOT_IMPLEMENTED] files { workflow: call_cache_hit_prefixes/call_cache_hit_prefixes.wdl diff --git a/supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPaths.scala b/supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPaths.scala index 12145a23c8f..7f656bba698 100644 --- a/supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPaths.scala +++ b/supportedBackends/google/batch/src/main/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPaths.scala @@ -2,7 +2,6 @@ package cromwell.backend.google.batch.models import com.google.auth.Credentials import com.typesafe.config.Config -import cromwell.backend.google.batch.models.GcpBatchWorkflowPaths.callCachePathPrefixFromExecutionRoot import cromwell.backend.google.batch.runnable.WorkflowOptionKeys import cromwell.backend.io.WorkflowPaths import cromwell.backend.{BackendJobDescriptorKey, BackendWorkflowDescriptor} @@ -14,11 +13,6 @@ import scala.concurrent.ExecutionContext object GcpBatchWorkflowPaths { val GcsRootOptionKey = "gcp_batch_gcs_root" - private val GcsPrefix = "gs://" - - private[models] def callCachePathPrefixFromExecutionRoot(executionRoot: String): String = - // If the root looks like gs://bucket/stuff-under-bucket this should return gs://bucket - GcsPrefix + executionRoot.substring(GcsPrefix.length).takeWhile(_ != '/') } case class GcpBatchWorkflowPaths(workflowDescriptor: BackendWorkflowDescriptor, gcsCredentials: Credentials, @@ -31,9 +25,6 @@ case class GcpBatchWorkflowPaths(workflowDescriptor: BackendWorkflowDescriptor, override lazy val executionRootString: String = workflowDescriptor.workflowOptions.getOrElse(GcpBatchWorkflowPaths.GcsRootOptionKey, gcpBatchConfiguration.root) - override lazy val callCacheRootPrefix: Option[String] = Option( - callCachePathPrefixFromExecutionRoot(executionRootString) - ) private val workflowOptions: WorkflowOptions = workflowDescriptor.workflowOptions diff --git a/supportedBackends/google/batch/src/test/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPathsSpec.scala b/supportedBackends/google/batch/src/test/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPathsSpec.scala index 2417d4cf044..a0afa5b9e36 100644 --- a/supportedBackends/google/batch/src/test/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPathsSpec.scala +++ b/supportedBackends/google/batch/src/test/scala/cromwell/backend/google/batch/models/GcpBatchWorkflowPathsSpec.scala @@ -40,10 +40,4 @@ class GcpBatchWorkflowPathsSpec extends TestKitSuite with AnyFlatSpecLike with M workflowPaths.workflowRoot.pathAsString should be(s"gs://my-cromwell-workflows-bucket/wf_hello/${workflowDescriptor.id}/") } - - it should "calculate the call cache path prefix from the workflow execution root correctly" in { - val WorkspaceBucket = "gs://workspace-id" - val ExecutionRoot = WorkspaceBucket + "/submission-id" - GcpBatchWorkflowPaths.callCachePathPrefixFromExecutionRoot(ExecutionRoot) shouldBe WorkspaceBucket - } }