Skip to content

Commit 66c9e4e

Browse files
Run benchs (#260)
* Update cascade config * Parallel runs * Add more datasets * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reorder inputs * Improve visualization html * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a0ce86f commit 66c9e4e

File tree

12 files changed

+2103
-180
lines changed

12 files changed

+2103
-180
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Create Server with Retry'
2+
description: 'Create a Hetzner server with retry logic'
3+
inputs:
4+
server_name:
5+
description: 'Name of the server to create'
6+
required: true
7+
server_type:
8+
description: 'Type of server to create'
9+
required: true
10+
max_retries:
11+
description: 'Maximum number of retry attempts'
12+
required: false
13+
default: '5'
14+
outputs:
15+
success:
16+
description: 'Whether the server was created successfully'
17+
value: ${{ steps.create.outputs.success }}
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Create server with retries
22+
id: create
23+
shell: bash
24+
run: |
25+
SERVER_NAME="${{ inputs.server_name }}"
26+
SERVER_TYPE="${{ inputs.server_type }}"
27+
MAX_RETRIES="${{ inputs.max_retries }}"
28+
RETRY_COUNT=0
29+
30+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
31+
echo "Creating server $SERVER_NAME (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)..."
32+
33+
if SERVER_NAME=$SERVER_NAME SERVER_TYPE=$SERVER_TYPE bash -x "tools/hetzner/create_and_install.sh"; then
34+
echo "Successfully created server $SERVER_NAME"
35+
echo "success=true" >> $GITHUB_OUTPUT
36+
exit 0
37+
else
38+
RETRY_COUNT=$((RETRY_COUNT + 1))
39+
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
40+
echo "Failed to create server $SERVER_NAME, waiting 60 seconds before retry..."
41+
sleep 60
42+
fi
43+
fi
44+
done
45+
46+
echo "Failed to create server $SERVER_NAME after $MAX_RETRIES attempts"
47+
echo "success=false" >> $GITHUB_OUTPUT
48+
exit 1
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Extract Machine Names'
2+
description: 'Extract server and client machine names based on configuration'
3+
inputs:
4+
machines_per_bench:
5+
description: 'Whether to create/destroy machines per benchmark'
6+
required: true
7+
current_batch:
8+
description: 'Current batch index'
9+
required: true
10+
current_index:
11+
description: 'Current configuration index'
12+
required: true
13+
job_index:
14+
description: 'Strategy job index'
15+
required: true
16+
machines_info:
17+
description: 'JSON array of machine pairs'
18+
required: false
19+
default: '[]'
20+
outputs:
21+
server_name:
22+
description: 'The server machine name'
23+
value: ${{ steps.extract.outputs.server_name }}
24+
client_name:
25+
description: 'The client machine name'
26+
value: ${{ steps.extract.outputs.client_name }}
27+
runs:
28+
using: "composite"
29+
steps:
30+
- name: Extract machine names
31+
id: extract
32+
shell: bash
33+
run: |
34+
MACHINES_PER_BENCH="${{ inputs.machines_per_bench }}"
35+
CURRENT_BATCH="${{ inputs.current_batch }}"
36+
CURRENT_INDEX="${{ inputs.current_index }}"
37+
JOB_INDEX="${{ inputs.job_index }}"
38+
MACHINES_INFO='${{ inputs.machines_info }}'
39+
40+
if [ "$MACHINES_PER_BENCH" = "false" ]; then
41+
# Extract server and client names from machines_info array using jq
42+
SERVER_NAME=$(echo "$MACHINES_INFO" | jq -r ".[$JOB_INDEX].server_name")
43+
CLIENT_NAME=$(echo "$MACHINES_INFO" | jq -r ".[$JOB_INDEX].client_name")
44+
45+
if [ "$SERVER_NAME" = "null" ] || [ "$CLIENT_NAME" = "null" ]; then
46+
echo "Error: Could not find machine info for job index $JOB_INDEX in machines_info"
47+
echo "Available machines_info: $MACHINES_INFO"
48+
exit 1
49+
fi
50+
else
51+
SERVER_NAME="benchmark-cascade-server-${CURRENT_INDEX}"
52+
CLIENT_NAME="benchmark-cascade-client-${CURRENT_INDEX}"
53+
fi
54+
55+
echo "server_name=$SERVER_NAME" >> $GITHUB_OUTPUT
56+
echo "client_name=$CLIENT_NAME" >> $GITHUB_OUTPUT
57+
echo "Using machines: SERVER_NAME=$SERVER_NAME, CLIENT_NAME=$CLIENT_NAME"

0 commit comments

Comments
 (0)