diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..2f7f940d5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,61 @@ +FROM ubuntu:18.04 + +LABEL maintainer="Hector Palacios (hectorpal@gmail.com)" + +# Install required packages +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + bash-completion \ + ca-certificates \ + git \ + libseccomp-dev \ + python3 \ + python3-pip \ + python3-venv \ + squashfs-tools \ + tzdata \ + unzip \ + vim \ + wget \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install --upgrade pip \ + && pip3 install setuptools + +RUN dpkg --add-architecture i386 +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + build-essential \ + file \ + time \ + libc6-i386 \ + gcc-multilib \ + g++-multilib \ + libstdc++5:i386 \ + flex \ + bison \ + python \ + zlib1g-dev \ + cmake + +# && rm -rf /var/lib/apt/lists/* +# Not sure I need libc6-i386 +# g*-multilib is an overkill but will be useful for compiling + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 && \ + /usr/bin/python3 -m pip install --upgrade pip && \ + pip3 install numpy z3-solver + +# Install OpenJDK-11 +RUN apt-get update && \ + apt-get install -y openjdk-11-jre-headless && \ + apt-get clean; + +WORKDIR /mnt/pddl-generators + +COPY . . + +RUN ./build_all save-logs + +# default command to execute when container starts +CMD /bin/bash diff --git a/README.md b/README.md index 7122fa71c..e97914ec1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ to generate benchmarks for the International Planning Competition (IPC). * Build single generator: ``cd assembly; make`` * Test generators: ``sudo apt install tox && tox`` +## Docker instructions +* Build in Docker image: ``docker build -t pddl-generators .`` +* Run Docker container: ``docker run -ti -t pddl-generators`` + # Feedback * Bug reports and pull requests are appreciated. diff --git a/build_all b/build_all index c112a3597..5bbcafc10 100755 --- a/build_all +++ b/build_all @@ -4,24 +4,38 @@ set -euo pipefail cd "$(dirname "$0")" +build_dir () +{ + if [ -e CMakeLists.txt ]; then + cmake . + fi + if [ -e Makefile ]; then + # Handle "./build_all test" and "./build_all clean" separately: + # don't try to run the command if it doesn't exist. + if [ "$#" -eq 1 ] && [ "$@" == "test" ]; then + make --dry-run test > /dev/null && (make test > /dev/null && echo "Tests passed." || exit 1) + elif [ "$#" -eq 1 ] && [ "$@" == "clean" ]; then + make --dry-run clean > /dev/null && (make clean > /dev/null && echo "Cleaned up." || exit 1) + else + make "$@" + fi + fi +} + +SAVE_LOGS="n" +if [ "$#" -eq 1 ] && [ "$@" == "save-logs" ]; then + SAVE_LOGS="y" + shift +fi for DIR in * ; do if [ -d $DIR ]; then echo echo "Domain: $DIR" cd $DIR - if [ -e CMakeLists.txt ]; then - cmake . - fi - if [ -e Makefile ]; then - # Handle "./build_all test" and "./build_all clean" separately: - # don't try to run the command if it doesn't exist. - if [ "$#" -eq 1 ] && [ "$@" == "test" ]; then - make --dry-run test > /dev/null && (make test > /dev/null && echo "Tests passed." || exit 1) - elif [ "$#" -eq 1 ] && [ "$@" == "clean" ]; then - make --dry-run clean > /dev/null && (make clean > /dev/null && echo "Cleaned up." || exit 1) - else - make "$@" - fi + if [ "$SAVE_LOGS" == "y" ]; then + build_dir > make-out.log 2> make-err.log + else + build_dir fi cd .. fi