feat: add security_opt support for execution client containers#9
Open
feat: add security_opt support for execution client containers#9
Conversation
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 ```
There was a problem hiding this comment.
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
Scenarioconfig with asecurity_opt: list[str]field. - Plumb
security_optthroughExecutorConfig. - Pass
security_optintodocker.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.
14 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
security_optfield to scenario config, passed to Dockercontainers.run()seccomp=unconfinedfor profilingperfcollectinside a container requiresperf_event_openwhich Docker's default seccomp profile blocksWritePGOData) during shutdown before Docker sends SIGKILLUsage
Changes
configs/scenarios.py: Addsecurity_opt: list[str]field toScenarioexecutor_config.py: Wiresecurity_optthroughExecutorConfigasexecution_client_security_optexecutor.py: Passexecution_client_security_opttodocker.containers.run()kwargsexecutor.py:execution_client_container.stop(timeout=120)- increase SIGTERM-to-SIGKILL grace period from default 10s to 120s