Skip to content

Instantly share code, notes, and snippets.

@gut
Last active July 3, 2018 00:24
Show Gist options
  • Save gut/85819d4b95530213adb437994f00a633 to your computer and use it in GitHub Desktop.
Save gut/85819d4b95530213adb437994f00a633 to your computer and use it in GitHub Desktop.
[Daisy] subworkflows don't execute until the end

Explanation copied from GoogleCloudPlatform/compute-image-tools#472:

I've noticed, for this test workflow that when one SubWorkflow ends, it forces ending all of the others subworkflows, ignoring their tests:

[test-subworkflow.quick]: 2018-07-02T21:01:46-03:00 Running step "wait-forever" (WaitForInstancesSignal)       
[test-subworkflow.quick.wait-forever]: 2018-07-02T21:01:46-03:00 WaitForInstancesSignal: Instance "inst-quick-test-test-subworkflow-quick-14v47": watching serial port 1, SuccessMatch: "BOOTED".
[test-subworkflow.loop]: 2018-07-02T21:01:48-03:00 Running step "wait-forever" (WaitForInstancesSignal)  
[test-subworkflow.loop.wait-forever]: 2018-07-02T21:01:48-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-subworkflow-loop-8jrgh": watching serial port 1, SuccessMatch: "b32531e7ca631a108a8d924262584a5e", StatusMatch: "Printing".                                                                          
[test-subworkflow.loop.wait-forever]: 2018-07-02T21:01:52-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-subworkflow-loop-8jrgh": StatusMatch found: "Printing each 5 seconds"
[test-subworkflow.quick.wait-forever]: 2018-07-02T21:01:57-03:00 WaitForInstancesSignal: Instance "inst-quick-test-test-subworkflow-quick-14v47": SuccessMatch found "BOOTED"
[test-subworkflow.quick]: 2018-07-02T21:01:57-03:00 Step "wait-forever" (WaitForInstancesSignal) successfully finished. 
[test-subworkflow.quick]: 2018-07-02T21:01:57-03:00 Workflow "quick" cleaning up (this may take up to 2 minutes).                                                                                           
[test-subworkflow.loop]: 2018-07-02T21:01:57-03:00 Workflow "loop" cleaning up (this may take up to 2 minutes).                                                                             
[test-subworkflow.loop.wait-forever]: 2018-07-02T21:01:57-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-subworkflow-loop-8jrgh": StatusMatch found: "Printing each 5 seconds"
[test-subworkflow]: 2018-07-02T21:04:11-03:00 Workflow "test-subworkflow" cleaning up (this may take up to 2 minutes).                                                                           
[test-subworkflow.quick]: 2018-07-02T21:04:12-03:00 Workflow "quick" cleaning up (this may take up to 2 minutes).      
[test-subworkflow.loop]: 2018-07-02T21:04:12-03:00 Workflow "loop" cleaning up (this may take up to 2 minutes).                                                                                             
[Daisy] Workflow "test-subworkflow" finished                                                                                                                                          
[Daisy] All workflows completed successfully.

That doesn't happen with if I use IncludeWorkFlow instead: (I understand that IncludeWorkflow and SubWorkflow are not always interchangeable, but for the sake of the end results of their target (sub)workflows, I guess they should be):

[test-includeworkflow.quick]: 2018-07-02T21:01:47-03:00 Running step "wait-forever" (WaitForInstancesSignal)
[test-includeworkflow.quick.wait-forever]: 2018-07-02T21:01:47-03:00 WaitForInstancesSignal: Instance "inst-quick-test-test-includeworkflow-quick-w121h": watching serial port 1, SuccessMatch: "BOOTED".
[test-includeworkflow.quick.wait-forever]: 2018-07-02T21:01:58-03:00 WaitForInstancesSignal: Instance "inst-quick-test-test-includeworkflow-quick-w121h": SuccessMatch found "BOOTED"
[test-includeworkflow.quick]: 2018-07-02T21:01:58-03:00 Step "wait-forever" (WaitForInstancesSignal) successfully finished.
[test-includeworkflow]: 2018-07-02T21:01:58-03:00 Step "quick" (IncludeWorkflow) successfully finished.
[test-includeworkflow.loop]: 2018-07-02T21:01:59-03:00 Running step "wait-forever" (WaitForInstancesSignal)
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:01:59-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": watching serial port 1, SuccessMatch: "b32531e7ca631a108a8d924262584a5e", StatusMatch: "Printing".
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:05-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:10-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:15-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:20-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:25-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"
[test-includeworkflow]: 2018-07-02T21:02:29-03:00 Error running workflow: step "loop" run error: step "wait-forever" did not complete within the specified timeout of 30s
[test-includeworkflow]: 2018-07-02T21:02:29-03:00 Workflow "test-includeworkflow" cleaning up (this may take up to 2 minutes).
[test-includeworkflow.loop.wait-forever]: 2018-07-02T21:02:30-03:00 WaitForInstancesSignal: Instance "inst-loop-test-test-includeworkflow-loop-w121h": StatusMatch found: "Printing each 5 seconds"

[Daisy] Errors in one or more workflows:
  test-includeworkflow: step "loop" run error: step "wait-forever" did not complete within the specified timeout of 30s
{
"Name": "loop-test",
"Steps": {
"create-test-disk": {
"CreateDisks": [
{
"Name": "disk-loop",
"SourceImage": "projects/debian-cloud/global/images/family/debian-9"
}
]
},
"create-test-instance": {
"CreateInstances": [
{
"Name": "inst-loop-test",
"Disks": [{"Source": "disk-loop"}],
"Metadata": {
"startup-script": "while [ 1 ] ; do logger -p daemon.info \"Printing each 5 seconds\"; sleep 5; done"
}
}
]
},
"wait-forever": {
"Timeout": "30s",
"WaitForInstancesSignal": [
{
"Name": "inst-loop-test",
"Interval": "1s",
"SerialOutput": {
"Port": 1,
"SuccessMatch": "b32531e7ca631a108a8d924262584a5e",
"StatusMatch": "Printing"
}
}
]
}
},
"Dependencies": {
"create-test-instance": ["create-test-disk"],
"wait-forever": ["create-test-instance"]
}
}
{
"Name": "quick-test",
"Steps": {
"create-test-disk": {
"CreateDisks": [
{
"Name": "disk-quick",
"SourceImage": "projects/debian-cloud/global/images/family/debian-9"
}
]
},
"create-test-instance": {
"CreateInstances": [
{
"Name": "inst-quick-test",
"Disks": [{"Source": "disk-quick"}],
"Metadata": {
"startup-script": "logger -p daemon.info BOOTED"
}
}
]
},
"wait-forever": {
"Timeout": "5m",
"WaitForInstancesSignal": [
{
"Name": "inst-quick-test",
"SerialOutput": {
"Port": 1,
"SuccessMatch": "BOOTED"
}
}
]
}
},
"Dependencies": {
"create-test-instance": ["create-test-disk"],
"wait-forever": ["create-test-instance"]
}
}
{
"Name": "test-includeworkflow",
"Steps": {
"loop": {
"IncludeWorkflow": {
"Path": "loop.subwf.json"
}
},
"quick": {
"IncludeWorkflow": {
"Path": "quick.subwf.json"
}
}
}
}
{
"Name": "test-subworkflow",
"Steps": {
"loop": {
"SubWorkflow": {
"Path": "loop.subwf.json"
}
},
"quick": {
"SubWorkflow": {
"Path": "quick.subwf.json"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment