File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change 11
2- name : Build Stable Patches Images
2+ name : Build Runtime Image
33
44on :
55 push :
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 :
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 : |
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ WORKDIR /app
55
66COPY ./frontend/package.json frontend/package-lock.json ./
77RUN npm install -g
[email protected] 8- RUN npm ci
8+ RUN npm ci --network-timeout 600000
99
1010COPY ./frontend ./
1111RUN 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
6464RUN chown -R openhands:app /app && chmod -R 770 /app
6565RUN 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+
6689USER openhands
6790
6891ENV VIRTUAL_ENV=/app/.venv \
6992 PATH="/app/.venv/bin:$PATH" \
7093 PYTHONPATH='/app'
7194
7295COPY --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
7598COPY --chown=openhands:app --chmod=770 ./microagents ./microagents
7699COPY --chown=openhands:app --chmod=770 ./openhands ./openhands
Original file line number Diff line number Diff line change 125125
126126if [[ $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"
129129fi
130130
131131if [[ $load -eq 1 ]]; then
@@ -168,8 +168,6 @@ echo "Building for platform(s): $platform"
168168docker 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" \
You can’t perform that action at this time.
0 commit comments