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

[WDL Biscayne] 'after' keyword #4483

Merged
merged 19 commits into from
Jan 8, 2019
Merged

[WDL Biscayne] 'after' keyword #4483

merged 19 commits into from
Jan 8, 2019

Conversation

cjllanwarne
Copy link
Contributor

@cjllanwarne cjllanwarne commented Dec 10, 2018

Redo of #4450 but Including interaction with scatter and if blocks.

Copy link
Contributor

@aednichols aednichols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still digesting, some basic comments so far

@@ -79,6 +79,14 @@ object GraphNodePort {
lazy val conditionalNode: ConditionalNode = g(())
}

final case class NodeCompletionPort(g: Unit => GraphNode) extends OutputPort with DelayedGraphNodePort {
override lazy val identifier: WomIdentifier = {
val name = "__after" // + graphNode.localName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete if dead code

@@ -44,7 +47,14 @@ object ExecutionStore {
val upstreamPort = conditionalCollector.outputNodeToCollect.singleUpstreamPort
upstreamPort.executionNode.isInStatus(chooseIndex(upstreamPort), statusTable)
// In the general case, the dependencies are held by the upstreamPorts
case _ => key.node.upstreamPorts forall { p => p.executionNode.isInStatus(chooseIndex(p), statusTable) }
case _ =>
println(s"***** Checking completion of ${key.node.localName}'s upstreams: ${key.node.upstreamPorts.map(p => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or convert to logging call

@@ -25,6 +25,9 @@ sealed abstract class CallNode extends GraphNode {
def callType: String

def inputDefinitionMappings: InputDefinitionMappings
def mustFollow: Set[GraphNode]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super obvious whether this means

"the Set of nodes that must follow this one"

or

"this node must follow the Set of nodes"

I like the upstream/downstream naming you use elsewhere, any reason not to apply that here? Or prerequisites?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to avoid using a generic name like upstream because this is not a complete set, it's just the afters (eg to get a complete set of upstreams you add "input upstreams" and "non-input upstreams".

But I agree this is ambiguous - I'll change it while trying to preserve that distinction.

@cjllanwarne cjllanwarne changed the title WDL 'after' keyword [WDL Biscayne] 'after' keyword Dec 12, 2018
/**
* A set of prerequisites for this call which are defined *in addition to* any input-based upstream requirements.
*/
def nonInputBasedPrerequisites: Set[GraphNode]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice name choice 👍

@@ -52,7 +52,8 @@ class ExpressionAsCallInputSpec extends FlatSpec with Matchers {
val callNodeWithInputs = callNodeBuilder.build(
WomIdentifier("foo"),
CommandTaskDefinitionSpec.oneInputTask,
inputDefinitionFold
inputDefinitionFold,
Set.empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ToL] There are a lot of Set.empty's in this PR, any reason not to make it the default value?

One possible counter-reason: that would make it rather easier to forget it somewhere where it's required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I left this like this to avoid forgetting to set it in the appropriate places during implementation.

FWIW (!SPOILER ALERT!) I think this is all going away in an upcoming PR so probably not worth worrying too much about in this one.

Int i
}
command <<<
sleep 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ToL] Is there a particular reason for all the sleep 10s? We're already fighting long test times...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to make sure that if read and write are (incorrectly!) started concurrently, the read will get whatever was in the file before the write has a chance to overwrite it.

That said, I could probably shrink this down to something less offensively large (2 seconds?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'll only change the centaur ones though - this one is just in a validate test)

after foo2
{ input:
where = where
# , ready = foo2.done[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁

case _ => key.index
}

key match {
case scatteredCallCompletion: ScatteredCallCompletionKey =>
println(s"${statusTable.row(scatteredCallCompletion.node).size} == ${scatteredCallCompletion.totalIndices}?")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁

def keyForNode(node: GraphNode): Option[JobKey] = {
statusStore.keys collectFirst { case k if k.node eq node => k }
def keysForNode(node: GraphNode): Iterable[JobKey] = {
statusStore.keys collect { case k if k.node eq node => k }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more than one is now possible because of afters, I'm just not 💯 why 🙂

@@ -2,6 +2,7 @@ package wdl.transforms.biscayne.ast2wdlom

import better.files.File
import org.scalatest.{FlatSpec, Matchers}
import wdl.model.draft3.elements.{ExpressionElement, _}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants