From 1d052818ae51856c13e6d468ab79673747440ae5 Mon Sep 17 00:00:00 2001 From: mamoodi Date: Tue, 24 Sep 2024 23:20:45 -0400 Subject: [PATCH] Set runtime container image so it doesn't need to be rebuilt (#4035) --- .github/workflows/ghcr_runtime.yml | 16 +++++++--------- tests/runtime/conftest.py | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ghcr_runtime.yml b/.github/workflows/ghcr_runtime.yml index cf49c2384ab7..8d6f622058b2 100644 --- a/.github/workflows/ghcr_runtime.yml +++ b/.github/workflows/ghcr_runtime.yml @@ -145,8 +145,7 @@ jobs: run: make install-python-dependencies - name: Run runtime tests run: | - # We install pytest-xdist in order to run tests across CPUs. However, tests start to fail when we run - # then across more than 2 CPUs for some reason + # We install pytest-xdist in order to run tests across CPUs poetry run pip install pytest-xdist # Install to be able to retry on failures for flaky tests @@ -158,10 +157,10 @@ jobs: SKIP_CONTAINER_LOGS=true \ TEST_RUNTIME=eventstream \ SANDBOX_USER_ID=$(id -u) \ - SANDBOX_BASE_CONTAINER_IMAGE=$image_name \ + SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \ TEST_IN_CI=true \ RUN_AS_OPENHANDS=false \ - poetry run pytest -n 3 --reruns 1 --reruns-delay 3 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime + poetry run pytest -n 3 -raR --reruns 1 --reruns-delay 3 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: @@ -207,8 +206,7 @@ jobs: run: make install-python-dependencies - name: Run runtime tests run: | - # We install pytest-xdist in order to run tests across CPUs. However, tests start to fail when we run - # then across more than 2 CPUs for some reason + # We install pytest-xdist in order to run tests across CPUs poetry run pip install pytest-xdist # Install to be able to retry on failures for flaky tests @@ -220,10 +218,10 @@ jobs: SKIP_CONTAINER_LOGS=true \ TEST_RUNTIME=eventstream \ SANDBOX_USER_ID=$(id -u) \ - SANDBOX_BASE_CONTAINER_IMAGE=$image_name \ + SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \ TEST_IN_CI=true \ RUN_AS_OPENHANDS=true \ - poetry run pytest -n 3 --reruns 1 --reruns-delay 3 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime + poetry run pytest -n 3 -raR --reruns 1 --reruns-delay 3 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: @@ -275,7 +273,7 @@ jobs: TEST_RUNTIME=eventstream \ SANDBOX_USER_ID=$(id -u) \ - SANDBOX_BASE_CONTAINER_IMAGE=$image_name \ + SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \ TEST_IN_CI=true \ TEST_ONLY=true \ ./tests/integration/regenerate.sh diff --git a/tests/runtime/conftest.py b/tests/runtime/conftest.py index 6ce93256e4af..2308244fb355 100644 --- a/tests/runtime/conftest.py +++ b/tests/runtime/conftest.py @@ -243,6 +243,7 @@ def _load_runtime( if base_container_image is not None: config.sandbox.base_container_image = base_container_image + config.sandbox.runtime_container_image = None file_store = get_file_store(config.file_store, config.file_store_path) event_stream = EventStream(sid, file_store)