diff --git a/app-configs/rinoa/dagu/dags/.examples-created b/app-configs/rinoa/dagu/dags/.examples-created new file mode 100644 index 0000000..9f985d1 --- /dev/null +++ b/app-configs/rinoa/dagu/dags/.examples-created @@ -0,0 +1,2 @@ +# This file indicates that example DAGs have been created. +# Delete this file to re-create examples on next startup. diff --git a/app-configs/rinoa/dagu/dags/example-01-basic-sequential.yaml b/app-configs/rinoa/dagu/dags/example-01-basic-sequential.yaml new file mode 100644 index 0000000..438af18 --- /dev/null +++ b/app-configs/rinoa/dagu/dags/example-01-basic-sequential.yaml @@ -0,0 +1,11 @@ +# Basic Sequential Execution +# Steps execute one after another in order + +description: Execute steps one after another + +steps: + - command: echo "Step 1 - Starting workflow" + + - command: echo "Step 2 - Processing data" + + - command: echo "Step 3 - Workflow complete" diff --git a/app-configs/rinoa/dagu/dags/example-02-parallel-execution.yaml b/app-configs/rinoa/dagu/dags/example-02-parallel-execution.yaml new file mode 100644 index 0000000..495f1ee --- /dev/null +++ b/app-configs/rinoa/dagu/dags/example-02-parallel-execution.yaml @@ -0,0 +1,41 @@ +# Parallel Execution +# Run multiple tasks simultaneously + +description: Execute multiple tasks in parallel + +steps: + - name: setup + command: echo "Setting up environment" + + # These steps run in parallel after setup + - name: task-a + command: | + echo "Task A starting" + sleep 2 + echo "Task A complete" + depends: + - setup + + - name: task-b + command: | + echo "Task B starting" + sleep 2 + echo "Task B complete" + depends: + - setup + + - name: task-c + command: | + echo "Task C starting" + sleep 2 + echo "Task C complete" + depends: + - setup + + # Wait for all parallel tasks to complete + - name: merge-results + command: echo "All parallel tasks completed" + depends: + - task-a + - task-b + - task-c diff --git a/app-configs/rinoa/dagu/dags/example-03-scheduling.yaml b/app-configs/rinoa/dagu/dags/example-03-scheduling.yaml new file mode 100644 index 0000000..5b547c7 --- /dev/null +++ b/app-configs/rinoa/dagu/dags/example-03-scheduling.yaml @@ -0,0 +1,21 @@ +# Scheduled Workflows +# Run workflows automatically on a schedule + +description: Example of a scheduled workflow +# Uncomment to run daily at 2:00 AM +# schedule: "0 2 * * *" + +# Schedule examples: +# "0 * * * *" - Every hour +# "*/5 * * * *" - Every 5 minutes +# "0 9 * * 1-5" - Weekdays at 9 AM +# "0 0 1 * *" - First day of each month + +histRetentionDays: 7 # Keep 7 days of history + +steps: + - command: | + echo "Running scheduled task" + echo "Current time: $(date)" + + - command: echo "Cleaning up old data" diff --git a/app-configs/rinoa/dagu/dags/example-04-nested-workflows.yaml b/app-configs/rinoa/dagu/dags/example-04-nested-workflows.yaml new file mode 100644 index 0000000..0831ec6 --- /dev/null +++ b/app-configs/rinoa/dagu/dags/example-04-nested-workflows.yaml @@ -0,0 +1,24 @@ +# Nested Workflows +# Call other workflows as sub-workflows + +description: Example of nested workflows + +steps: + - command: echo "Preparing data for sub-workflows" + + - run: sub-workflow + params: "TASK_ID=123" + + - command: echo "Main workflow completed" + +--- +# Sub-workflow definition +name: sub-workflow +description: Sub-workflow that gets called by main +params: + - TASK_ID: "000" + +steps: + - command: echo "Sub-workflow executing with TASK_ID=${TASK_ID}" + + - command: echo "Sub-workflow step 2" diff --git a/app-configs/rinoa/dagu/dags/example-05-container-workflow.yaml b/app-configs/rinoa/dagu/dags/example-05-container-workflow.yaml new file mode 100644 index 0000000..9fa6955 --- /dev/null +++ b/app-configs/rinoa/dagu/dags/example-05-container-workflow.yaml @@ -0,0 +1,18 @@ +# Container-based Workflow +# Using a container for all steps + +description: Run workflow steps in a Python container + +container: + image: python:3.13 + volumes: + - /tmp/data:/data + +steps: + - # write data to a file + command: | + python -c "with open('/data/output.txt', 'w') as f: f.write('Hello from Dagu!')" + + - # read data from the file + command: | + python -c "with open('/data/output.txt') as f: print(f.read())"