Skip to content

Instantly share code, notes, and snippets.

@KentFujii
Last active December 12, 2022 06:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save KentFujii/b48da293772de2adc52624e354a92c0f to your computer and use it in GitHub Desktop.
Dag for debugging digdag ruby operator
_export:
rb:
require: myruby
+step1:
rb>: Task::MyWorkflow.step1
module Task
class MyWorkflow
def step1
Digdag.env.add_subtask(
{
"+step2_1": {
"rb>": "Task::MyWorkflow.step2",
},
"+step2_2": {
"rb>": "Task::MyWorkflow.step2",
},
"_parallel": true
}
)
Digdag.env.add_subtask(
{
"+step3_1": {
"rb>": "Task::MyWorkflow.step3",
},
"+step3_2": {
"rb>": "Task::MyWorkflow.step3",
},
"_parallel": true
}
)
end
def step2
sleep 3
raise if [true, false].sample
end
def step3
sleep 1
raise if [true, false].sample
Digdag.env.add_subtask(
{
"+step4": {
"rb>": "Task::MyWorkflow.step4",
},
}
)
end
def step4
sleep 1
raise if [true, false].sample
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment