Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvan Sievers committed Apr 12, 2023
2 parents 19e5dbc + 883076f commit 2c7b3ff
Show file tree
Hide file tree
Showing 17 changed files with 260 additions and 147 deletions.
53 changes: 30 additions & 23 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,43 @@ jobs:
sudo apt-get -y install g++ make flex bison
wget http://fai.cs.uni-saarland.de/hoffmann/ff/FF-v2.3.tgz
tar -xzvf FF-v2.3.tgz
cd FF-v2.3/
pushd FF-v2.3/
make -j
cp ff ../
cd ..
rm -rf FF-v2.3/ FF-v2.3.tgz
popd
rm -r FF-v2.3/ FF-v2.3.tgz
- name: Compile runsolver
working-directory: ../deps
run: |
sudo apt-get -y install g++ make
git clone https://github.com/jendrikseipp/runsolver.git runsolver-dir
pushd runsolver-dir/src
make -j
cp runsolver ../..
popd
rm -r runsolver-dir/
- name: Install Singularity
working-directory: ../deps
run: |
wget --no-verbose http://ftp.se.debian.org/debian/pool/main/s/singularity-container/singularity-container_3.5.2+ds1-1_amd64.deb -O singularity.deb
sudo dpkg -i singularity.deb
rm singularity.deb
- name: Compile VAL
working-directory: ../deps
run: |
sudo apt-get -y install g++ make flex bison
git clone https://github.com/KCL-Planning/VAL.git
cd VAL
pushd VAL
git checkout a5565396007eee73ac36527fbf904142b3077c74
make clean # Remove old build artifacts and binaries.
sed -i 's/-Werror //g' Makefile # Ignore warnings.
make -j
mv validate ../
cd ../
rm -rf VAL
popd
rm -r VAL
- name: Clone benchmarks
working-directory: ../deps
Expand All @@ -93,25 +111,17 @@ jobs:
git clone --depth 1 https://github.com/aibasel/downward-benchmarks ${DOWNWARD_BENCHMARKS}
echo "DOWNWARD_BENCHMARKS=${DOWNWARD_BENCHMARKS}" >> $GITHUB_ENV
- name: Clone Fast Downward Mercurial
working-directory: ../deps
run: |
sudo apt-get -y install cmake g++ git make python3
export HG_DOWNWARD_REPO=`realpath fast-downward`
hg clone http://hg.fast-downward.org ${HG_DOWNWARD_REPO}
echo "HG_DOWNWARD_REPO=${HG_DOWNWARD_REPO}" >> $GITHUB_ENV
- name: Clone Fast Downward Git
working-directory: ../deps
run: |
export GIT_DOWNWARD_REPO=`realpath fast-downward-git`
git clone --depth 1 https://github.com/aibasel/downward.git ${GIT_DOWNWARD_REPO}
echo "GIT_DOWNWARD_REPO=${GIT_DOWNWARD_REPO}" >> $GITHUB_ENV
export DOWNWARD_REPO=`realpath fast-downward-git`
git clone --depth 1 https://github.com/aibasel/downward.git ${DOWNWARD_REPO}
echo "DOWNWARD_REPO=${DOWNWARD_REPO}" >> $GITHUB_ENV
- name: Download example Singularity image
working-directory: ../deps
run: |
wget --no-verbose https://ai.dmi.unibas.ch/_tmp_files/seipp/lama-first.img
wget --no-verbose https://ai.dmi.unibas.ch/_tmp_files/seipp/lama-first.img -O fd1906-lama-first.img
export SINGULARITY_IMAGES=`realpath .`
echo "SINGULARITY_IMAGES=${SINGULARITY_IMAGES}" >> $GITHUB_ENV
Expand All @@ -123,11 +133,8 @@ jobs:
export DOWNWARD_REVISION_CACHE="${GITHUB_WORKSPACE}/revision-cache"
echo CACHE: ${DOWNWARD_REVISION_CACHE}
export DOWNWARD_REPO=${HG_DOWNWARD_REPO}
time tox -e py
export DOWNWARD_REPO=${GIT_DOWNWARD_REPO}
time tox -e py
export DOWNWARD_REPO=${DOWNWARD_REPO}
time tox -e py,ff,singularity
- name: Test installation with pip
run: |
Expand Down
2 changes: 2 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _faq:

Frequently asked questions
==========================

Expand Down
31 changes: 29 additions & 2 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,42 @@ Changelog
next (unreleased)
-----------------

Lab
^^^
* Revamp Singularity example experiment: use runsolver to limit resource usage (Silvan Sievers and Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* No changes so far.


v7.0 (2021-10-24)
-----------------

Lab
^^^
* Remove support for Mercurial repositories (Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* Fix rules for finding domain files for airport and psr-small domains (Silvan Sievers).
* Add more ticks on y axis in relative plots (Jendrik Seipp).


v6.5 (2021-09-27)
-----------------

Lab
^^^
* Allow rerunning experiments. This is useful if some runs were never started,
for example, due to grid node failures. All runs that have already been started
are skipped. For more information see the corresponding FAQ (Jendrik Seipp).
are skipped. For more information see the corresponding :ref:`FAQ <faq>`
(Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* None so far.
* Slightly generalize rules for finding domain files, adapted from Fast Downward
(Silvan Sievers).


v6.4 (2021-07-06)
Expand Down
4 changes: 1 addition & 3 deletions downward/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@ def add_algorithm(
Example experiment setup:
>>> import os
>>> from lab.cached_revision import get_version_control_system, MERCURIAL
>>> exp = FastDownwardExperiment()
>>> repo = os.environ["DOWNWARD_REPO"]
>>> vcs = get_version_control_system(repo)
>>> rev = "default" if vcs == MERCURIAL else "main"
>>> rev = "main"
Run iPDB using the latest revision on the main branch:
Expand Down
3 changes: 3 additions & 0 deletions downward/reports/scatter_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from matplotlib import figure
from matplotlib import lines as mlines
from matplotlib.backends import backend_agg
from matplotlib.ticker import MaxNLocator


class MatplotlibPlot:
Expand Down Expand Up @@ -98,6 +99,8 @@ def write(cls, report, filename):

if report.plot_horizontal_line:
plot.plot_horizontal_line()
# Ask for more ticks on y axis in relative plots.
plot.axes.yaxis.set_major_locator(MaxNLocator(nbins="auto"))
if report.plot_diagonal_line:
plot.plot_diagonal_line()

Expand Down
8 changes: 6 additions & 2 deletions downward/suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ def find_domain_file(benchmarks_dir, domain, problem):
For a given problem filename "<taskname>.<ext>", check the following
domain filenames: "domain.pddl", "<taskname>-domain.<ext>",
"domain_<taskname>.<ext>" and "domain-<taskname>.<ext>", where ".<ext>"
is optional.
"domain_<taskname>.<ext>" and "domain-<taskname>.<ext>", where
".<ext>" is optional. Also check "<xyz>-domain.pddl" where <xyz> are
the first three characters of the task file name, to cover the airport
and psr-small domains, where problem file names are p01-xxx.pddl and
domain file names are p01-domain.pddl.
"""
problem_root, ext = os.path.splitext(problem)
domain_basenames = [
"domain.pddl",
problem_root + "-domain" + ext,
problem_root[:3] + "-domain.pddl", # for airport and psr-small
"domain_" + problem,
"domain-" + problem,
]
Expand Down
4 changes: 2 additions & 2 deletions examples/downward/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ def get_repo_base() -> Path:
"""Get base directory of the repository, as an absolute path.
Search upwards in the directory tree from the main script until a
directory with a subdirectory named ".git" or ".hg" is found.
directory with a subdirectory named ".git" is found.
Abort if the repo base cannot be found."""
path = Path(tools.get_script_path())
while path.parent != path:
if any((path / d).is_dir() for d in [".git", ".hg"]):
if (path / ".git").is_dir():
return path
path = path.parent
sys.exit("repo base could not be found")
Expand Down
4 changes: 1 addition & 3 deletions examples/lmcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.scatter import ScatterPlotReport
from lab import cached_revision
from lab.environments import BaselSlurmEnvironment, LocalEnvironment


Expand All @@ -28,8 +27,7 @@
BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"]
# If REVISION_CACHE is None, the default ./data/revision-cache is used.
REVISION_CACHE = os.environ.get("DOWNWARD_REVISION_CACHE")
VCS = cached_revision.get_version_control_system(REPO)
REV = "default" if VCS == cached_revision.MERCURIAL else "main"
REV = "main"

exp = FastDownwardExperiment(environment=ENV, revision_cache=REVISION_CACHE)

Expand Down
5 changes: 2 additions & 3 deletions examples/showcase-options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from downward.reports.compare import ComparativeReport
from downward.reports.scatter import ScatterPlotReport
from downward.reports.taskwise import TaskwiseReport
from lab import cached_revision, reports
from lab import reports
from lab.environments import BaselSlurmEnvironment, LocalEnvironment
from lab.reports import Attribute
from lab.reports.filter import FilterReport
Expand All @@ -31,8 +31,7 @@
REPO = os.environ["DOWNWARD_REPO"]
BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"]
REV_CACHE = os.environ.get("DOWNWARD_REVISION_CACHE")
VCS = cached_revision.get_version_control_system(REPO)
REV = "default" if VCS == cached_revision.MERCURIAL else "main"
REV = "main"


# See FAQs in docs for how to use the filters.
Expand Down
41 changes: 41 additions & 0 deletions examples/singularity/filter-stderr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /usr/bin/env python

"""Filter lines from run.err that stem from "expected errors"."""

from pathlib import Path
import shutil


IGNORE_PATTERNS = [
"CPU time limit exceeded",
"std::bad_alloc",
"WARNING: will ignore action costs",
"differs from the one in the portfolio file",
"Terminated",
"Killed",
]


def main():
print("Running filter-stderr.py")
stderr = Path("run.err")
if stderr.is_file():
need_to_filter = False
filtered_content = []
with open(stderr, "r") as f:
for line in f:
if any(pattern in line for pattern in IGNORE_PATTERNS):
need_to_filter = True
else:
filtered_content.append(line)

if need_to_filter:
shutil.move(stderr, "run.err.bak")
# We write an empty file if everything has been filtered. Lab
# will remove empty run.err files later.
with open(stderr, "w") as f:
f.writelines(filtered_content)


if __name__ == "__main__":
main()
13 changes: 8 additions & 5 deletions examples/singularity/run-singularity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ if [ -f $PWD/$4 ]; then
exit 2
fi

# Ensure that strings like "CPU time limit exceeded" and "Killed" are in English.
export LANG=C

set +e
# Some planners print to stderr when running out of memory, so we redirect stderr to stdout.
{ /usr/bin/time -o /dev/stdout -f "Singularity runtime: %es real, %Us user, %Ss sys" \
singularity run -C -H $PWD $1 $PWD/$2 $PWD/$3 $4 ; } 2>&1
singularity run -C -H "$PWD" "$1" "$PWD/$2" "$PWD/$3" "$4"
set -e

printf "\nRun VAL\n\n"

if [ -f $PWD/$4 ]; then
echo "Found plan file."
validate $PWD/$2 $PWD/$3 $PWD/$4
validate -v "$PWD/$2" "$PWD/$3" "$PWD/$4"
exit 0
else
echo "No plan file."
validate $PWD/$2 $PWD/$3
validate -v "$PWD/$2" "$PWD/$3"
exit 99
fi
Loading

0 comments on commit 2c7b3ff

Please sign in to comment.