Skip to content

Commit 8d543ad

Browse files
committed
Merge branch 'main' into kevin
2 parents 579004b + 803bdce commit 8d543ad

253 files changed

Lines changed: 10226 additions & 3866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# This script updates the PR description with commands to run the PR locally
6+
# It adds both Docker and uvx commands
7+
8+
# Get the branch name for the PR
9+
BRANCH_NAME=$(gh pr view "$PR_NUMBER" --json headRefName --jq .headRefName)
10+
11+
# Define the Docker command
12+
DOCKER_RUN_COMMAND="docker run -it --rm \
13+
-p 3000:3000 \
14+
-v /var/run/docker.sock:/var/run/docker.sock \
15+
--add-host host.docker.internal:host-gateway \
16+
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:${SHORT_SHA}-nikolaik \
17+
--name openhands-app-${SHORT_SHA} \
18+
docker.all-hands.dev/all-hands-ai/openhands:${SHORT_SHA}"
19+
20+
# Define the uvx command
21+
UVX_RUN_COMMAND="uvx --python 3.12 --from git+https://github.com/All-Hands-AI/OpenHands@${BRANCH_NAME} openhands"
22+
23+
# Get the current PR body
24+
PR_BODY=$(gh pr view "$PR_NUMBER" --json body --jq .body)
25+
26+
# Prepare the new PR body with both commands
27+
if echo "$PR_BODY" | grep -q "To run this PR locally, use the following command:"; then
28+
# For existing PR descriptions, use a more robust approach
29+
# Split the PR body at the "To run this PR locally" section and replace everything after it
30+
BEFORE_SECTION=$(echo "$PR_BODY" | sed '/To run this PR locally, use the following command:/,$d')
31+
NEW_PR_BODY=$(cat <<EOF
32+
${BEFORE_SECTION}
33+
34+
To run this PR locally, use the following command:
35+
36+
GUI with Docker:
37+
\`\`\`
38+
${DOCKER_RUN_COMMAND}
39+
\`\`\`
40+
41+
CLI with uvx:
42+
\`\`\`
43+
${UVX_RUN_COMMAND}
44+
\`\`\`
45+
EOF
46+
)
47+
else
48+
# For new PR descriptions: use heredoc safely without indentation
49+
NEW_PR_BODY=$(cat <<EOF
50+
$PR_BODY
51+
52+
---
53+
54+
To run this PR locally, use the following command:
55+
56+
GUI with Docker:
57+
\`\`\`
58+
${DOCKER_RUN_COMMAND}
59+
\`\`\`
60+
61+
CLI with uvx:
62+
\`\`\`
63+
${UVX_RUN_COMMAND}
64+
\`\`\`
65+
EOF
66+
)
67+
fi
68+
69+
# Update the PR description
70+
echo "Updating PR description with Docker and uvx commands"
71+
gh pr edit "$PR_NUMBER" --body "$NEW_PR_BODY"

.github/workflows/ghcr-build.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -344,29 +344,5 @@ jobs:
344344
SHORT_SHA: ${{ steps.short_sha.outputs.SHORT_SHA }}
345345
shell: bash
346346
run: |
347-
echo "updating PR description"
348-
DOCKER_RUN_COMMAND="docker run -it --rm \
349-
-p 3000:3000 \
350-
-v /var/run/docker.sock:/var/run/docker.sock \
351-
--add-host host.docker.internal:host-gateway \
352-
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:$SHORT_SHA-nikolaik \
353-
--name openhands-app-$SHORT_SHA \
354-
docker.all-hands.dev/all-hands-ai/openhands:$SHORT_SHA"
355-
356-
PR_BODY=$(gh pr view $PR_NUMBER --json body --jq .body)
357-
358-
if echo "$PR_BODY" | grep -q "To run this PR locally, use the following command:"; then
359-
UPDATED_PR_BODY=$(echo "${PR_BODY}" | sed -E "s|docker run -it --rm.*|$DOCKER_RUN_COMMAND|")
360-
else
361-
UPDATED_PR_BODY="${PR_BODY}
362-
363-
---
364-
365-
To run this PR locally, use the following command:
366-
\`\`\`
367-
$DOCKER_RUN_COMMAND
368-
\`\`\`"
369-
fi
370-
371-
echo "updated body: $UPDATED_PR_BODY"
372-
gh pr edit $PR_NUMBER --body "$UPDATED_PR_BODY"
347+
echo "Updating PR description with Docker and uvx commands"
348+
bash ${GITHUB_WORKSPACE}/.github/scripts/update_pr_description.sh

.github/workflows/py-tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
- name: Build Environment
4949
run: make build
5050
- name: Run Unit Tests
51-
run: poetry run pytest --forked -n auto -svv ./tests/unit
51+
run: PYTHONPATH=".:$PYTHONPATH" poetry run pytest --forked -n auto -svv ./tests/unit
5252
- name: Run Runtime Tests with CLIRuntime
53-
run: TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
53+
run: PYTHONPATH=".:$PYTHONPATH" TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
5454
- name: Run E2E Tests
55-
run: poetry run pytest -svv tests/e2e
55+
run: PYTHONPATH=".:$PYTHONPATH" poetry run pytest -svv tests/e2e
5656

5757
# Run specific Windows python tests
5858
test-on-windows:
@@ -77,9 +77,11 @@ jobs:
7777
- name: Run Windows unit tests
7878
run: poetry run pytest -svv tests/unit/test_windows_bash.py
7979
env:
80+
PYTHONPATH: ".;$env:PYTHONPATH"
8081
DEBUG: "1"
8182
- name: Run Windows runtime tests with LocalRuntime
8283
run: $env:TEST_RUNTIME="local"; poetry run pytest -svv tests/runtime/test_bash.py
8384
env:
85+
PYTHONPATH: ".;$env:PYTHONPATH"
8486
TEST_RUNTIME: local
8587
DEBUG: "1"

.github/workflows/stale.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
steps:
1313
- uses: actions/stale@v9
1414
with:
15-
stale-issue-message: '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.'
16-
stale-pr-message: 'This PR 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.'
17-
days-before-stale: 30
15+
stale-issue-message: 'This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.'
16+
stale-pr-message: 'This PR is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.'
17+
days-before-stale: 40
1818
exempt-issue-labels: 'roadmap'
19-
close-issue-message: 'This issue was closed because it has been stalled for over 30 days with no activity.'
20-
close-pr-message: 'This PR was closed because it has been stalled for over 30 days with no activity.'
21-
days-before-close: 7
19+
close-issue-message: 'This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.'
20+
close-pr-message: 'This PR was closed because it had no activity for 50 days. If you feel this was closed in error, and you would like to continue the PR, please resubmit or let us know.'
21+
days-before-close: 10
2222
operations-per-run: 150

Development.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _Dev Container: Reopen in Container_ command from the Command Palette
3434

3535
#### Develop without sudo access
3636

37-
If you want to develop without system admin/sudo access to upgrade/install `Python` and/or `NodeJs`, you can use
37+
If you want to develop without system admin/sudo access to upgrade/install `Python` and/or `NodeJS`, you can use
3838
`conda` or `mamba` to manage the packages for you:
3939

4040
```bash
@@ -71,7 +71,7 @@ This command will prompt you to enter the LLM API key, model name, and other var
7171
tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI,
7272
please set the model in the UI.
7373

74-
Note: If you have previously run OpenHands using the docker command, you may have already set some environmental
74+
Note: If you have previously run OpenHands using the docker command, you may have already set some environment
7575
variables in your terminal. The final configurations are set from highest to lowest priority:
7676
Environment variables > config.toml variables > default variables
7777

@@ -154,12 +154,12 @@ poetry run pytest ./tests/unit/test_*.py
154154
1. Add your dependency in `pyproject.toml` or use `poetry add xxx`.
155155
2. Update the poetry.lock file via `poetry lock`.
156156

157-
### 9. Use existing Docker image
157+
### 10. Use existing Docker image
158158

159159
To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker
160160
container image by setting the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image.
161161

162-
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.50-nikolaik`
162+
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.51-nikolaik`
163163

164164
## Develop inside Docker container
165165

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BACKEND_HOST ?= "127.0.0.1"
66
BACKEND_PORT ?= 8000
77
BACKEND_HOST_PORT = "$(BACKEND_HOST):$(BACKEND_PORT)"
88
FRONTEND_HOST ?= "127.0.0.1"
9-
FRONTEND_PORT = 3001
9+
FRONTEND_PORT ?= 3001
1010
DEFAULT_WORKSPACE_DIR = "./workspace"
1111
DEFAULT_MODEL = "gpt-4o"
1212
CONFIG_FILE = config.toml
@@ -233,7 +233,7 @@ install-python-dependencies:
233233
else \
234234
poetry run pip install -r requirements-extra.txt --quiet; \
235235
fi
236-
236+
237237
@if [ "$$consent" = "y" ]; then \
238238
# https://github.com/kuangkzh/pylcs/issues/3 \
239239
sudo add-apt-repository ppa:deadsnakes/ppa; \

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ system requirements and more information.
169169
170170

171171
```bash
172-
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik
172+
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik
173173

174174
docker run -it --rm --pull=always \
175-
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik \
175+
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik \
176176
-e LOG_ALL_EVENTS=true \
177177
-v /var/run/docker.sock:/var/run/docker.sock \
178178
-v ~/.openhands:/.openhands \
179179
-p 3000:3000 \
180180
--add-host host.docker.internal:host-gateway \
181181
--name openhands-app \
182-
docker.all-hands.dev/all-hands-ai/openhands:0.50
182+
docker.all-hands.dev/all-hands-ai/openhands:0.51
183183
```
184184

185185
> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location.

README_CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ OpenHands也可以使用Docker在本地系统上运行。
5151
5252

5353
```bash
54-
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik
54+
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik
5555

5656
docker run -it --rm --pull=always \
57-
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik \
57+
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik \
5858
-e LOG_ALL_EVENTS=true \
5959
-v /var/run/docker.sock:/var/run/docker.sock \
6060
-v ~/.openhands:/.openhands \
6161
-p 3000:3000 \
6262
--add-host host.docker.internal:host-gateway \
6363
--name openhands-app \
64-
docker.all-hands.dev/all-hands-ai/openhands:0.50
64+
docker.all-hands.dev/all-hands-ai/openhands:0.51
6565
```
6666

6767
> **注意**: 如果您在0.44版本之前使用过OpenHands,您可能需要运行 `mv ~/.openhands-state ~/.openhands` 来将对话历史迁移到新位置。

README_JA.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ OpenHandsはDockerを利用してローカル環境でも実行できます。
4242
> 公共ネットワークで実行していますか?[Hardened Docker Installation Guide](https://docs.all-hands.dev/usage/runtimes/docker#hardened-docker-installation)を参照して、ネットワークバインディングの制限や追加のセキュリティ対策を実施してください。
4343
4444
```bash
45-
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik
45+
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik
4646

4747
docker run -it --rm --pull=always \
48-
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.50-nikolaik \
48+
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik \
4949
-e LOG_ALL_EVENTS=true \
5050
-v /var/run/docker.sock:/var/run/docker.sock \
5151
-v ~/.openhands:/.openhands \
5252
-p 3000:3000 \
5353
--add-host host.docker.internal:host-gateway \
5454
--name openhands-app \
55-
docker.all-hands.dev/all-hands-ai/openhands:0.50
55+
docker.all-hands.dev/all-hands-ai/openhands:0.51
5656
```
5757

5858
****: バージョン0.44以前のOpenHandsを使用していた場合は、会話履歴を移行するために `mv ~/.openhands-state ~/.openhands` を実行してください。

containers/app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ RUN sed -i 's/^UID_MIN.*/UID_MIN 499/' /etc/login.defs
6161
# Default is 60000, but we've seen up to 200000
6262
RUN sed -i 's/^UID_MAX.*/UID_MAX 1000000/' /etc/login.defs
6363

64-
RUN groupadd app
65-
RUN useradd -l -m -u $OPENHANDS_USER_ID -s /bin/bash openhands && \
64+
RUN groupadd --gid $OPENHANDS_USER_ID app
65+
RUN useradd -l -m -u $OPENHANDS_USER_ID --gid $OPENHANDS_USER_ID -s /bin/bash openhands && \
6666
usermod -aG app openhands && \
6767
usermod -aG sudo openhands && \
6868
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

0 commit comments

Comments
 (0)