OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Add support for .openhands/setup.sh script

Open rbren opened this issue 11 months ago • 8 comments

This PR adds support for running .openhands/setup.sh after runtime initialization.

  • Add maybe_run_setup_script method to Runtime class
  • Run setup script after cloning repository
  • Use runtime file operations to read and execute script

The setup script is run in the runtime environment, similar to how other runtime operations work.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:4ae95d0-nikolaik   --name openhands-app-4ae95d0   docker.all-hands.dev/all-hands-ai/openhands:4ae95d0

rbren avatar Jan 02 '25 21:01 rbren

@rbren gentle ping to see if this is on your radar

mamoodi avatar Jan 14 '25 14:01 mamoodi

Yup still want to get this done! Haven't had time to test yet though

rbren avatar Jan 14 '25 17:01 rbren

@openhands-agent can you fix the merge conflicts? Look at diff vs main and understand the conflicts first

rbren avatar Jan 14 '25 17:01 rbren

OpenHands started fixing the pr! You can monitor the progress here.

openhands-agent avatar Jan 14 '25 17:01 openhands-agent

We sit in this state for up to 120s Screenshot 2025-01-23 at 12 00 28 PM

rbren avatar Jan 23 '25 17:01 rbren

Pinging @rbren since he's back if this is in progress.

mamoodi avatar Feb 10 '25 14:02 mamoodi

Thanks--need to check in on Engel's point above about running multiple times. Definitely a valid concern

rbren avatar Feb 10 '25 15:02 rbren

@rbren in case this fell of your radar

mamoodi avatar Feb 26 '25 15:02 mamoodi

@openhands fix the merge conflicts

rbren avatar Mar 22 '25 15:03 rbren

I'm on it! @rbren can track my progress at all-hands.dev

openhands-ai[bot] avatar Mar 22 '25 15:03 openhands-ai[bot]

I have fixed the merge conflicts by resolving the issue in agent_session.py. The PR should now be ready to merge.

rbren avatar Mar 22 '25 16:03 rbren

I'm going to just say "setup.sh should be idempotent" and get this in

rbren avatar Mar 22 '25 16:03 rbren

I'm going to just say "setup.sh should be idempotent" and get this in

I made an issue for it, to remember for later: https://github.com/All-Hands-AI/OpenHands/issues/7419

enyst avatar Mar 22 '25 17:03 enyst