-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
c011202
commit 28cdba7
Showing
83 changed files
with
11,702 additions
and
926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
centaur/src/main/resources/standardTestCases/biscayne_prohibits_directory.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: directory_type_local_denied | ||
testFormat: workflowfailure | ||
tags: [localdockertest, "wdl_biscayne"] | ||
backends: [Local, LocalNoDocker] | ||
|
||
files { | ||
workflow: wdl_biscayne/biscayne_prohibits_directory/directory_type.wdl | ||
inputs: wdl_biscayne/biscayne_prohibits_directory/directory_type_local_inputs.json | ||
} | ||
|
||
metadata { | ||
status: Failed | ||
} |
6 changes: 3 additions & 3 deletions
6
centaur/src/main/resources/standardTestCases/directory_type_local.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
centaur/src/main/resources/standardTestCases/directory_type_output_papi.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
centaur/src/main/resources/standardTestCases/directory_type_papi.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...dTestCases/wdl_biscayne/biscayne_http_relative_imports/biscayne_http_relative_imports.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ardTestCases/wdl_biscayne/biscayne_new_engine_functions/biscayne_new_engine_functions.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version development | ||
version development-1.1 | ||
|
||
workflow biscayne_new_engine_functions { | ||
|
||
|
49 changes: 49 additions & 0 deletions
49
.../resources/standardTestCases/wdl_biscayne/biscayne_prohibits_directory/directory_type.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version development-1.1 | ||
|
||
workflow directory_type { | ||
input { | ||
String text2loc = "text2" | ||
} | ||
call make_directory { input: text2loc = text2loc } | ||
call read_from_directory { input: d = make_directory.d, text2loc = text2loc } | ||
|
||
output { | ||
Array[String] out = read_from_directory.contents | ||
} | ||
} | ||
|
||
task make_directory { | ||
input { | ||
String text2loc | ||
} | ||
String text2dir = sub("foo/~{text2loc}", "/[^/]*$", "") | ||
command { | ||
mkdir foo | ||
mkdir -p ~{text2dir} | ||
echo "foo text" > foo/text | ||
echo "foo text2" > foo/~{text2loc} | ||
} | ||
runtime { | ||
docker: "ubuntu:latest" | ||
} | ||
output { | ||
Directory d = "foo/" | ||
} | ||
} | ||
|
||
task read_from_directory { | ||
input { | ||
String text2loc | ||
Directory d | ||
} | ||
command { | ||
cat ~{d}/text | ||
cat ~{d}/~{text2loc} | ||
} | ||
runtime { | ||
docker: "ubuntu:latest" | ||
} | ||
output { | ||
Array[String] contents = read_lines(stdout()) | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...aur/src/main/resources/standardTestCases/wdl_biscayne/default_default/default_default.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version development | ||
version development-1.1 | ||
|
||
workflow default_default { | ||
call default_default_task | ||
|
2 changes: 1 addition & 1 deletion
2
.../wdl_biscayne/read_functions_windows_line_endings/read_functions_windows_line_endings.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version development | ||
version development-1.1 | ||
|
||
struct JsonObj { | ||
String field1 | ||
|
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
.../resources/standardTestCases/wdl_cascades/directory_type/directory_type_local_inputs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory_type.text2loc": "bar/text2" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...ories/wdl-cascades/src/main/scala/languages/wdl/cascades/WdlCascadesLanguageFactory.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package languages.wdl.cascades | ||
|
||
import java.util.concurrent.Callable | ||
|
||
import cats.syntax.either._ | ||
import cats.instances.either._ | ||
import cats.data.EitherT.fromEither | ||
import cats.effect.IO | ||
import com.typesafe.config.Config | ||
import common.Checked | ||
import common.transforms.CheckedAtoB | ||
import common.validation.ErrorOr.ErrorOr | ||
import common.validation.IOChecked.IOChecked | ||
import cromwell.core._ | ||
import cromwell.languages.util.ImportResolver._ | ||
import cromwell.languages.util.{LanguageFactoryUtil, ParserCache} | ||
import cromwell.languages.util.ParserCache.ParserCacheInputs | ||
import cromwell.languages.{LanguageFactory, ValidatedWomNamespace} | ||
import wdl.transforms.base.wdlom2wom.WomBundleToWomExecutable._ | ||
import wdl.transforms.base.wdlom2wom._ | ||
import wdl.transforms.cascades.ast2wdlom._ | ||
import wdl.transforms.cascades.parsing._ | ||
import wdl.transforms.cascades.wdlom2wom._ | ||
import wom.ResolvedImportRecord | ||
import wom.core.{WorkflowJson, WorkflowOptionsJson, WorkflowSource} | ||
import wom.executable.WomBundle | ||
import wom.expression.IoFunctionSet | ||
import wom.transforms.WomExecutableMaker.ops._ | ||
|
||
class WdlCascadesLanguageFactory(override val config: Config) extends LanguageFactory with ParserCache[WomBundle] { | ||
|
||
override val languageName: String = "WDL" | ||
override val languageVersionName: String = "Cascades" | ||
|
||
override def validateNamespace(source: WorkflowSourceFilesCollection, | ||
workflowSource: WorkflowSource, | ||
workflowOptions: WorkflowOptions, | ||
importLocalFilesystem: Boolean, | ||
workflowIdForLogging: WorkflowId, | ||
ioFunctions: IoFunctionSet, | ||
importResolvers: List[ImportResolver]): IOChecked[ValidatedWomNamespace] = { | ||
|
||
val factories: List[LanguageFactory] = List(this) | ||
|
||
val checked: Checked[ValidatedWomNamespace] = for { | ||
_ <- enabledCheck | ||
bundle <- getWomBundle(workflowSource, workflowSourceOrigin = None, source.workflowOptions.asPrettyJson, importResolvers, factories) | ||
executable <- createExecutable(bundle, source.inputsJson, ioFunctions) | ||
} yield executable | ||
|
||
fromEither[IO](checked) | ||
|
||
} | ||
|
||
override def getWomBundle(workflowSource: WorkflowSource, | ||
workflowSourceOrigin: Option[ResolvedImportRecord], | ||
workflowOptionsJson: WorkflowOptionsJson, | ||
importResolvers: List[ImportResolver], | ||
languageFactories: List[LanguageFactory], | ||
convertNestedScatterToSubworkflow : Boolean = true): Checked[WomBundle] = { | ||
|
||
val converter: CheckedAtoB[FileStringParserInput, WomBundle] = stringToAst andThen wrapAst andThen astToFileElement.map(FileElementToWomBundleInputs(_, workflowOptionsJson, convertNestedScatterToSubworkflow, importResolvers, languageFactories, workflowDefinitionElementToWomWorkflowDefinition, taskDefinitionElementToWomTaskDefinition)) andThen fileElementToWomBundle | ||
|
||
lazy val validationCallable = new Callable[ErrorOr[WomBundle]] { | ||
def call: ErrorOr[WomBundle] = converter | ||
.run(FileStringParserInput(workflowSource, workflowSourceOrigin.map(_.importPath).getOrElse("input.wdl"))) | ||
.map(b => b.copyResolvedImportRecord(b, workflowSourceOrigin)).toValidated | ||
} | ||
|
||
lazy val parserCacheInputs = ParserCacheInputs(Option(workflowSource), workflowSourceOrigin.map(_.importPath), None, importResolvers) | ||
|
||
for { | ||
_ <- enabledCheck | ||
womBundle <- retrieveOrCalculate(parserCacheInputs, validationCallable).toEither | ||
} yield womBundle | ||
} | ||
|
||
override def createExecutable(womBundle: WomBundle, inputsJson: WorkflowJson, ioFunctions: IoFunctionSet): Checked[ValidatedWomNamespace] = { | ||
for { | ||
_ <- enabledCheck | ||
executable <- womBundle.toWomExecutable(Option(inputsJson), ioFunctions, strictValidation) | ||
validated <- LanguageFactoryUtil.validateWomNamespace(executable, ioFunctions) | ||
} yield validated | ||
} | ||
|
||
override def looksParsable(content: String): Boolean = LanguageFactoryUtil.simpleLooksParseable(List("version development"), List("#"))(content) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.