Skip to content

Commit e89e933

Browse files
committed
Add more complex fact-files to showcase new log capabilities
1 parent e45db60 commit e89e933

File tree

4 files changed

+318
-0
lines changed

4 files changed

+318
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0",
3+
"data": {
4+
"name": "Complex diamond DAG with streaming",
5+
"tasks": [
6+
{
7+
"name": "fetch-data",
8+
"executor": "shell",
9+
"command": "echo 'Fetching data...'; sleep 1; echo 'Data fetched successfully'",
10+
"arguments": [],
11+
"dependsOn": [],
12+
"onResult": {
13+
"terminateJobWithSuccess": [],
14+
"continueJob": [ 0 ]
15+
}
16+
},
17+
{
18+
"name": "process-part-a",
19+
"executor": "shell",
20+
"command": "for i in {1..4}; do echo \"Processing A: step $i\"; sleep 0.5; done",
21+
"arguments": [],
22+
"dependsOn": [ "fetch-data" ],
23+
"onResult": {
24+
"terminateJobWithSuccess": [],
25+
"continueJob": [ 0 ]
26+
}
27+
},
28+
{
29+
"name": "process-part-b",
30+
"executor": "shell",
31+
"command": "for i in {1..3}; do echo \"Processing B: step $i\"; sleep 0.7; done",
32+
"arguments": [],
33+
"dependsOn": [ "fetch-data" ],
34+
"onResult": {
35+
"terminateJobWithSuccess": [],
36+
"continueJob": [ 0 ]
37+
}
38+
},
39+
{
40+
"name": "process-part-c",
41+
"executor": "shell",
42+
"command": "for i in {1..5}; do echo \"Processing C: step $i\"; sleep 0.4; done",
43+
"arguments": [],
44+
"dependsOn": [ "fetch-data" ],
45+
"onResult": {
46+
"terminateJobWithSuccess": [],
47+
"continueJob": [ 0 ]
48+
}
49+
},
50+
{
51+
"name": "validate-a",
52+
"executor": "shell",
53+
"command": "echo 'Validating A...'; sleep 1; echo 'A validated'",
54+
"arguments": [],
55+
"dependsOn": [ "process-part-a" ],
56+
"onResult": {
57+
"terminateJobWithSuccess": [],
58+
"continueJob": [ 0 ]
59+
}
60+
},
61+
{
62+
"name": "validate-b",
63+
"executor": "shell",
64+
"command": "echo 'Validating B...'; sleep 1; echo 'B validated'",
65+
"arguments": [],
66+
"dependsOn": [ "process-part-b" ],
67+
"onResult": {
68+
"terminateJobWithSuccess": [],
69+
"continueJob": [ 0 ]
70+
}
71+
},
72+
{
73+
"name": "validate-c",
74+
"executor": "shell",
75+
"command": "echo 'Validating C...'; sleep 1; echo 'C validated'",
76+
"arguments": [],
77+
"dependsOn": [ "process-part-c" ],
78+
"onResult": {
79+
"terminateJobWithSuccess": [],
80+
"continueJob": [ 0 ]
81+
}
82+
},
83+
{
84+
"name": "merge-results",
85+
"executor": "shell",
86+
"command": "echo 'Merging all results...'; sleep 2; echo 'Results merged successfully'",
87+
"arguments": [],
88+
"dependsOn": [ "validate-a", "validate-b", "validate-c" ],
89+
"onResult": {
90+
"terminateJobWithSuccess": [],
91+
"continueJob": [ 0 ]
92+
}
93+
},
94+
{
95+
"name": "generate-report",
96+
"executor": "shell",
97+
"command": "for i in {1..3}; do echo \"Report generation: $i/3\"; sleep 0.5; done; echo 'Report complete!'",
98+
"arguments": [],
99+
"dependsOn": [ "merge-results" ],
100+
"onResult": {
101+
"terminateJobWithSuccess": [],
102+
"continueJob": [ 0 ]
103+
}
104+
}
105+
]
106+
}
107+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0",
3+
"data": {
4+
"name": "Concurrent tasks with streaming output",
5+
"tasks": [
6+
{
7+
"name": "start",
8+
"executor": "shell",
9+
"command": "echo",
10+
"arguments": [ "Starting concurrent tasks..." ],
11+
"dependsOn": [],
12+
"onResult": {
13+
"terminateJobWithSuccess": [],
14+
"continueJob": [ 0 ]
15+
}
16+
},
17+
{
18+
"name": "stream-branch-1",
19+
"executor": "shell",
20+
"command": "for i in {1..5}; do echo \"Branch 1: Line $i\"; sleep 1; done",
21+
"arguments": [],
22+
"dependsOn": [ "start" ],
23+
"onResult": {
24+
"terminateJobWithSuccess": [],
25+
"continueJob": [ 0 ]
26+
}
27+
},
28+
{
29+
"name": "stream-branch-2",
30+
"executor": "shell",
31+
"command": "for i in {1..5}; do echo \"Branch 2: Line $i\"; sleep 1; done",
32+
"arguments": [],
33+
"dependsOn": [ "start" ],
34+
"onResult": {
35+
"terminateJobWithSuccess": [],
36+
"continueJob": [ 0 ]
37+
}
38+
},
39+
{
40+
"name": "stream-branch-3",
41+
"executor": "shell",
42+
"command": "for i in {1..5}; do echo \"Branch 3: Line $i\"; sleep 1; done",
43+
"arguments": [],
44+
"dependsOn": [ "start" ],
45+
"onResult": {
46+
"terminateJobWithSuccess": [],
47+
"continueJob": [ 0 ]
48+
}
49+
},
50+
{
51+
"name": "merge",
52+
"executor": "shell",
53+
"command": "echo",
54+
"arguments": [ "All branches completed!" ],
55+
"dependsOn": [ "stream-branch-1", "stream-branch-2", "stream-branch-3" ],
56+
"onResult": {
57+
"terminateJobWithSuccess": [],
58+
"continueJob": [ 0 ]
59+
}
60+
}
61+
]
62+
}
63+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0",
3+
"data": {
4+
"name": "Concurrent tasks with failures",
5+
"tasks": [
6+
{
7+
"name": "init",
8+
"executor": "shell",
9+
"command": "echo",
10+
"arguments": [ "Initializing..." ],
11+
"dependsOn": [],
12+
"onResult": {
13+
"terminateJobWithSuccess": [],
14+
"continueJob": [ 0 ]
15+
}
16+
},
17+
{
18+
"name": "success-task",
19+
"executor": "shell",
20+
"command": "echo 'Processing...'; sleep 2; echo 'Success!'",
21+
"arguments": [],
22+
"dependsOn": [ "init" ],
23+
"onResult": {
24+
"terminateJobWithSuccess": [],
25+
"continueJob": [ 0 ]
26+
}
27+
},
28+
{
29+
"name": "failing-task",
30+
"executor": "shell",
31+
"command": "echo 'Starting work...'; sleep 1; echo 'Error encountered!' >&2; exit 1",
32+
"arguments": [],
33+
"dependsOn": [ "init" ],
34+
"onResult": {
35+
"terminateJobWithSuccess": [],
36+
"continueJob": [ 0 ]
37+
}
38+
},
39+
{
40+
"name": "slow-success-task",
41+
"executor": "shell",
42+
"command": "for i in {1..3}; do echo \"Slow task progress: $i/3\"; sleep 1; done; echo 'Done!'",
43+
"arguments": [],
44+
"dependsOn": [ "init" ],
45+
"onResult": {
46+
"terminateJobWithSuccess": [],
47+
"continueJob": [ 0 ]
48+
}
49+
},
50+
{
51+
"name": "should-be-skipped",
52+
"executor": "shell",
53+
"command": "echo",
54+
"arguments": [ "This should not run due to failing-task" ],
55+
"dependsOn": [ "failing-task", "success-task" ],
56+
"onResult": {
57+
"terminateJobWithSuccess": [],
58+
"continueJob": [ 0 ]
59+
}
60+
}
61+
]
62+
}
63+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0",
3+
"data": {
4+
"name": "Multiple failures with cascade effect",
5+
"tasks": [
6+
{
7+
"name": "setup",
8+
"executor": "shell",
9+
"command": "echo 'Setting up environment...'; sleep 1; echo 'Setup complete'",
10+
"arguments": [],
11+
"dependsOn": [],
12+
"onResult": {
13+
"terminateJobWithSuccess": [],
14+
"continueJob": [ 0 ]
15+
}
16+
},
17+
{
18+
"name": "quick-fail",
19+
"executor": "shell",
20+
"command": "echo 'Quick task starting'; echo 'FAILURE!' >&2; exit 5",
21+
"arguments": [],
22+
"dependsOn": [ "setup" ],
23+
"onResult": {
24+
"terminateJobWithSuccess": [],
25+
"continueJob": [ 0 ]
26+
}
27+
},
28+
{
29+
"name": "slow-success",
30+
"executor": "shell",
31+
"command": "for i in {1..6}; do echo \"Long task: step $i\"; sleep 1; done",
32+
"arguments": [],
33+
"dependsOn": [ "setup" ],
34+
"onResult": {
35+
"terminateJobWithSuccess": [],
36+
"continueJob": [ 0 ]
37+
}
38+
},
39+
{
40+
"name": "delayed-fail",
41+
"executor": "shell",
42+
"command": "for i in {1..3}; do echo \"Working on item $i\"; sleep 1; done; echo 'Critical error!' >&2; exit 2",
43+
"arguments": [],
44+
"dependsOn": [ "setup" ],
45+
"onResult": {
46+
"terminateJobWithSuccess": [],
47+
"continueJob": [ 0 ]
48+
}
49+
},
50+
{
51+
"name": "depends-on-quick-fail",
52+
"executor": "shell",
53+
"command": "echo",
54+
"arguments": [ "Should be skipped" ],
55+
"dependsOn": [ "quick-fail" ],
56+
"onResult": {
57+
"terminateJobWithSuccess": [],
58+
"continueJob": [ 0 ]
59+
}
60+
},
61+
{
62+
"name": "depends-on-delayed-fail",
63+
"executor": "shell",
64+
"command": "echo",
65+
"arguments": [ "Should also be skipped" ],
66+
"dependsOn": [ "delayed-fail" ],
67+
"onResult": {
68+
"terminateJobWithSuccess": [],
69+
"continueJob": [ 0 ]
70+
}
71+
},
72+
{
73+
"name": "final-task",
74+
"executor": "shell",
75+
"command": "echo",
76+
"arguments": [ "Will never run due to failures" ],
77+
"dependsOn": [ "depends-on-quick-fail", "depends-on-delayed-fail", "slow-success" ],
78+
"onResult": {
79+
"terminateJobWithSuccess": [],
80+
"continueJob": [ 0 ]
81+
}
82+
}
83+
]
84+
}
85+
}

0 commit comments

Comments
 (0)