|
|
@@ -38,10 +38,6 @@ jobs:
|
|
|
base_image:
|
|
|
- image: 'nikolaik/python-nodejs:python3.11-nodejs22'
|
|
|
tag: nikolaik
|
|
|
- - image: 'python:3.11-bookworm'
|
|
|
- tag: python
|
|
|
- - image: 'node:22-bookworm'
|
|
|
- tag: node
|
|
|
steps:
|
|
|
- name: Checkout
|
|
|
uses: actions/checkout@v4
|
|
|
@@ -70,31 +66,39 @@ jobs:
|
|
|
- name: Set up Docker Buildx
|
|
|
id: buildx
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
- - name: Install poetry via pipx
|
|
|
- run: pipx install poetry
|
|
|
- name: Set up Python
|
|
|
uses: actions/setup-python@v5
|
|
|
with:
|
|
|
python-version: '3.11'
|
|
|
- cache: 'poetry'
|
|
|
+ - name: Cache Poetry dependencies
|
|
|
+ uses: actions/cache@v4
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ ~/.cache/pypoetry
|
|
|
+ ~/.virtualenvs
|
|
|
+ key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-poetry-
|
|
|
+ - name: Install poetry via pipx
|
|
|
+ run: pipx install poetry
|
|
|
- name: Install Python dependencies using Poetry
|
|
|
run: make install-python-dependencies
|
|
|
- name: Create source distribution and Dockerfile
|
|
|
run: poetry run python3 openhands/runtime/utils/runtime_build.py --base_image ${{ matrix.base_image.image }} --build_folder containers/runtime --force_rebuild
|
|
|
- name: Build and push runtime image ${{ matrix.base_image.image }}
|
|
|
- if: "!github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork != true
|
|
|
run: |
|
|
|
./containers/build.sh runtime ${{ github.repository_owner }} --push ${{ matrix.base_image.tag }}
|
|
|
# Forked repos can't push to GHCR, so we need to upload the image as an artifact
|
|
|
- name: Build runtime image ${{ matrix.base_image.image }} for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork
|
|
|
uses: docker/build-push-action@v6
|
|
|
with:
|
|
|
tags: ghcr.io/all-hands-ai/runtime:${{ github.sha }}-${{ matrix.base_image.tag }}
|
|
|
outputs: type=docker,dest=/tmp/runtime-${{ matrix.base_image.tag }}.tar
|
|
|
context: containers/runtime
|
|
|
- name: Upload runtime image for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork != true
|
|
|
uses: actions/upload-artifact@v4
|
|
|
with:
|
|
|
name: runtime-${{ matrix.base_image.tag }}
|
|
|
@@ -107,7 +111,7 @@ jobs:
|
|
|
needs: [ghcr_build_runtime]
|
|
|
strategy:
|
|
|
matrix:
|
|
|
- base_image: ['nikolaik', 'python', 'node']
|
|
|
+ base_image: ['nikolaik']
|
|
|
steps:
|
|
|
- uses: actions/checkout@v4
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
|
@@ -121,22 +125,30 @@ jobs:
|
|
|
swap-storage: true
|
|
|
# Forked repos can't push to GHCR, so we need to download the image as an artifact
|
|
|
- name: Download runtime image for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork
|
|
|
uses: actions/download-artifact@v4
|
|
|
with:
|
|
|
name: runtime-${{ matrix.base_image }}
|
|
|
path: /tmp
|
|
|
- name: Load runtime image for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork
|
|
|
run: |
|
|
|
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
|
|
|
- - name: Install poetry via pipx
|
|
|
- run: pipx install poetry
|
|
|
+ - name: Cache Poetry dependencies
|
|
|
+ uses: actions/cache@v4
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ ~/.cache/pypoetry
|
|
|
+ ~/.virtualenvs
|
|
|
+ key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-poetry-
|
|
|
- name: Set up Python
|
|
|
uses: actions/setup-python@v5
|
|
|
with:
|
|
|
python-version: '3.11'
|
|
|
- cache: 'poetry'
|
|
|
+ - name: Install poetry via pipx
|
|
|
+ run: pipx install poetry
|
|
|
- name: Install Python dependencies using Poetry
|
|
|
run: make install-python-dependencies
|
|
|
- name: Run runtime tests
|
|
|
@@ -162,27 +174,35 @@ jobs:
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
- base_image: ['nikolaik', 'python', 'node']
|
|
|
+ base_image: ['nikolaik']
|
|
|
steps:
|
|
|
- uses: actions/checkout@v4
|
|
|
# Forked repos can't push to GHCR, so we need to download the image as an artifact
|
|
|
- name: Download runtime image for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork
|
|
|
uses: actions/download-artifact@v4
|
|
|
with:
|
|
|
name: runtime-${{ matrix.base_image }}
|
|
|
path: /tmp
|
|
|
- name: Load runtime image for fork
|
|
|
- if: "github.event.pull_request.head.repo.fork"
|
|
|
+ if: github.event.pull_request.head.repo.fork
|
|
|
run: |
|
|
|
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
|
|
|
- - name: Install poetry via pipx
|
|
|
- run: pipx install poetry
|
|
|
+ - name: Cache Poetry dependencies
|
|
|
+ uses: actions/cache@v4
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ ~/.cache/pypoetry
|
|
|
+ ~/.virtualenvs
|
|
|
+ key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-poetry-
|
|
|
- name: Set up Python
|
|
|
uses: actions/setup-python@v5
|
|
|
with:
|
|
|
python-version: '3.11'
|
|
|
- cache: 'poetry'
|
|
|
+ - name: Install poetry via pipx
|
|
|
+ run: pipx install poetry
|
|
|
- name: Install Python dependencies using Poetry
|
|
|
run: make install-python-dependencies
|
|
|
- name: Run integration tests
|