mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
chore - Rebuild docker image in fork CI instead of using artifacts (#7809)
This commit is contained in:
55
.github/workflows/ghcr-build.yml
vendored
55
.github/workflows/ghcr-build.yml
vendored
@@ -174,20 +174,19 @@ jobs:
|
|||||||
build-args: ${{ env.DOCKER_BUILD_ARGS }}
|
build-args: ${{ env.DOCKER_BUILD_ARGS }}
|
||||||
context: containers/runtime
|
context: containers/runtime
|
||||||
provenance: false
|
provenance: false
|
||||||
# Forked repos can't push to GHCR, so we need to upload the image as an artifact
|
# Forked repos can't push to GHCR, so we just build in order to populate the cache for rebuilding
|
||||||
- name: Build runtime image ${{ matrix.base_image.image }} for fork
|
- 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: useblacksmith/build-push-action@v1
|
uses: useblacksmith/build-push-action@v1
|
||||||
with:
|
with:
|
||||||
tags: ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
|
tags: ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
|
||||||
outputs: type=docker,dest=/tmp/runtime-${{ matrix.base_image.tag }}.tar
|
|
||||||
context: containers/runtime
|
context: containers/runtime
|
||||||
- name: Upload runtime image for fork
|
- name: Upload runtime source for fork
|
||||||
if: github.event.pull_request.head.repo.fork
|
if: github.event.pull_request.head.repo.fork
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: runtime-${{ matrix.base_image.tag }}
|
name: runtime-src-${{ matrix.base_image.tag }}
|
||||||
path: /tmp/runtime-${{ matrix.base_image.tag }}.tar
|
path: containers/runtime
|
||||||
|
|
||||||
verify_hash_equivalence_in_runtime_and_app:
|
verify_hash_equivalence_in_runtime_and_app:
|
||||||
name: Verify Hash Equivalence in Runtime and Docker images
|
name: Verify Hash Equivalence in Runtime and Docker images
|
||||||
@@ -258,17 +257,23 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
# Forked repos can't push to GHCR, so we need to download the image as an artifact
|
- name: Download runtime source for fork
|
||||||
- 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
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: runtime-${{ matrix.base_image.tag }}
|
name: runtime-src-${{ matrix.base_image.tag }}
|
||||||
path: /tmp
|
path: containers/runtime
|
||||||
- name: Load runtime image for fork
|
- name: Lowercase Repository Owner
|
||||||
if: github.event.pull_request.head.repo.fork
|
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/runtime-${{ matrix.base_image.tag }}.tar
|
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||||
|
# Forked repos can't push to GHCR, so we need to rebuild using cache
|
||||||
|
- name: Build runtime image ${{ matrix.base_image.image }} for fork
|
||||||
|
if: github.event.pull_request.head.repo.fork
|
||||||
|
uses: useblacksmith/build-push-action@v1
|
||||||
|
with:
|
||||||
|
load: true
|
||||||
|
tags: ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
|
||||||
|
context: containers/runtime
|
||||||
- name: Cache Poetry dependencies
|
- name: Cache Poetry dependencies
|
||||||
uses: useblacksmith/cache@v5
|
uses: useblacksmith/cache@v5
|
||||||
with:
|
with:
|
||||||
@@ -287,9 +292,6 @@ jobs:
|
|||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
- name: Install Python dependencies using Poetry
|
- name: Install Python dependencies using Poetry
|
||||||
run: make install-python-dependencies POETRY_GROUP=main,test,runtime INSTALL_PLAYWRIGHT=0
|
run: make install-python-dependencies POETRY_GROUP=main,test,runtime INSTALL_PLAYWRIGHT=0
|
||||||
- name: Lowercase Repository Owner
|
|
||||||
run: |
|
|
||||||
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
|
||||||
- name: Run docker runtime tests
|
- name: Run docker runtime tests
|
||||||
run: |
|
run: |
|
||||||
# We install pytest-xdist in order to run tests across CPUs
|
# We install pytest-xdist in order to run tests across CPUs
|
||||||
@@ -327,17 +329,23 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
# Forked repos can't push to GHCR, so we need to download the image as an artifact
|
- name: Download runtime source for fork
|
||||||
- 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
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: runtime-${{ matrix.base_image.tag }}
|
name: runtime-src-${{ matrix.base_image.tag }}
|
||||||
path: /tmp
|
path: containers/runtime
|
||||||
- name: Load runtime image for fork
|
- name: Lowercase Repository Owner
|
||||||
if: github.event.pull_request.head.repo.fork
|
|
||||||
run: |
|
run: |
|
||||||
docker load --input /tmp/runtime-${{ matrix.base_image.tag }}.tar
|
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||||
|
# Forked repos can't push to GHCR, so we need to rebuild using cache
|
||||||
|
- name: Build runtime image ${{ matrix.base_image.image }} for fork
|
||||||
|
if: github.event.pull_request.head.repo.fork
|
||||||
|
uses: useblacksmith/build-push-action@v1
|
||||||
|
with:
|
||||||
|
load: true
|
||||||
|
tags: ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
|
||||||
|
context: containers/runtime
|
||||||
- name: Cache Poetry dependencies
|
- name: Cache Poetry dependencies
|
||||||
uses: useblacksmith/cache@v5
|
uses: useblacksmith/cache@v5
|
||||||
with:
|
with:
|
||||||
@@ -356,9 +364,6 @@ jobs:
|
|||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
- name: Install Python dependencies using Poetry
|
- name: Install Python dependencies using Poetry
|
||||||
run: make install-python-dependencies POETRY_GROUP=main,test,runtime INSTALL_PLAYWRIGHT=0
|
run: make install-python-dependencies POETRY_GROUP=main,test,runtime INSTALL_PLAYWRIGHT=0
|
||||||
- name: Lowercase Repository Owner
|
|
||||||
run: |
|
|
||||||
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
|
||||||
- name: Run runtime tests
|
- name: Run runtime tests
|
||||||
run: |
|
run: |
|
||||||
# We install pytest-xdist in order to run tests across CPUs
|
# We install pytest-xdist in order to run tests across CPUs
|
||||||
|
|||||||
Reference in New Issue
Block a user