Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
23 changes: 23 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions pandaPIgrounder.sh
Original file line number Diff line number Diff line change
@@ -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