mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-08-30 19:59:48 +02:00
Complete rewrite and re-architecture Osmedeus Engine in v5
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
kind: module
|
||||
name: nested-module-1
|
||||
description: First nested module for testing param and target sharing
|
||||
|
||||
params:
|
||||
- name: paramFromFlowFile
|
||||
default: "not-set"
|
||||
|
||||
- name: anotherParam1
|
||||
default: "{{Output}}/another1-{{TargetSpace}}.txt"
|
||||
|
||||
|
||||
steps:
|
||||
- name: echo-target-and-param
|
||||
type: bash
|
||||
command: |
|
||||
echo "Module 1: Target={{Target}}" >> {{anotherParam1}}
|
||||
echo "Module 1: paramFromFlowFile={{paramFromFlowFile}}" >> {{anotherParam1}}
|
||||
exports:
|
||||
module1_completed: "true"
|
||||
|
||||
- name: echo-target-and-param
|
||||
type: bash
|
||||
command: |
|
||||
echo "Module 1: Target={{Target}}" >> {{anotherParam1}}
|
||||
exports:
|
||||
module1_with_target: "module1-{{Target}}"
|
||||
@@ -0,0 +1,32 @@
|
||||
kind: module
|
||||
name: nested-module-2
|
||||
description: Second nested module for testing export propagation and param inheritance
|
||||
|
||||
params:
|
||||
- name: paramFromFlowFile
|
||||
default: "not-set"
|
||||
|
||||
- name: anotherParam2
|
||||
default: "{{Output}}/another2-{{Workspace}}.txt"
|
||||
|
||||
- name: anotherParam3as1
|
||||
default: "{{Output}}/another1-{{TargetSpace}}.txt"
|
||||
|
||||
|
||||
steps:
|
||||
- name: verify-exports-and-params
|
||||
type: bash
|
||||
command: |
|
||||
echo "Module 2: Target={{Target}}"
|
||||
echo "Module 2: module1_with_target={{module1_with_target}}"
|
||||
echo "Module 2: paramFromFlowFile={{paramFromFlowFile}}"
|
||||
echo "Module 2: module1_completed={{module1_completed}}"
|
||||
|
||||
- name: verify-exports-and-params
|
||||
type: bash
|
||||
pre_condition: 'fileExists("{{anotherParam3as1}}")'
|
||||
command: |
|
||||
echo "Module 2: paramFromFlowFile={{paramFromFlowFile}}"
|
||||
echo "Module 2: module1_completed={{module1_completed}}"
|
||||
echo "Module 2: anotherParam3as1={{anotherParam3as1}}"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
kind: module
|
||||
name: template-foreach-module
|
||||
description: Test template rendering in foreach steps
|
||||
|
||||
params:
|
||||
- name: inputFile
|
||||
default: "{{Output}}/items-{{TargetSpace}}.txt"
|
||||
- name: outputDir
|
||||
default: "{{Output}}/processed-{{TargetSpace}}"
|
||||
|
||||
steps:
|
||||
# Create test input file
|
||||
- name: create-input
|
||||
type: bash
|
||||
command: |
|
||||
mkdir -p {{outputDir}}
|
||||
echo -e "item1\nitem2\nitem3" > {{inputFile}}
|
||||
exports:
|
||||
input_ready: "true"
|
||||
|
||||
# Foreach with templated input path
|
||||
- name: foreach-with-templates
|
||||
type: foreach
|
||||
pre_condition: 'fileExists("{{inputFile}}")'
|
||||
input: "{{inputFile}}"
|
||||
variable: item
|
||||
threads: 2
|
||||
step:
|
||||
name: process-item
|
||||
type: bash
|
||||
command: |
|
||||
echo "Processing [[item]] for {{Target}}" >> {{outputDir}}/[[item]].txt
|
||||
|
||||
# Verify results
|
||||
- name: verify-foreach
|
||||
type: bash
|
||||
pre_condition: 'fileExists("{{outputDir}}/item1.txt")'
|
||||
command: |
|
||||
echo "=== Foreach Verification ==="
|
||||
echo "Foreach completed for {{Target}}"
|
||||
echo "inputFile={{inputFile}}"
|
||||
echo "outputDir={{outputDir}}"
|
||||
echo "=== Output Directory ==="
|
||||
ls -la {{outputDir}}/
|
||||
echo "=== Item1 Contents ==="
|
||||
cat {{outputDir}}/item1.txt
|
||||
exports:
|
||||
foreach_verified: "true"
|
||||
@@ -0,0 +1,51 @@
|
||||
kind: module
|
||||
name: template-parallel-module
|
||||
description: Test template rendering in parallel-steps
|
||||
|
||||
params:
|
||||
- name: parallelOutput
|
||||
default: "{{Output}}/parallel-{{TargetSpace}}"
|
||||
|
||||
steps:
|
||||
- name: setup-parallel
|
||||
type: bash
|
||||
command: mkdir -p {{parallelOutput}}
|
||||
exports:
|
||||
parallel_dir: "{{parallelOutput}}"
|
||||
|
||||
- name: parallel-steps-with-templates
|
||||
type: parallel-steps
|
||||
parallel_steps:
|
||||
- name: parallel-bash-1
|
||||
type: bash
|
||||
command: 'echo "Bash 1: {{Target}}" > {{parallelOutput}}/bash1.txt'
|
||||
exports:
|
||||
p1_done: "true"
|
||||
|
||||
- name: parallel-bash-2
|
||||
type: bash
|
||||
command: 'echo "Bash 2: {{TargetSpace}}" > {{parallelOutput}}/bash2.txt'
|
||||
exports:
|
||||
p2_done: "true"
|
||||
|
||||
- name: parallel-function
|
||||
type: function
|
||||
function: 'log_info("Parallel function for {{Target}}")'
|
||||
exports:
|
||||
p3_done: "true"
|
||||
|
||||
- name: verify-parallel
|
||||
type: bash
|
||||
pre_condition: 'fileExists("{{parallelOutput}}/bash1.txt")'
|
||||
command: |
|
||||
echo "=== Parallel Steps Verification ==="
|
||||
echo "parallel_dir={{parallel_dir}}"
|
||||
echo "p1_done={{p1_done}}"
|
||||
echo "p2_done={{p2_done}}"
|
||||
echo "p3_done={{p3_done}}"
|
||||
echo "=== Bash1 Contents ==="
|
||||
cat {{parallelOutput}}/bash1.txt
|
||||
echo "=== Bash2 Contents ==="
|
||||
cat {{parallelOutput}}/bash2.txt
|
||||
exports:
|
||||
all_parallel_done: "{{p1_done}}-{{p2_done}}-{{p3_done}}"
|
||||
@@ -0,0 +1,30 @@
|
||||
kind: flow
|
||||
name: template-rendering-flow
|
||||
description: Flow to test template rendering across all step types and fields
|
||||
tags: test,template,rendering
|
||||
|
||||
params:
|
||||
- name: flowParam
|
||||
default: "flow-{{Target}}"
|
||||
|
||||
dependencies:
|
||||
variables:
|
||||
- name: Target
|
||||
type: domain
|
||||
required: true
|
||||
|
||||
modules:
|
||||
- name: basic-rendering
|
||||
path: nested/template-rendering-module.yaml
|
||||
params:
|
||||
customPrefix: "{{flowParam}}-custom"
|
||||
|
||||
- name: foreach-rendering
|
||||
path: nested/template-foreach-module.yaml
|
||||
depends_on:
|
||||
- basic-rendering
|
||||
|
||||
- name: parallel-rendering
|
||||
path: nested/template-parallel-module.yaml
|
||||
depends_on:
|
||||
- foreach-rendering
|
||||
@@ -0,0 +1,64 @@
|
||||
kind: module
|
||||
name: template-rendering-module
|
||||
description: Test template rendering in all step fields
|
||||
|
||||
params:
|
||||
- name: customPath
|
||||
default: "{{Output}}/custom-{{TargetSpace}}.txt"
|
||||
- name: customPrefix
|
||||
default: "prefix-{{Target}}"
|
||||
- name: customTimeout
|
||||
default: "30"
|
||||
|
||||
steps:
|
||||
# 1. Bash step with all templated fields
|
||||
- name: bash-with-templates
|
||||
type: bash
|
||||
pre_condition: 'true'
|
||||
command: |
|
||||
echo "Target: {{Target}}" > {{customPath}}
|
||||
echo "Prefix: {{customPrefix}}" >> {{customPath}}
|
||||
log: "Executing bash with target {{Target}}"
|
||||
exports:
|
||||
bash_output_path: "{{customPath}}"
|
||||
bash_target: "{{Target}}"
|
||||
|
||||
# 2. Function step with templated function calls
|
||||
- name: function-with-templates
|
||||
type: function
|
||||
pre_condition: 'fileExists("{{bash_output_path}}")'
|
||||
function: 'log_info("Processing {{Target}} with path {{customPath}}")'
|
||||
exports:
|
||||
function_result: "processed-{{Target}}"
|
||||
|
||||
# 3. Parallel commands with templates
|
||||
- name: parallel-with-templates
|
||||
type: bash
|
||||
parallel_commands:
|
||||
- 'echo "Parallel 1: {{Target}}" >> {{customPath}}'
|
||||
- 'echo "Parallel 2: {{customPrefix}}" >> {{customPath}}'
|
||||
exports:
|
||||
parallel_done: "true"
|
||||
|
||||
# 4. Step with structured args using templates
|
||||
- name: structured-args-step
|
||||
type: bash
|
||||
command: cat {{customPath}}
|
||||
exports:
|
||||
structured_output: "{{Output}}/combined-{{TargetSpace}}.txt"
|
||||
|
||||
# 5. Final verification step
|
||||
- name: verify-all-templates
|
||||
type: bash
|
||||
pre_condition: 'fileExists("{{customPath}}")'
|
||||
command: |
|
||||
echo "=== Template Rendering Verification ==="
|
||||
echo "bash_output_path={{bash_output_path}}"
|
||||
echo "bash_target={{bash_target}}"
|
||||
echo "function_result={{function_result}}"
|
||||
echo "parallel_done={{parallel_done}}"
|
||||
echo "structured_output={{structured_output}}"
|
||||
echo "=== File Contents ==="
|
||||
cat {{customPath}}
|
||||
exports:
|
||||
all_verified: "true"
|
||||
@@ -0,0 +1,23 @@
|
||||
kind: flow
|
||||
name: testing-nested-flow
|
||||
description: Test flow for nested workflow execution with param and target sharing
|
||||
tags: test,nested
|
||||
|
||||
params:
|
||||
- name: paramFromFlowFile
|
||||
default: "flow-value"
|
||||
|
||||
dependencies:
|
||||
variables:
|
||||
- name: Target
|
||||
type: domain
|
||||
required: true
|
||||
|
||||
modules:
|
||||
- name: nested-module-one
|
||||
path: nested/nested-module-1.yaml
|
||||
|
||||
- name: nested-module-two
|
||||
path: nested/nested-module-2.yaml
|
||||
depends_on:
|
||||
- nested-module-one
|
||||
Reference in New Issue
Block a user