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

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

Merged
merged 12 commits into from
Feb 11, 2025

Conversation

andrejpk
Copy link
Contributor

@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 75.11%. Comparing base (a9db384) to head (a452c7b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5383      +/-   ##
==========================================
+ Coverage   75.10%   75.11%   +0.01%     
==========================================
  Files         167      167              
  Lines        9906     9911       +5     
==========================================
+ Hits         7440     7445       +5     
  Misses       2466     2466              
Flag Coverage Δ
unittests 75.11% <100.00%> (+0.01%) ⬆️

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
python/uv.lock Outdated Show resolved Hide resolved
@andrejpk andrejpk changed the title DockerCommandLineCodeExecutor support for additional volume mounts, exposed host ports feat: DockerCommandLineCodeExecutor support for additional volume mounts, exposed host ports Feb 11, 2025
@ekzhu ekzhu merged commit 540c4fb into microsoft:main Feb 11, 2025
65 of 67 checks passed
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
2 participants