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
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,37 @@ jobs:

- name: Run tests
run: uv run pytest -v

ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Set up Python
run: uv python install

- name: Install dependencies
run: uv sync --dev

- name: Run ruff
run: uv run ruff check .

ty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Set up Python
run: uv python install

- name: Install dependencies
run: uv sync --dev

- name: Run ty
run: uv run ty check
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ packages = ["src/expb"]
dev = [
"hatchling>=1.29.0",
"pytest>=8.0.0",
"ruff>=0.10.0",
"ty>=0.0.1a1",
]

[tool.pytest.ini_options]
Expand Down
1 change: 0 additions & 1 deletion src/expb/configs/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
BaseModel,
Field,
FilePath,
NewPath,
field_serializer,
field_validator,
model_validator,
Expand Down
16 changes: 16 additions & 0 deletions src/expb/execute_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ def execute_scenario(
help="Enable JetBrains dotTrace profiling. Auto-installs if needed. Snapshot saved to outputs directory.",
),
] = False,
client_restart_retries: Annotated[
int,
typer.Option(
min=0,
help="Auto-restart the execution client on failure up to N times (0 = never restart). Infrastructure containers (K6, Alloy, payload server) never restart.",
),
] = 0,
reap_orphans: Annotated[
bool,
typer.Option(
"--reap-orphans/--no-reap-orphans",
help="Before running, force-remove leftover containers/networks from prior runs of this same scenario (e.g. orphaned by a hard-killed run). Scoped to the scenario, so it won't disturb other runs on the machine. Off by default.",
),
] = False,
use_lock: Annotated[
bool,
typer.Option(
Expand Down Expand Up @@ -150,6 +164,8 @@ def execute_scenario(
client_metrics=client_metrics,
stable_cpu=stable_cpu,
dottrace=dottrace,
client_restart_retries=client_restart_retries,
reap_orphans=reap_orphans,
),
)
except ExecutionLockError as e:
Expand Down
16 changes: 16 additions & 0 deletions src/expb/execute_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ def execute_scenarios(
help="Enable JetBrains dotTrace profiling. Auto-installs if needed. Snapshot saved to outputs directory.",
),
] = False,
client_restart_retries: Annotated[
int,
typer.Option(
min=0,
help="Auto-restart the execution client on failure up to N times (0 = never restart). Infrastructure containers (K6, Alloy, payload server) never restart.",
),
] = 0,
reap_orphans: Annotated[
bool,
typer.Option(
"--reap-orphans/--no-reap-orphans",
help="Before running, force-remove leftover containers/networks from prior runs of this same scenario (e.g. orphaned by a hard-killed run). Scoped to the scenario, so it won't disturb other runs on the machine. Off by default.",
),
] = False,
use_lock: Annotated[
bool,
typer.Option(
Expand Down Expand Up @@ -186,6 +200,8 @@ def execute_scenarios(
client_metrics=client_metrics,
stable_cpu=stable_cpu,
dottrace=dottrace,
client_restart_retries=client_restart_retries,
reap_orphans=reap_orphans,
),
)
if not loop:
Expand Down
2 changes: 2 additions & 0 deletions src/expb/payloads/compressor/compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def start_nethermind(
)

container.reload()
if container.attrs is None:
raise ValueError("Container attributes are not available")
container_ip = container.attrs["NetworkSettings"]["Networks"][
container_network.name
]["IPAddress"]
Expand Down
Loading
Loading