diff --git a/planutils/packages/cpor/Dockerfile b/planutils/packages/cpor/Dockerfile new file mode 100755 index 0000000..33316ce --- /dev/null +++ b/planutils/packages/cpor/Dockerfile @@ -0,0 +1,78 @@ + + +# Instructions to build and deploy the docker image: +# docker build -t aiplanning/cpor . +# docker push aiplanning/cpor + +# Building it locally if apptainer is installed: +# apptainer build cpor.sif docker-daemon://aiplanning/cpor:latest + + + +# This file has been modified from the FastDownward version + +# The recipe below implements a Docker multi-stage build: +# + +############################################################################### +# A first image to build the planner +############################################################################### +FROM ubuntu:22.04 AS builder + + +RUN apt-get update && apt-get -y install locales +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates \ + build-essential \ + cmake \ + make \ + g++ \ + git \ + libgmp3-dev \ + make \ + python3 \ + wget \ + time \ + graphviz \ + time \ + bc \ + zlib1g-dev + +RUN apt-get install -y mono-complete mono-devel mono-xbuild + +# install python and related +RUN apt-get install -y python3 python3-dev python3-pip python3-venv python-is-python3 +RUN pip3 install --upgrade pip +RUN pip3 install --upgrade graphviz +RUN pip3 install --upgrade networkx +RUN pip3 install --upgrade pydot + +# fetch all the code and build the project +WORKDIR /workspace +RUN git clone https://github.com/aiplan4eu/up-cpor.git +WORKDIR /workspace/up-cpor/CPORLib +RUN mono-csc -recurse:*.cs -r:../TestCPORLib/bin/Debug/net6.0/Microsoft.Solver.Foundation.dll + + +############################################################################### +# The final image to run the planner +############################################################################### +FROM ubuntu:22.04 AS runner + +RUN apt-get update && apt-get install --no-install-recommends -y \ + python3 time python-is-python3 mono-runtime \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace/cpor/ + +# Copy the relevant files from the previous docker build into this build. +COPY --from=builder /workspace/up-cpor/CPORLib/Run.exe . + +RUN echo "#!/bin/bash" > /workspace/cpor/run.sh +RUN echo "mono /workspace/cpor/Run.exe \$@" >> /workspace/cpor/run.sh +RUN chmod a+x /workspace/cpor/run.sh + +ENTRYPOINT ["/workspace/cpor/run.sh"] + diff --git a/planutils/packages/cpor/install b/planutils/packages/cpor/install new file mode 100755 index 0000000..956fc20 --- /dev/null +++ b/planutils/packages/cpor/install @@ -0,0 +1,3 @@ +#!/bin/bash + +apptainer build cpor.sif docker://aiplanning/cpor:latest diff --git a/planutils/packages/cpor/manifest.json b/planutils/packages/cpor/manifest.json new file mode 100644 index 0000000..cd5deb4 --- /dev/null +++ b/planutils/packages/cpor/manifest.json @@ -0,0 +1,6 @@ +{ + "name": "CPOR", + "description": "CPOR: Contingent Planning using On-line Replanning (for any issues, please email Guy Shani )", + "install-size": "51M", + "dependencies": [] +} diff --git a/planutils/packages/cpor/run b/planutils/packages/cpor/run new file mode 100755 index 0000000..80edc50 --- /dev/null +++ b/planutils/packages/cpor/run @@ -0,0 +1,3 @@ +#!/bin/bash + +apptainer run -e $(dirname $0)/cpor.sif $@ diff --git a/planutils/packages/cpor/uninstall b/planutils/packages/cpor/uninstall new file mode 100755 index 0000000..3df0d8e --- /dev/null +++ b/planutils/packages/cpor/uninstall @@ -0,0 +1,3 @@ +#!/bin/bash + +rm cpor.sif diff --git a/setup.py b/setup.py index db66e70..65ccfa5 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ long_description = fh.read() setuptools.setup(name='planutils', - version='0.7.10', + version='0.7.11', description='General library for setting up linux-based environments for developing, running, and evaluating planners.', long_description=long_description, long_description_content_type="text/markdown",