forked from ipc2023-classical/planner4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-image.sh
executable file
·42 lines (33 loc) · 1.06 KB
/
build-image.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash
set -euo pipefail
cd $(dirname "$0")
TMPDIR="/tmp/apptainer-rundir"
DOMAIN="${TMPDIR}/domain.pddl"
PROBLEM="${TMPDIR}/problem.pddl"
PLANFILE="${TMPDIR}/my_sas_plan"
RECIPE=$(realpath ${1})
IMAGE=$(realpath ${2})
BENCHMARKS_DIR=benchmarks
printf "\n\n**********************************************************************\n\n\n"
echo "Recipe: ${RECIPE}"
if [[ -e ${IMAGE} ]]; then
echo "Image ${IMAGE} exists -> will test it now."
else
echo "Image ${IMAGE} does not exist -> will create and test it now."
pushd $(dirname ${RECIPE})
apptainer build ${IMAGE} ${RECIPE}
popd
fi
function test_image {
domain=${1}
problem=${2}
rm -rf ${TMPDIR}
mkdir ${TMPDIR}
cp ${BENCHMARKS_DIR}/${domain} ${DOMAIN}
cp ${BENCHMARKS_DIR}/${problem} ${PROBLEM}
${IMAGE} ${DOMAIN} ${PROBLEM} ${PLANFILE}
}
echo "Testing image at ${IMAGE} with STRIPS task:"
test_image miconic/domain.pddl miconic/s1-0.pddl
echo "Testing image at ${IMAGE} with conditional effects task:"
test_image miconic-fulladl/domain.pddl miconic-fulladl/f1-0.pddl