diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..c4df690 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,23 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +env: + PANDA_SUBSYSTEM: pandaPIgrounder + IMAGE_NAME: panda-pi-grounder + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag ${IMAGE_NAME}:$(date +%s) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e4f452 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:22.04 +LABEL Description="Pandas Grounder" + +ENV HOME /root + +SHELL ["/bin/bash", "-c"] + +RUN apt-get update && apt-get -y --no-install-recommends install \ + build-essential \ + clang \ + cmake \ + gdb \ + git \ + wget \ + ca-certificates zip unzip gengetopt + +COPY . /pandaPIgrounder + +RUN cd /pandaPIgrounder/cpddl && \ + git restore . && \ + cd third-party/boruvka && git restore . + +RUN cd /pandaPIgrounder/cpddl && \ + git apply ../0002-makefile.patch + +RUN cd /pandaPIgrounder && \ + cd cpddl && \ + make boruvka opts bliss lpsolve + +RUN cd /pandaPIgrounder/cpddl && make + +RUN cd /pandaPIgrounder/src && \ + make diff --git a/pandaPIgrounder.sh b/pandaPIgrounder.sh new file mode 100755 index 0000000..8a8771f --- /dev/null +++ b/pandaPIgrounder.sh @@ -0,0 +1,34 @@ +#! /bin/bash + +show_help() { + echo "Usage: $(basename $0) INPUT-FILE OUTPUT-FILE" +} + + +while getopts "hu" opt; do + case "$opt" in + h|u) + show_help + exit 0 + ;; + esac +done + +if (( $# != 2 )); then + >&2 echo "Illegal number of parameters" + show_help + exit 1 +fi + +DIR=${TMPDIR}$(mktemp -d panda-grounder.XXXXXXXX) + +mkdir -p ${DIR} + +cp $1 ${DIR}/ + +input_filename=$( basename "$1" ) + +docker run -i -v ${DIR}:/io panda-pi-grounder:latest pandaPIgrounder/pandaPIgrounder /io/${input_filename} /io/output.sas + +cp ${DIR}/output.sas $2 +