Skip to content

feat: add security_opt support for execution client containers#9

Open
benaadams wants to merge 6 commits intomainfrom
feat/security-opt-support
Open

feat: add security_opt support for execution client containers#9
benaadams wants to merge 6 commits intomainfrom
feat/security-opt-support

Conversation

@benaadams
Copy link
Member

@benaadams benaadams commented Mar 20, 2026

Summary

  • Add security_opt field to scenario config, passed to Docker containers.run()
  • Enables setting Docker security options like seccomp=unconfined for profiling
  • Needed for PGO collection: perfcollect inside a container requires perf_event_open which Docker's default seccomp profile blocks
  • Increase execution client stop timeout from 10s to 120s so the runtime has time to flush data (e.g. RocksDB memtables, PGO profiles via WritePGOData) during shutdown before Docker sends SIGKILL

Usage

scenarios:
  nethermind-pgo-sampling:
    security_opt:
      - seccomp=unconfined

Changes

  • configs/scenarios.py: Add security_opt: list[str] field to Scenario
  • executor_config.py: Wire security_opt through ExecutorConfig as execution_client_security_opt
  • executor.py: Pass execution_client_security_opt to docker.containers.run() kwargs
  • executor.py: execution_client_container.stop(timeout=120) - increase SIGTERM-to-SIGKILL grace period from default 10s to 120s

Add a `security_opt` field to the scenario config that gets passed
to Docker's `containers.run()`. This allows setting Docker security
options like `seccomp=unconfined` which is needed for profiling tools
(e.g., perf/perfcollect) to call `perf_event_open` inside containers.

Example usage in scenario config:
```yaml
security_opt:
  - seccomp=unconfined
```
Copilot AI review requested due to automatic review settings March 20, 2026 08:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds scenario-level support for Docker security_opt and wires it through the executor so execution client containers can be started with custom Docker security options (e.g., seccomp=unconfined) needed for in-container profiling/PGO collection.

Changes:

  • Extend Scenario config with a security_opt: list[str] field.
  • Plumb security_opt through ExecutorConfig.
  • Pass security_opt into docker.containers.run() when starting the execution client container.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/expb/payloads/executor/executor_config.py Store scenario security_opt on the executor config object.
src/expb/payloads/executor/executor.py Include security_opt in Docker run() kwargs for the execution client container.
src/expb/configs/scenarios.py Add security_opt to the scenario schema for YAML config support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

WritePGOData only flushes on process exit (SIGTERM handler), not while
idle. The 30s sleep before stop was pointless - Nethermind just sits
waiting for blocks. Instead increase Docker's SIGTERM-to-SIGKILL
timeout from 10s to 60s so the shutdown handler has time to flush.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants