Skip to content

Commit c3c323d

Browse files
feat: Apply patches and add CI workflows for stable release
1 parent 1b9c17e commit c3c323d

4 files changed

Lines changed: 83 additions & 17 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
name: Build OpenHands Image
3+
4+
on:
5+
push:
6+
branches:
7+
- release/stable-with-patches
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.12"
34+
35+
- name: Install Poetry
36+
run: pipx install poetry
37+
38+
- name: Install dependencies
39+
run: poetry install --no-interaction --no-ansi
40+
41+
42+
- name: Build and Push OpenHands Image
43+
run: |
44+
echo "Building openhands image with tag stable-with-patches and git sha tag..."
45+
# Set DOCKER_IMAGE_TAG for build.sh to pick up
46+
export DOCKER_IMAGE_TAG=stable-with-patches
47+
# Set RELEVANT_SHA for build.sh to add git sha tag
48+
export RELEVANT_SHA=${{ github.sha }}
49+
./containers/build.sh -i openhands --push -o remind101
50+
env:
51+
# Pass GITHUB_TOKEN for potential git operations within build script if needed
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-stable-patches-images.yml renamed to .github/workflows/build-runtime-image.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: Build Stable Patches Images
2+
name: Build Runtime Image
33

44
on:
55
push:
@@ -38,6 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
run: poetry install --no-interaction --no-ansi
4040

41+
4142
- name: Prepare Runtime Build Context
4243
run: poetry run python openhands/runtime/utils/runtime_build.py --build_folder ./containers/runtime
4344
env:
@@ -46,17 +47,9 @@ jobs:
4647
# Ensure the script knows the target repo (though build.sh overrides org later)
4748
OH_RUNTIME_RUNTIME_IMAGE_REPO: ghcr.io/remind101/runtime # This might not be strictly necessary as build.sh constructs the final path
4849

49-
- name: Build and Push OpenHands Image
50-
run: |
51-
echo "Building openhands image with tag stable-with-patches and git sha tag..."
52-
# Set DOCKER_IMAGE_TAG for build.sh to pick up
53-
export DOCKER_IMAGE_TAG=stable-with-patches
54-
# Set RELEVANT_SHA for build.sh to add git sha tag
55-
export RELEVANT_SHA=${{ github.sha }}
56-
./containers/build.sh -i openhands --push -o remind101
57-
env:
58-
# Pass GITHUB_TOKEN for potential git operations within build script if needed
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Free up disk space by removing tool cache
52+
run: sudo rm -rf /opt/hostedtoolcache
6053

6154
- name: Build and Push Runtime Image
6255
run: |

containers/app/Dockerfile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WORKDIR /app
55

66
COPY ./frontend/package.json frontend/package-lock.json ./
77
RUN npm install -g [email protected]
8-
RUN npm ci
8+
RUN npm ci --network-timeout 600000
99

1010
COPY ./frontend ./
1111
RUN npm run build
@@ -63,14 +63,37 @@ RUN useradd -l -m -u $OPENHANDS_USER_ID -s /bin/bash openhands && \
6363
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
6464
RUN chown -R openhands:app /app && chmod -R 770 /app
6565
RUN sudo chown -R openhands:app $WORKSPACE_BASE && sudo chmod -R 770 $WORKSPACE_BASE
66+
67+
# Install Playwright Chromium dependencies as root
68+
USER root
69+
RUN apt-get update && apt-get install -y --no-install-recommends \
70+
libnss3 \
71+
libnspr4 \
72+
libdbus-1-3 \
73+
libatk1.0-0 \
74+
libatk-bridge2.0-0 \
75+
libcups2 \
76+
libdrm2 \
77+
libgbm1 \
78+
libatspi2.0-0 \
79+
libxcomposite1 \
80+
libxdamage1 \
81+
libxfixes3 \
82+
libxrandr2 \
83+
libxkbcommon0 \
84+
libpango-1.0-0 \
85+
libcairo2 \
86+
libasound2 \
87+
&& rm -rf /var/lib/apt/lists/*
88+
6689
USER openhands
6790

6891
ENV VIRTUAL_ENV=/app/.venv \
6992
PATH="/app/.venv/bin:$PATH" \
7093
PYTHONPATH='/app'
7194

7295
COPY --chown=openhands:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
73-
RUN playwright install --with-deps chromium
96+
RUN playwright install chromium
7497

7598
COPY --chown=openhands:app --chmod=770 ./microagents ./microagents
7699
COPY --chown=openhands:app --chmod=770 ./openhands ./openhands

containers/build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ done
125125

126126
if [[ $push -eq 1 ]]; then
127127
args+=" --push"
128-
args+=" --cache-to=type=registry,ref=$DOCKER_REPOSITORY:$cache_tag,mode=max"
128+
# args+=" --cache-to=type=registry,ref=$DOCKER_REPOSITORY:$cache_tag,mode=max"
129129
fi
130130

131131
if [[ $load -eq 1 ]]; then
@@ -168,8 +168,6 @@ echo "Building for platform(s): $platform"
168168
docker buildx build \
169169
$args \
170170
--build-arg OPENHANDS_BUILD_VERSION="$OPENHANDS_BUILD_VERSION" \
171-
--cache-from=type=registry,ref=$DOCKER_REPOSITORY:$cache_tag \
172-
--cache-from=type=registry,ref=$DOCKER_REPOSITORY:$cache_tag_base-main \
173171
--platform $platform \
174172
--provenance=false \
175173
-f "$dir/Dockerfile" \

0 commit comments

Comments
 (0)