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: add argument --base-container-image to resolver #7612

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

Conversation

Tetsu-is
Copy link

@Tetsu-is Tetsu-is commented Apr 1, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality that this introduces.

Enabled custom sandbox for resolver. You can apply base image with --base-container image YOUR_BASE_CONTAINER_IMAGE

example

python -m openhands.resolver.resolve_issue --selected-repo [OWNER]/[REPO] --issue-number [NUMBER] --base-container-image [YOUR_BASE_CONTAINER_IMAGE]

Give a summary of what the PR does, explaining any non-trivial design decisions.
I added base_container_image setting for resolver in order to enable github actions to use any programming language.
Instead, we have to specify -runtime-container-image even when we don't use custom sandbox(I will fix it so that user dont have to specify when using defaultt runtime image)

  • add command line argument --base-container-image to resolver.resolve_issue.py
  • add argument line--base-container-image to resolver.resolve_all_issues.py

Link of any specific issues this addresses.

I haven't created issue about this topic.

@Tetsu-is Tetsu-is changed the title add argument --base-container-image for resolver feat: add argument --base-container-image for resolver Apr 1, 2025
@Tetsu-is Tetsu-is changed the title feat: add argument --base-container-image for resolver feat: add argument --base-container-image to resolver Apr 1, 2025
Comment on lines 636 to 639
if runtime_container_image is None and not my_args.is_experimental:
runtime_container_image = (
f'ghcr.io/all-hands-ai/runtime:{openhands.__version__}-nikolaik'
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Tetsu-is ! Could you explain why these lines were removed?

Copy link
Author

@Tetsu-is Tetsu-is Apr 8, 2025

Choose a reason for hiding this comment

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

@neubig
Of course.

In the existing implementation, custom sandbox will be build only when runtime_container_image is None & `base_container_image is Not None (openhands/runtime/impl/docker/docker_runtime.py).

if self.runtime_container_image is None:
                if self.base_container_image is None:
                    raise ValueError(
                        'Neither runtime container image nor base container image is set'
                    )
                self.send_status_message('STATUS$STARTING_CONTAINER')
                self.runtime_container_image = build_runtime_image(
                   self.base_container_image,
                    ...
                )

When executed likepython -m openhands.resolver.resolve_issue --base-container-image BASE_IMAGE, the runtime_container_image is not provided, and only the base_container_image is given. At that time, if 'ghcr.io/all-hands-ai/runtime:{openhands.version}-nikolaik' is assigned to runtime_container_image, the build of the custom sandbox will not be executed.

My ideal scenario is below.

runtime-container-image base-container-image result
given given error
given not given build sandbox with runtime-container-image
not given given build sandbox with base-container-image
not given not given error or build sandbox with default nikolaik

When runtime-container-image is not given, do you think ghcr.io/all-hands-ai/runtime:{openhands.__version__}-nikolaik should be set as default?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please correct me if I'm misunderstanding, not given + not given is the default case, when the user doesn't have a special requirement for a particular image, so they run the resolver without setting any of those. In that case, the result should be "build sandbox with default nikolaik".

Unless they set is_experimental, in which case it shouldn't set it, so that it builds from source, which will mean build from main. (experimental installs openhands main instead of the latest released version IIRC)

Do you think this behavior should change, or actually, does it change in this PR?

Copy link
Author

Choose a reason for hiding this comment

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

@enyst
Thank you for your advice. I didn't understand the meaning of is_experimental flag.
I agree with you . Default behavior should be building sandbox with default nikolaik image.

I will change it in this PR.

Copy link
Author

@Tetsu-is Tetsu-is Apr 11, 2025

Choose a reason for hiding this comment

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

fb9035c

when not specifying base-conatiner-image and runtime-container-image, use default nikolaik.

@neubig neubig self-assigned this Apr 6, 2025
@Tetsu-is Tetsu-is requested a review from neubig April 8, 2025 07:01
Comment on lines +162 to +169
builder_cmd = ['docker', 'buildx', 'use', 'default']
subprocess.Popen(
builder_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
)

Copy link
Author

@Tetsu-is Tetsu-is Apr 11, 2025

Choose a reason for hiding this comment

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

If the default builder instance is not specified, the sandbox build will fail because it cannot reference the base container image.(when I tried in my repository)

@Tetsu-is Tetsu-is requested a review from enyst April 12, 2025 09:41
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.

3 participants