π OpenHands: AI-Driven Development
Evaluation time travel: build sandbox on the fly (#2491)
Boxuan Lifeabc97abab5
diff --git a/evaluation/EDA/scripts/run_infer.sh b/evaluation/EDA/scripts/run_infer.shindex 06107a7b2c..0e0d58ebdb 100755--- a/evaluation/EDA/scripts/run_infer.sh+++ b/evaluation/EDA/scripts/run_infer.sh@@ -57,5 +57,3 @@ fi# Run the commandecho $COMMANDeval $COMMAND--checkout_original_branchdiff --git a/evaluation/agent_bench/scripts/run_infer.sh b/evaluation/agent_bench/scripts/run_infer.shindex 11c0105d26..64023973af 100755--- a/evaluation/agent_bench/scripts/run_infer.sh+++ b/evaluation/agent_bench/scripts/run_infer.sh@@ -36,5 +36,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/biocoder/scripts/run_infer.sh b/evaluation/biocoder/scripts/run_infer.shindex 584529d51e..85c57e88b8 100755--- a/evaluation/biocoder/scripts/run_infer.sh+++ b/evaluation/biocoder/scripts/run_infer.sh@@ -39,5 +39,3 @@ fi# Run the commandecho $COMMANDeval $COMMAND--checkout_original_branchdiff --git a/evaluation/bird/scripts/run_infer.sh b/evaluation/bird/scripts/run_infer.shindex b042c715ee..7776d1f782 100755--- a/evaluation/bird/scripts/run_infer.sh+++ b/evaluation/bird/scripts/run_infer.sh@@ -36,5 +36,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/gaia/scripts/run_infer.sh b/evaluation/gaia/scripts/run_infer.shindex 2dcba3694e..9f50f9f444 100755--- a/evaluation/gaia/scripts/run_infer.sh+++ b/evaluation/gaia/scripts/run_infer.sh@@ -47,5 +47,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/gorilla/scripts/run_infer.sh b/evaluation/gorilla/scripts/run_infer.shindex 38b37b0b51..468b89c220 100644--- a/evaluation/gorilla/scripts/run_infer.sh+++ b/evaluation/gorilla/scripts/run_infer.sh@@ -45,5 +45,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/gpqa/scripts/run_infer.sh b/evaluation/gpqa/scripts/run_infer.shindex 2b004ff577..43326a30cd 100755--- a/evaluation/gpqa/scripts/run_infer.sh+++ b/evaluation/gpqa/scripts/run_infer.sh@@ -44,5 +44,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/humanevalfix/scripts/run_infer.sh b/evaluation/humanevalfix/scripts/run_infer.shindex ca5abaeb05..c61b1be309 100755--- a/evaluation/humanevalfix/scripts/run_infer.sh+++ b/evaluation/humanevalfix/scripts/run_infer.sh@@ -74,5 +74,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/logic_reasoning/scripts/run_infer.sh b/evaluation/logic_reasoning/scripts/run_infer.shindex c32e4c42c8..5c7748b3c9 100755--- a/evaluation/logic_reasoning/scripts/run_infer.sh+++ b/evaluation/logic_reasoning/scripts/run_infer.sh@@ -40,5 +40,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/miniwob/scripts/run_infer.sh b/evaluation/miniwob/scripts/run_infer.shindex 36278b8969..b1dc24a147 100755--- a/evaluation/miniwob/scripts/run_infer.sh+++ b/evaluation/miniwob/scripts/run_infer.sh@@ -46,5 +46,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/mint/scripts/run_infer.sh b/evaluation/mint/scripts/run_infer.shindex 5cac4beac8..6d6a6510b0 100644--- a/evaluation/mint/scripts/run_infer.sh+++ b/evaluation/mint/scripts/run_infer.sh@@ -42,5 +42,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/ml_bench/scripts/run_infer.sh b/evaluation/ml_bench/scripts/run_infer.shindex 9909276e7d..98bc528c63 100755--- a/evaluation/ml_bench/scripts/run_infer.sh+++ b/evaluation/ml_bench/scripts/run_infer.sh@@ -46,5 +46,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/toolqa/scripts/run_infer.sh b/evaluation/toolqa/scripts/run_infer.shindex 6035c71bd9..00d015c338 100644--- a/evaluation/toolqa/scripts/run_infer.sh+++ b/evaluation/toolqa/scripts/run_infer.sh@@ -61,5 +61,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branchdiff --git a/evaluation/utils/version_control.sh b/evaluation/utils/version_control.shindex 38c2dd370f..f58f9bdce9 100644--- a/evaluation/utils/version_control.sh+++ b/evaluation/utils/version_control.sh@@ -1,8 +1,16 @@checkout_eval_branch() {if [ -z "$COMMIT_HASH" ]; thenecho "Commit hash not specified, use current git commit"+ build_sandboxreturn 0fi++ if git diff --quiet $COMMIT_HASH HEAD; then+ echo "The given hash is equivalent to the current HEAD"+ build_sandbox+ return 0+ fi+echo "Start to checkout opendevin version to $COMMIT_HASH, but keep current evaluation harness"if ! git diff-index --quiet HEAD --; thenecho "There are uncommitted changes, please stash or commit them first"@@ -15,8 +23,20 @@ checkout_eval_branch() {echo "Failed to check out to $COMMIT_HASH"exit 1fi+echo "Revert changes in evaluation folder"git checkout $current_branch -- evaluation++ # Trap the EXIT signal to checkout original branch+ trap checkout_original_branch EXIT++ build_sandbox+}++build_sandbox() {+ echo "Build sandbox locally"+ docker build -t eval-sandbox -f containers/sandbox/Dockerfile /tmp+ export SANDBOX_CONTAINER_IMAGE="eval-sandbox"}checkout_original_branch() {diff --git a/evaluation/webarena/scripts/run_infer.sh b/evaluation/webarena/scripts/run_infer.shindex 1fa9ba13b2..ec6981c9e7 100755--- a/evaluation/webarena/scripts/run_infer.sh+++ b/evaluation/webarena/scripts/run_infer.sh@@ -44,5 +44,3 @@ fi# Run the commandeval $COMMAND--checkout_original_branch