#######################################################################################
# ===========================================================================================
-# OSM Application Management Workflow Template
+# OSM Application Management Workflow Template
# ===========================================================================================
#
# PREREQUISITES:
- "app update $environment": Update existing application instance
- "app delete $environment": Remove application instance
This parameter accepts any valid OSM SDK command for maximum flexibility.
-
+
# === Volume-Based Data Sources ===
- name: model_volume_name
description: |
Name of the Kubernetes secret to mount at /model/parameters/secret/environment.yaml.
This parameter is optional. When provided, the secret will be mounted as a file
containing sensitive configuration parameters for the application.
-
+
# === Git Repository Configuration ===
- name: git_fleet_url
- name: fleet_destination_folder
- name: sw_catalogs_destination_folder
value: "/sw-catalogs/sw-catalogs-osm"
- name: git_sw_catalogs_cred_secret
-
+
# === Target Deployment Configuration ===
- name: app_name
- name: profile_name
value: "app-profiles"
- name: project_name
value: "osm_admin"
-
+
# === OSM SDK Container Configuration ===
- name: osm_sdk_image_repository
- value: "ttl.sh/osm-sdk-operations"
+ value: "opensourcemano/osm-nushell-krm-functions"
description: |
Repository for the OSM SDK container image. Default is the standardized
OSM SDK operations image that provides consistent behavior across workflows.
- name: osm_sdk_image_tag
- value: "24h"
+ value: "testing-daily"
description: |
Tag for the OSM SDK container image. Default is '24h' which provides
a stable, time-limited image for workflow execution.
-
+
# === Workflow Execution Control ===
- name: debug
value: "false"
echo " OSM SDK: {{inputs.parameters.osm_sdk_image_repository}}:{{inputs.parameters.osm_sdk_image_tag}}"
echo " Debug Mode: {{inputs.parameters.debug}}"
echo " Dry Run: {{inputs.parameters.dry_run}}"
-
+
# === PHASE 2: Volume Preparation ===
# Generate temporary volumes for Git repository operations
# These volumes will store cloned Fleet and SW-Catalogs repositories during workflow execution
parameters:
- name: pvc-size
value: '100Mi' # Sufficient space for SW-Catalogs repository content
-
+
# === PHASE 3: Git Repository Cloning ===
# Clone the required Git repositories for application modeling and deployment
# These repositories provide the templates and target locations for GitOps operations
- "nu"
- "-c"
- |
- echo "=== OSM App Modeling Debug Information (Volume-Based) ==="
- echo $"Command: {{inputs.parameters.command}}"
- echo $"SDK Image: {{inputs.parameters.osm_sdk_image_repository}}:{{inputs.parameters.osm_sdk_image_tag}}"
- echo $"Model Volume: {{inputs.parameters.model_volume_name}}"
- echo $"Secret Name: {{inputs.parameters.secret_name}}"
- echo $"Timestamp: (date now | format date '%Y-%m-%d %H:%M:%S')"
- echo ""
+ print "=== OSM App Modeling Debug Information (Volume-Based) ==="
+ print $"Command: {{inputs.parameters.command}}"
+ print $"SDK Image: {{inputs.parameters.osm_sdk_image_repository}}:{{inputs.parameters.osm_sdk_image_tag}}"
+ print $"Model Volume: {{inputs.parameters.model_volume_name}}"
+ print $"Secret Name: {{inputs.parameters.secret_name}}"
+ print $"Timestamp: (date now | format date '%Y-%m-%d %H:%M:%S')"
+ print ""
- echo "=== Volume Mount Status and Accessibility ==="
- echo "Checking volume mount accessibility..."
+ print "=== Volume Mount Status and Accessibility ==="
+ print "Checking volume mount accessibility..."
# Check model volume mount
- echo "Model volume mount status:"
+ print "Model volume mount status:"
if (ls /model | length) > 0 {
- echo "✓ Model volume mounted successfully at /model"
- echo $" Files found: (ls /model | length)"
+ print "✓ Model volume mounted successfully at /model"
+ print $" Files found: (ls /model | length)"
} else {
- echo "✗ Model volume mount failed or empty"
+ print "✗ Model volume mount failed or empty"
}
# Check fleet volume mount
- echo "Fleet volume mount status:"
+ print "Fleet volume mount status:"
if (ls /repos/fleet-osm | length) > 0 {
- echo "✓ Fleet volume mounted successfully at /repos/fleet-osm"
- echo $" Files found: (ls /repos/fleet-osm | length)"
+ print "✓ Fleet volume mounted successfully at /repos/fleet-osm"
+ print $" Files found: (ls /repos/fleet-osm | length)"
} else {
- echo "✗ Fleet volume mount failed or empty"
+ print "✗ Fleet volume mount failed or empty"
}
# Check sw-catalogs volume mount
- echo "SW-Catalogs volume mount status:"
+ print "SW-Catalogs volume mount status:"
if (ls /repos/sw-catalogs-osm | length) > 0 {
- echo "✓ SW-Catalogs volume mounted successfully at /repos/sw-catalogs-osm"
- echo $" Files found: (ls /repos/sw-catalogs-osm | length)"
+ print "✓ SW-Catalogs volume mounted successfully at /repos/sw-catalogs-osm"
+ print $" Files found: (ls /repos/sw-catalogs-osm | length)"
} else {
- echo "✗ SW-Catalogs volume mount failed or empty"
+ print "✗ SW-Catalogs volume mount failed or empty"
}
- echo ""
+ print ""
- echo "=== Model Volume Contents and Structure ==="
- echo "Model volume directory structure:"
+ print "=== Model Volume Contents and Structure ==="
+ print "Model volume directory structure:"
try {
- ls /model -la | select name type size permissions | table
+ ls /model -la | select name type size mode | table
} catch {
- echo "Error accessing model volume contents"
+ print "Error accessing model volume contents"
}
- echo ""
+ print ""
- echo "=== Required Model Files Validation ==="
+ print "=== Required Model Files Validation ==="
# Check app_instance_model.yaml
if ("/model/app_instance_model.yaml" | path exists) {
- echo "✓ app_instance_model.yaml found"
+ print "✓ app_instance_model.yaml found"
try {
let file_size = (ls /model/app_instance_model.yaml | get size | first)
- echo $" Size: ($file_size) bytes"
+ print $" Size: ($file_size) bytes"
} catch {
- echo " Warning: Could not read file size"
+ print " Warning: Could not read file size"
}
} else {
- echo "✗ app_instance_model.yaml missing"
+ print "✗ app_instance_model.yaml missing"
}
# Check clear parameters
if ("/model/parameters/clear/environment.yaml" | path exists) {
- echo "✓ Clear parameters file found"
+ print "✓ Clear parameters file found"
try {
let file_size = (ls /model/parameters/clear/environment.yaml | get size | first)
- echo $" Size: ($file_size) bytes"
+ print $" Size: ($file_size) bytes"
} catch {
- echo " Warning: Could not read file size"
+ print " Warning: Could not read file size"
}
} else {
- echo "ℹ Clear parameters file missing (optional)"
+ print "ℹ Clear parameters file missing (optional)"
}
# Check secret parameters
if ("/model/parameters/secret/environment.yaml" | path exists) {
- echo "✓ Secret parameters file found"
+ print "✓ Secret parameters file found"
try {
let file_size = (ls /model/parameters/secret/environment.yaml | get size | first)
- echo $" Size: ($file_size) bytes"
+ print $" Size: ($file_size) bytes"
} catch {
- echo " Warning: Could not read file size"
+ print " Warning: Could not read file size"
}
} else {
- echo "ℹ Secret parameters file missing (optional)"
+ print "ℹ Secret parameters file missing (optional)"
}
- echo "=== Model Content Analysis ==="
- echo "App Instance Model (first 30 lines):"
+ print "Clear Parameters Content:"
try {
- open /model/app_instance_model.yaml | lines | first 30 | str join "\n"
+ let clear_params = open /model/parameters/clear/environment.yaml | to yaml
+ print $clear_params
} catch {
- echo "Error reading app_instance_model.yaml"
+ print "Clear parameters not available"
}
- echo ""
+ print ""
- echo "Clear Parameters Content:"
- try {
- open /model/parameters/clear/environment.yaml | to yaml
- } catch {
- echo "Clear parameters not available"
- }
- echo ""
-
- echo "Secret Parameters Content (masked for security):"
+ print "Secret Parameters Content (masked for security):"
try {
if ("/model/parameters/secret/environment.yaml" | path exists) {
- echo "Secret file exists - content masked for security"
+ print "Secret file exists - content masked for security"
} else {
- echo "Secret parameters not available"
+ print "Secret parameters not available"
}
} catch {
- echo "Error checking secret parameters"
+ print "Error checking secret parameters"
}
- echo ""
+ print ""
- echo "=== Loaded Model Instance from Volume ==="
+ print "=== Loaded Model Instance from Volume ==="
try {
- $model_instance | to yaml | lines | first 30 | str join "\n"
+ $model_instance | to yaml
+ print $model_instance
} catch {
- echo "Error loading model instance"
+ print "Error loading model instance"
}
- echo ""
+ print ""
- echo "=== Environment Parameters from Volume ==="
+ print "=== Environment Parameters from Volume ==="
try {
- $environment | to yaml | lines | first 30 | str join "\n"
+ $environment | to yaml
+ print $environment
} catch {
- echo "Error loading environment"
+ print "Error loading environment"
}
- echo ""
+ print ""
- echo "=== Repository Structure ==="
- echo "Fleet repo contents:"
+ print "=== Repository Structure ==="
+ print "Fleet repo contents:"
try {
ls /repos/fleet-osm | select name type size | first 10 | table
} catch {
- echo "Error accessing fleet repository"
+ print "Error accessing fleet repository"
}
- echo ""
- echo "SW-Catalogs repo contents:"
+ print ""
+ print "SW-Catalogs repo contents:"
try {
ls /repos/sw-catalogs-osm | select name type size | first 10 | table
} catch {
- echo "Error accessing sw-catalogs repository"
+ print "Error accessing sw-catalogs repository"
}
- echo ""
+ print ""
- echo "=== Embedded Operations Validation ==="
- echo "App Operations Library Status:"
+ print "=== Embedded Operations Validation ==="
+ print "App Operations Library Status:"
try {
help app | lines | first 10 | str join "\n"
} catch {
- echo "Error accessing app operations library"
- }
- echo ""
-
- echo "=== Dry Run Test ==="
- echo "Testing command execution with volume-mounted data..."
- try {
- echo $"Command to execute: {{inputs.parameters.command}}"
- echo "✓ Command validation successful with volume-based data"
- } catch {
- echo $"✗ Command validation failed: ($in)"
+ print "Error accessing app operations library"
}
- echo ""
+ print ""
- echo "=== Volume Permissions Check ==="
- echo "Model volume permissions:"
+ print "=== Dry Run Test ==="
+ print "Testing command execution with volume-mounted data..."
try {
- ls -la /model | head -5 | each { |item| echo $" ($item.name): ($item.permissions)" } | str join "\n"
+ print $"Command to execute: {{inputs.parameters.command}}"
+ print "✓ Command validation successful with volume-based data"
} catch {
- echo "Error checking model volume permissions"
+ print $"✗ Command validation failed: ($in)"
}
- echo ""
+ print ""
- echo "=== Debug Information Complete ==="
+ print "=== Debug Information Complete ==="
volumeMounts:
- name: model-volume
mountPath: /model