#!/bin/bash
# Script: generate-example-output.sh
# Description: Generate example output files for llm-d-modelservice


set -e

# Common function to generate output files
generate_output() {
	local release_name="$1"
	local values_file="$2"
	local output_file="$3"
	local set_args="$4"
	helm template "$release_name" charts/llm-d-modelservice/ -f "$values_file" $set_args \
		| sed '1s/^/# generated by generate-example-output.sh\n/' > "$output_file"
	echo "Generated: $output_file"
}

# Generate output-cpu.yaml (Simulated CPU deployment)
generate_output "cpu-sim" "examples/values-cpu.yaml" "examples/output-cpu.yaml"

# Generate output-pd.yaml (PD deployment)
generate_output "pd" "examples/values-pd.yaml" "examples/output-pd.yaml"

# Generate output-pvc.yaml (PVC model deployment)
generate_output "pvc" "examples/values-pd.yaml" "examples/output-pvc.yaml" '--set modelArtifacts.uri=pvc://pvc-name/path/to/model'

# Generate output-pvc-hf.yaml (PVC HuggingFace model deployment)
generate_output "pvc-hf" "examples/values-pd.yaml" "examples/output-pvc-hf.yaml" '--set modelArtifacts.uri=pvc+hf://pvc-name/path/to/hf_hub_cache/facebook/opt-125m'
