-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.yaml
More file actions
109 lines (101 loc) · 3.22 KB
/
workflow.yaml
File metadata and controls
109 lines (101 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# yaml-language-server: $schema=https://activate.parallel.works/workflow.schema.json
---
on:
execute:
inputs:
cluster:
type: compute-clusters
label: "Target Cluster"
autoselect: true
benchmark_config:
type: group
label: "Benchmark Configuration"
items:
duration:
type: number
label: "Test Duration (seconds)"
default: 10
min: 5
max: 60
run_cpu:
type: boolean
label: "Run CPU Benchmark"
default: true
run_memory:
type: boolean
label: "Run Memory Benchmark"
default: true
run_disk:
type: boolean
label: "Run Disk I/O Benchmark"
default: true
sessions:
results:
type: tunnel
redirect: true
permissions:
- "*"
jobs:
run-benchmarks:
steps:
- name: Checkout service scripts
uses: parallelworks/checkout
ssh:
remoteHost: ${{ inputs.cluster.ip }}
with:
repo: https://github.com/parallelworks/activate-benchmark.git
branch: fix/workflow-additional
- name: benchmark
run: |
bash scripts/run_benchmarks.sh
env:
DURATION: ${{ inputs.benchmark_config.duration }}
RUN_CPU: ${{ inputs.benchmark_config.run_cpu }}
RUN_MEMORY: ${{ inputs.benchmark_config.run_memory }}
RUN_DISK: ${{ inputs.benchmark_config.run_disk }}
ssh:
remoteHost: ${{ inputs.cluster.ip }}
outputs:
results_file: ${{ steps.benchmark.outputs.RESULTS_FILE }}
visualize_results:
needs: [run-benchmarks]
ssh:
remoteHost: ${{ inputs.cluster.ip }}
steps:
- name: Setup and generate visualization
run: |
# Kill any existing process on port 8080
if lsof -ti:8080 > /dev/null 2>&1; then
echo "Killing existing process on port 8080..."
kill -9 $(lsof -ti:8080) 2>/dev/null || true
sleep 1
fi
# Create venv if it doesn't exist
if [ ! -d ~/venv ]; then
python3 -m venv ~/venv
fi
source ~/venv/bin/activate
# Install dependencies (use uv if available, fallback to pip)
if command -v uv &> /dev/null; then
uv pip install -r requirements.txt
else
pip install -r requirements.txt
fi
# Generate the visualization
python3 scripts/generate_plot.py
echo "HOSTNAME=$(hostname)" >> $OUTPUTS
echo "PORT=8080" >> $OUTPUTS
- name: Update session
uses: parallelworks/update-session
with:
target: ${{ inputs.cluster.id }}
name: ${{ sessions.results }}
remoteHost: ${{ needs.visualize_results.outputs.HOSTNAME }}
remotePort: ${{ needs.visualize_results.outputs.PORT }}
- name: Serve results (blocking)
run: |
source ~/venv/bin/activate
echo "Starting HTTP server on port 8080..."
echo "Session is active. Cancel the workflow to stop."
# Run server in foreground - this blocks and keeps session alive
python3 scripts/serve_results.py