Skip to content

Commit

Permalink
Merge pull request #1 from NOSALRO/dockerfile
Browse files Browse the repository at this point in the history
Dockerfile
  • Loading branch information
costashatz authored Aug 13, 2024
2 parents 1897eb1 + f1f2a5f commit ab0fba4
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM --platform=x86_64 ubuntu:22.04

ARG USERNAME="robot"
ARG HOME_DIR="/home/${USERNAME}"

ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Europe/Athens"

# Installation of Ubuntu packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3-dev python-is-python3 python3-pip git cmake build-essential unzip wget libx11-dev python3-tk tk-dev g++ gcc x11-apps nano libeigen3-dev pybind11-dev libblas-dev liblapack-dev libmetis-dev gfortran libboost-all-dev libtbb-dev software-properties-common && \
apt-get clean

# Add the ThirdParty-HSL directory
ADD ThirdParty-HSL /code_libs/ThirdParty-HSL
ADD coinhsl /code_libs/ThirdParty-HSL/coinhsl

RUN cd /code_libs/ThirdParty-HSL && \
./configure && \
make VERBOSE=1 && \
make VERBOSE=1 install

# Add the ThirdParty-ASL directory
ADD ThirdParty-ASL /code_libs/ThirdParty-ASL

RUN cd /code_libs/ThirdParty-ASL && \
./get.ASL && \
./configure && \
make VERBOSE=1 && \
make VERBOSE=1 install

# Add the ThirdParty-Mumps directory
ADD ThirdParty-Mumps /code_libs/ThirdParty-Mumps

RUN cd /code_libs/ThirdParty-Mumps && \
./get.Mumps && \
./configure && \
make VERBOSE=1 && \
make VERBOSE=1 install

# Add Ipopt directory
ADD Ipopt /code_libs/Ipopt

RUN cd /code_libs/Ipopt && \
./configure && \
make VERBOSE=1 && \
make VERBOSE=1 install

# Add ifopt
RUN git clone https://github.com/ethz-adrl/ifopt.git && cd ifopt && mkdir build && cd build && cmake .. && make && make install

# Add algevo
RUN apt-get install libtbb-dev
RUN git clone https://github.com/NOSALRO/algevo.git && cd algevo && ./waf configure && ./waf install

# Add towr
RUN git clone https://github.com/itsikelis/towr.git && cd towr/towr && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make && make install

# User stuff
RUN useradd -ms /bin/bash $USERNAME
RUN echo "${USERNAME}:pass" | chpasswd
RUN apt install -y sudo
RUN usermod -aG sudo $USERNAME

USER $USERNAME

# Working directory
WORKDIR ${HOME_DIR}
1 change: 1 addition & 0 deletions .ci/Ipopt
Submodule Ipopt added at e10e5c
1 change: 1 addition & 0 deletions .ci/ThirdParty-ASL
Submodule ThirdParty-ASL added at b5d377
1 change: 1 addition & 0 deletions .ci/ThirdParty-HSL
Submodule ThirdParty-HSL added at 4f8da7
1 change: 1 addition & 0 deletions .ci/ThirdParty-Mumps
Submodule ThirdParty-Mumps added at bd0bdf
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule ".ci/Ipopt"]
path = .ci/Ipopt
url = https://github.com/coin-or/Ipopt.git
[submodule ".ci/ThirdParty-ASL"]
path = .ci/ThirdParty-ASL
url = https://github.com/coin-or-tools/ThirdParty-ASL.git
[submodule ".ci/ThirdParty-Mumps"]
path = .ci/ThirdParty-Mumps
url = https://github.com/coin-or-tools/ThirdParty-Mumps.git
[submodule ".ci/ThirdParty-HSL"]
path = .ci/ThirdParty-HSL
url = https://github.com/coin-or-tools/ThirdParty-HSL.git
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,54 @@ If you use this code in a scientific publication, please use the following citat
}
```

## Replicating the paper results

Clone this repository.

```shell
git clone [email protected]:NOSALRO/cregopt.git
```

The required libraries are added as submodules.

```shell
cd cregopt/.ci/
git submodule init
git submodule update
```

\*This code uses the HSL_MA97 parallel solver package for IPOPT, which is licensed \(more info [here](https://licences.stfc.ac.uk/product/coin-hsl)\). If you have the .zip file, you should extract its contents in the .ci/coinshl folder.

Build the docker image.

```shell
docker build -t ipopt .
```

Start the docker container.

```shell
cd .. # cd to the project root directory
docker run --rm -it --net=host -e DISPLAY -v ${HOME}/.Xauthority:/home/robot/.Xauthority -v "$(pwd)":/home/robot/code --entrypoint /bin/bash ipopt
```

In the docker container build the experiment executables and run the bash script that generates and stores the resutls.

```shell
cd code/
mkdir build && cd build
cmake ..
make -j
cd ..# cd to project's root directory
cd tools/

./run_experiment_1 # Run 1st paper experiment.
./run_experiment_2 # Run 2nd paper experiment.
./run_experiment_3 # Run 3rd paper experiment.
```

The experiment results will be automatically exported in the [project root directory]/tools/results in csv form.

## Acknowledgments

This work was supported by the [Hellenic Foundation for Research and Innovation](https://www.elidek.gr/en/homepage/) (H.F.R.I.) under the "3rd Call for H.F.R.I. Research Projects to support Post-Doctoral Researchers" (Project Acronym: NOSALRO, Project Number: 7541).
Expand Down

0 comments on commit ab0fba4

Please sign in to comment.