Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ on:
server_type:
description: 'Hetzner server type'
required: false
default: 'cx42'
default: 'cpx21'
type: choice
options:
- 'cx22' # 2 vCPU, 4GB RAM
- 'cx42' # 8 vCPU, 16GB RAM
- 'cpx21' # 3 vCPU, 4GB RAM (AMD)
- 'cpx41' # 8 vCPU, 16GB RAM (AMD)
commit_range:
description: 'Commit range to benchmark (e.g., HEAD~5..HEAD)'
required: false
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m csp_benchmarks.hetzner.cli run \
--server-type ${{ github.event.inputs.server_type || 'cx22' }} \
--server-type ${{ github.event.inputs.server_type || 'cpx21' }} \
--ssh-key ~/.ssh/hetzner_key \
--commits "${{ github.event.inputs.commit_range || 'HEAD^!' }}" \
--push
Expand Down
14 changes: 7 additions & 7 deletions csp_benchmarks/asv-machine.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"os": "Ubuntu 24.04",
"ram": "7GB"
},
"hetzner-cx22": {
"hetzner-cpx21": {
"arch": "x86_64",
"cpu": "Intel Xeon (2 vCPU)",
"machine": "hetzner-cx22",
"num_cpu": "2",
"cpu": "AMD EPYC (3 vCPU)",
"machine": "hetzner-cpx21",
"num_cpu": "3",
"os": "Ubuntu 24.04",
"ram": "4GB"
},
"hetzner-cx42": {
"hetzner-cpx41": {
"arch": "x86_64",
"cpu": "Intel Xeon (8 vCPU)",
"machine": "hetzner-cx42",
"cpu": "AMD EPYC (8 vCPU)",
"machine": "hetzner-cpx41",
"num_cpu": "8",
"os": "Ubuntu 24.04",
"ram": "16GB"
Expand Down
2 changes: 1 addition & 1 deletion csp_benchmarks/hetzner/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main() -> int:
run_parser = subparsers.add_parser("run", help="Run benchmarks on Hetzner Cloud")
run_parser.add_argument("--token", help="Hetzner Cloud API token")
run_parser.add_argument("--server-name", default="csp-benchmark-runner", help="Server name")
run_parser.add_argument("--server-type", default="cx22", help="Hetzner server type (cx22, cx42, etc.)")
run_parser.add_argument("--server-type", default="cpx21", help="Hetzner server type (cpx21, cpx41, cpx51)")
run_parser.add_argument("--ssh-key", help="Path to SSH private key")
run_parser.add_argument("--ssh-key-name", help="Name of SSH key in Hetzner")
run_parser.add_argument("--branches", default="main", help="Comma-separated list of branches")
Expand Down
2 changes: 1 addition & 1 deletion csp_benchmarks/hetzner/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ServerConfig:
"""Configuration for a Hetzner benchmark server."""

name: str = "csp-benchmark-runner"
server_type: str = "cx22" # 2 vCPU, 4GB RAM - entry-level for benchmarks
server_type: str = "cpx21" # 3 vCPU, 4GB RAM (AMD)
image: str = "ubuntu-24.04"
location: str = "fsn1" # Falkenstein, Germany
ssh_key_name: str | None = None
Expand Down
9 changes: 0 additions & 9 deletions csp_benchmarks/results/hetzner-cx32/machine.json

This file was deleted.

8 changes: 4 additions & 4 deletions csp_benchmarks/tests/test_hetzner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_default_config(self):

config = ServerConfig()
assert config.name == "csp-benchmark-runner"
assert config.server_type == "cx22"
assert config.server_type == "cpx21"
assert config.image == "ubuntu-24.04"
assert config.location == "fsn1"
assert config.ssh_key_name is None
Expand All @@ -29,13 +29,13 @@ def test_custom_config(self):

config = ServerConfig(
name="custom-runner",
server_type="cx52",
server_type="cpx51",
image="ubuntu-22.04",
location="nbg1",
ssh_key_name="my-key",
)
assert config.name == "custom-runner"
assert config.server_type == "cx52"
assert config.server_type == "cpx51"
assert config.image == "ubuntu-22.04"
assert config.location == "nbg1"
assert config.ssh_key_name == "my-key"
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_run_benchmarks_no_token(self, mock_runner, mock_manager):
args = MagicMock()
args.token = None
args.server_name = "test"
args.server_type = "cx32"
args.server_type = "cpx21"
args.ssh_key_name = None
args.branches = "main"
args.commits = None
Expand Down
19 changes: 9 additions & 10 deletions docs/wiki/Hetzner-Cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ python -m csp_benchmarks.hetzner.cli run

# With options
python -m csp_benchmarks.hetzner.cli run \
--server-type cx42 \
--server-type cpx41 \
--commits "HEAD~5..HEAD" \
--push
```
Expand All @@ -56,7 +56,7 @@ python -m csp_benchmarks.hetzner.cli run \
| ---------------- | ----------------------- | ---------------------- |
| `--token` | Hetzner API token | `$HCLOUD_TOKEN` |
| `--server-name` | Server name | `csp-benchmark-runner` |
| `--server-type` | Server size | `cx22` |
| `--server-type` | Server size | `cpx21` |
| `--ssh-key` | Path to SSH private key | None |
| `--ssh-key-name` | Hetzner SSH key name | None |
| `--branches` | Branches to benchmark | `main` |
Expand All @@ -75,11 +75,11 @@ python -m csp_benchmarks.hetzner.cli cleanup

## Server Types

| Type | vCPU | RAM | Use Case |
| ---- | ---- | ---- | --------------------- |
| cx22 | 2 | 4GB | Quick tests (default) |
| cx42 | 8 | 16GB | Standard benchmarks |
| cx52 | 16 | 32GB | Large benchmarks |
| Type | vCPU | RAM | Use Case |
| ----- | ---- | ---- | --------------------- |
| cpx21 | 3 | 4GB | Quick tests (default) |
| cpx41 | 8 | 16GB | Standard benchmarks |
| cpx51 | 16 | 32GB | Large benchmarks |

## GitHub Actions

Expand Down Expand Up @@ -149,8 +149,7 @@ Approximate costs (as of 2024):

| Server | Hourly | Monthly |
| ------ | ------ | ------- |
| cx22 | €0.006 | €4.35 |
| cx42 | €0.021 | €15.03 |
| cx52 | €0.040 | €28.73 |
| cpx21 | €0.008 | €5.18 |
| cpx41 | €0.027 | €17.49 |

Servers are automatically deleted after benchmarks complete.