OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

support remote docker accessing

Open a775189488 opened this issue 1 year ago • 2 comments

What problem or use case are you trying to solve? for resources org considering. my docker cluster and development environment are not on the same machine. so i try to set env DOCKER_HOST=tcp://{remote_ip}:{remote_port} to support this case and it can successfully start a container in the remote cluster. but it fail at starting a ssh session because it is hard-coded hostname as 'localhost' [opendevin/sandbox/sandbox.py:205]

Describe the UX of the solution you'd like NA

Do you have thoughts on the technical implementation? Identify env DOCKER_HOST. and extract ip as hostname from it when it startwiths 'tcp://'

        if os.getenv("DOCKER_HOST").startswith("tcp"):
            hostname = os.getenv("DOCKER_HOST").replace("tcp://", "").split(":")[0]

Describe alternatives you've considered No

Additional context NA

a775189488 avatar Apr 10 '24 10:04 a775189488

This is a great enhancement! Thanks for the request

rbren avatar Apr 12 '24 09:04 rbren

https://github.com/OpenDevin/OpenDevin/blob/6150ab6a3e09cfe257afde7c527bf6eb46b95e1e/opendevin/runtime/docker/exec_box.py#L38-L63

Since opendevin initializes the Docker connection with self.docker_client = docker.from_env(), you can set the DOCKER_HOST environment variable to manage remote Docker environments.

Umpire2018 avatar May 07 '24 06:05 Umpire2018

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 24 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Jul 01 '24 01:07 github-actions[bot]