Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockerCommandLineCodeExecutor support for additional volume mounts, exposed host ports #5383

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

andrejpk
Copy link

@andrejpk andrejpk commented Feb 5, 2025

Add the following additional configuration options to DockerCommandLineCodeExectutor:

  • extra_volumes (Optional[Dict[str, Dict[str, str]]], optional): A dictionary of extra volumes (beyond the work_dir) to mount to the container. Defaults to None.
  • extra_hosts (Optional[Dict[str, str]], optional): A dictionary of host mappings to add to the container. (See Docker docs on extra_hosts) Defaults to None.
  • init_command (Optional[str], optional): A shell command to run before each shell operation execution. Defaults to None. 

Why are these changes needed?

See linked issue below.

In summary: Enable the agents to:

  • work with a richer set of sys admin tools on top of code execution
  • add support for a 'project' directory the agents can interact on that's accessible by bash tools and custom scripts

Related issue number

Closes #5363

Checks

@andrejpk andrejpk changed the title Integrate code on extra args DockerCommandLineCodeExecutor support for additional volume mounts, exposed host ports Feb 5, 2025
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.93%. Comparing base (da6f918) to head (6d23adc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5383      +/-   ##
==========================================
+ Coverage   76.25%   77.93%   +1.68%     
==========================================
  Files         192      158      -34     
  Lines       10607     9586    -1021     
  Branches      138        0     -138     
==========================================
- Hits         8088     7471     -617     
+ Misses       2422     2115     -307     
+ Partials       97        0      -97     
Flag Coverage Δ
unittests 77.93% <100.00%> (+1.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrejpk andrejpk marked this pull request as ready for review February 6, 2025 20:48
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.

DockerCommandLineCodeExecutor support for additional volume mounts, exposed host ports
1 participant