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-1156 Fix internal_path_prefix #7208

Merged
merged 6 commits into from
Aug 18, 2023
Merged
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 @@ -174,5 +174,13 @@
else pathString
}

/**
* Returns the path relative to the container root.
* For example, https://{storageAccountName}.blob.core.windows.net/{containerid}/path/to/my/file
* will be returned as path/to/my/file.
* @return Path string relative to the container root.
*/
def pathWithoutContainer : String = pathString

Check warning on line 183 in filesystems/blob/src/main/scala/cromwell/filesystems/blob/BlobPathBuilder.scala

View check run for this annotation

Codecov / codecov/patch

filesystems/blob/src/main/scala/cromwell/filesystems/blob/BlobPathBuilder.scala#L183

Added line #L183 was not covered by tests

override def getSymlinkSafePath(options: LinkOption*): Path = toAbsolutePath
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cromwell.backend.io.{JobPaths, WorkflowPaths}
import cromwell.backend.{BackendJobDescriptorKey, BackendWorkflowDescriptor}
import cromwell.core.path._
import cromwell.filesystems.blob.BlobPath

object TesJobPaths {
def apply(jobKey: BackendJobDescriptorKey,
Expand All @@ -30,12 +31,16 @@

/*
* tesTaskRoot: This is the root directory that TES will use for files related to this task.
* We provide it to TES as a k/v pair where the key is "internal_path_prefix" (specified in TesWorkflowOptionKeys.scala)
* and the value is a blob path.
* TES expects a path relative to the root of the storage container.
* We provide it to TES as a k/v pair where the key is "internal_path_prefix" and the value is the relative path string.
* This is not a standard TES feature, but rather related to the Azure TES implementation that Terra uses.
* While passing it outside of terra won't do any harm, we could consider making this optional and/or configurable.
*/
val tesTaskRoot : Path = callExecutionRoot.resolve("tes_task")
private val taskFullPath = callRoot./("tes_task")
val tesTaskRoot : String = taskFullPath match {
case blob: BlobPath => blob.pathWithoutContainer

Check warning on line 41 in supportedBackends/tes/src/main/scala/cromwell/backend/impl/tes/TesJobPaths.scala

View check run for this annotation

Codecov / codecov/patch

supportedBackends/tes/src/main/scala/cromwell/backend/impl/tes/TesJobPaths.scala#L41

Added line #L41 was not covered by tests
case anyOtherPath: Path => anyOtherPath.pathAsString
}

// Given an output path, return a path localized to the storage file system
def storageOutput(path: String): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ final case class TesTask(jobDescriptor: BackendJobDescriptor,
val resources: Resources = TesTask.makeResources(
runtimeAttributes,
preferedWorkflowExecutionIdentity,
Option(tesPaths.tesTaskRoot.pathAsString)
Option(tesPaths.tesTaskRoot)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TesTaskSpec
TestConfig.emptyConfig)

val expectedKey = "internal_path_prefix"
val expectedValue = Option(tesPaths.tesTaskRoot.pathAsString)
val expectedValue = Option(tesPaths.tesTaskRoot)

//Assert path correctly ends up in the resources
val wei = Option("abc123")
Expand Down
Loading