Skip to main content

Setup

We provide a docker container capable of building and running our measurement campaign. The container also functions as a Remote Desktop Server (RDP) with preconfigured development envioronments to inspet and edit the source code.

Install docker

Build docker image

In this repository, the devenv folder contains scripts and source files to recreate the development and measurement environment.

Dockerfile for the environment
FROM --platform=x86-64 linuxserver/rdesktop:ubuntu-xfce

ENV PUID=1000
ENV PGID=1000
ENV TZ=Etc/UTC

EXPOSE 3389

# Initialize misc
USER root
RUN apt update
RUN apt install git wget zip nano -y
RUN apt install openjdk-21-jdk -y
RUN apt install psmisc -y
RUN apt install webext-ublock-origin-firefox -y
RUN apt install build-essential -y


# Install ProbLog
USER root
RUN apt install -y python3
RUN apt install -y python3-pip
RUN pip install --break-system-packages problog
RUN pip install --break-system-packages PySDD

# Install eclipse
USER root
RUN wget 'https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-modeling-2024-03-R-linux-gtk-x86_64.tar.gz' -O eclipse.tar.gz
RUN tar -xzf eclipse.tar.gz -C /opt
RUN rm eclipse.tar.gz
RUN echo '[Desktop Entry]\n\
Version=13.0\n\
Type=Application\n\
Terminal=false\n\
Icon=/opt/eclipse/icon.xpm\n\
Name=Modeling 2024-03\n\
Exec=/opt/eclipse/eclipse\n\
Name=Modeling 2024-03\n\
Categories=Development\n\' > /usr/share/applications/eclipse.desktop

# Install VIATRA and dependencies
USER root
RUN /opt/eclipse/eclipse -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/releases/2024-03 -installIU org.eclipse.collections.feature.source.feature.group/11.1.0.v20220705-1455,org.eclipse.xtend.sdk.feature.group/2.34.0.v20240227-0940,org.eclipse.xtext.redist.feature.group/0.0.0
RUN /opt/eclipse/eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/viatra/updates/release/2.8.0 -installIU org.eclipse.viatra.query.sdk.feature.source.feature.group/2.8.0.202310201322,org.eclipse.viatra.query.sdk.feature.feature.group/2.8.0.202310201322

# Install python packages for diagrams
RUN pip install --break-system-packages notebook
RUN pip install --break-system-packages pandas==1.5.3 seaborn==0.12.2 matplotlib==3.7.1 numpy==1.26.4 itables

# Install storm
USER root
WORKDIR /opt
RUN apt install build-essential git cmake libboost-all-dev libcln-dev libgmp-dev libginac-dev automake libglpk-dev libhwloc-dev libz3-dev libxerces-c-dev libeigen3-dev -y
RUN wget https://github.com/moves-rwth/storm/archive/stable.zip
RUN unzip stable.zip
WORKDIR storm-stable
RUN mkdir build
WORKDIR build
RUN cmake ..
RUN make -j12
ENV PATH=$PATH:/opt/storm-stable/build/bin
WORKDIR /opt
RUN rm stable.zip

RUN rm -rf /config/.cache

Before cuntinuing, ensure that the current working driectory is devenv od the repository. (ProbabilisticGraphQuery/devenv)

Build your own docker image with the following command:

docker build -t pgq-devenv .
Note
  • Downloading eclipse takes a lot of time. Be patient, or download the eclipse instance manually and replace RUN wget 'https://www.eclipse.org/downloads ... with COPY <your file> eclipse.tar.gz
  • Building storm model checker can take up to an hour. It also takes significant memory to compile. To lower resource usage, adjust the make -j12 flag in the dockerfile to use less CPU cores.

Alternatively, import the image using the following command:

docker image load -i <my image file>

Create container

Create container with the following command.

docker run -d -u root ^
-v \\wsl$\Ubuntu\tmp\.X11-unix:/tmp/.X11-unix ^
-v \\wsl$\Ubuntu\mnt\wslg:/mnt/wslg ^
--name=pgq-devenv-storm ^
--security-opt seccomp=unconfined ^
-p 4100:3389 ^
--shm-size="1gb" ^
-v %~dp0\..:/config/ProbabilisticGraphQuery ^
pgq-devenv

(Delayed) You can stop the container with:

docker container stop pgq-devenv-storm 

(Delayed) You can restart the container with:

docker container start pgq-devenv-storm 
Note

If you use docker exec, don't forget to set the user to abc.

docker exec -u abc -it -w /config pgq-devenv-storm /bin/bash

Configuring container

Download compile runtime dependencies

docker exec -u abc -w /config/ProbabilisticGraphQuery/sources/hu.bme.mit.delta.api/libs/ pgq-devenv-storm ./download.sh
docker exec -u abc -w /config/ProbabilisticGraphQuery/sources/hu.bme.mit.inf.measurement.utilities/libs/ pgq-devenv-storm ./download.sh

Configure editor

  • Connect to the running container from an RDP client (address: localhost:4100, username: abc, password: abc)
  • Launch Eclipse from Applications -> Development -> Modeling 2024-03
  • Pick a workplace. (Any directory works, but we recommend picking /config/ProbabilisticGraphQuery/devenv/workplace)
  • Import all projects from /config/ProbabilisticGraphQuery/sources (File -> Import -> General -> Existing Projects into Workspace -> Next -> Select root directory -> /config/ProbabilisticGraphQuery/sources -> Projects -> Select All -> Finish)
  • Change missing API baseline preferences for org.eclipse.viatra.query.runtime.rete to Warning or Ignore. (Window -> Preferences -> Plug-in Development -> API Baselines -> Missing API baseline -> Ignore)
  • Import launch configurations from /config/ProbabilisticGraphQuery/devenv/launch_configs (File -> Import -> Run/Debug -> Launch Configurations -> Next -> From Directory -> /config/ProbabilisticGraphQuery/devenv/launch_configs -> tick launch_configs -> Finish)

Using the container

  • Export runnable jar for measurements: File -> Export -> Java -> Runnable JAR file -> Next -> Launch configuration (select any, e.g., SAT - Scale - hu.bme.mit.inf.measurement) -> Export destination: /config/ProbabilisticGraphQuery/measurements/pgq.jar -> select Extract required libraries into generated JAR -> Finish -> (Ignore warnings)