Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM ubuntu:18.04
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use 20.04?


LABEL maintainer="Hector Palacios ([email protected])"

# 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which scenarios do you think 32-bit compilations will be useful? I think we can remove them for simplicity.


RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for making python point to python3? If so, we could instead install the python-is-python3 package.

/usr/bin/python3 -m pip install --upgrade pip && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't we updated pip already above?

pip3 install numpy z3-solver

# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-11-jre-headless && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a separate apt-get call for JDK?

apt-get clean;

WORKDIR /mnt/pddl-generators

COPY . .

RUN ./build_all save-logs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you save the build logs? Couldn't they confuse users who just want to run the generators? You'll see the build output when the container is built, won't you?


# default command to execute when container starts
CMD /bin/bash
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Planning Competitions (IPC).
* Build single generator: ``cd assembly; make``
* Test generators: ``sudo apt install python-tox && tox``

## Docker instructions
* Build in Docker image: ``docker build -t pddl-generators .``
* Run Docker container: ``docker run -ti -t pddl-generators``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double -t?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to use long option names for Docker beginners: --tag, --tty, --interactive


# Feedback
* Bug reports and pull requests are appreciated.

Expand Down
40 changes: 27 additions & 13 deletions build_all
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down