Skip to content

Commit

Permalink
πŸ‹πŸ”§ update dockerfile and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed Jun 6, 2024
1 parent d0fac78 commit f71fc3f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ Or you can use a runner to execute the experiments multiple times (check SUAVE r
```bash
./rosa_runner.sh true rosa time 20
```

build:
```
docker build --ssh default -t suave_rosa -f docker/Dockerfile .
```
12 changes: 3 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ COPY --chown=kasm-user:kasm-user docker/install_typedb.sh $HOME/suave_ws/src/sua
WORKDIR $HOME/suave_ws/src/suave_rosa/docker/
RUN ["/bin/bash", "-c", "./install_typedb.sh"]

COPY --chown=kasm-user:kasm-user ./bts/ $HOME/suave_ws/src/suave_rosa/bts/
COPY --chown=kasm-user:kasm-user ./cmake/ $HOME/suave_ws/src/suave_rosa/cmake/
COPY --chown=kasm-user:kasm-user ./config/ $HOME/suave_ws/src/suave_rosa/config/
COPY --chown=kasm-user:kasm-user ./include/ $HOME/suave_ws/src/suave_rosa/include/
COPY --chown=kasm-user:kasm-user ./launch/ $HOME/suave_ws/src/suave_rosa/launch/
COPY --chown=kasm-user:kasm-user ./src/ $HOME/suave_ws/src/suave_rosa/src/
COPY --chown=kasm-user:kasm-user CMakeLists.txt $HOME/suave_ws/src/suave_rosa/CMakeLists.txt
COPY --chown=kasm-user:kasm-user package.xml $HOME/suave_ws/src/suave_rosa/package.xml
COPY --chown=kasm-user:kasm-user suave_rosa/ $HOME/suave_ws/src/suave_rosa/
COPY --chown=kasm-user:kasm-user suave_rosa_bt/ $HOME/suave_ws/src/suave_rosa_bt/
COPY --chown=kasm-user:kasm-user suave_rosa_plansys/ $HOME/suave_ws/src/suave_rosa_plansys/
COPY --chown=kasm-user:kasm-user suave_rosa.rosinstall $HOME/suave_ws/src/suave_rosa/suave_rosa.rosinstall

WORKDIR $HOME/suave_ws
# RUN --mount=type=ssh,uid=1000 git clone [email protected]:kas-lab/rosa.git
RUN --mount=type=ssh,uid=1000 vcs import src < src/suave_rosa/suave_rosa.rosinstall --force


Expand Down
10 changes: 5 additions & 5 deletions docker/install_typedb.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash

sudo apt install software-properties-common apt-transport-https gpg
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 8F3DA4B5E9AEF44C
gpg --export 8F3DA4B5E9AEF44C | sudo tee /etc/apt/trusted.gpg.d/vaticle.gpg > /dev/null
echo "deb https://repo.vaticle.com/repository/apt/ trusty main" | sudo tee /etc/apt/sources.list.d/vaticle.list > /dev/null
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 17507562824cfdcc
gpg --export 17507562824cfdcc | sudo tee /etc/apt/trusted.gpg.d/vaticle.gpg > /dev/null
echo "deb https://repo.typedb.com/public/public-release/deb/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/vaticle.list > /dev/null

sudo apt update
sudo apt install openjdk-11-jre
sudo apt install typedb-server=2.24.17 typedb-console=2.24.15 typedb-bin=2.24.16
pip3 install typedb-driver==2.24.15
sudo apt install typedb=2.27.0
pip3 install typedb-driver==2.27.0
14 changes: 9 additions & 5 deletions runner/rosa_conf_results_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

MTYPE="time"
GUI="false"
RUNS=10

MANAGER="rosa"
./rosa_runner.sh $GUI $MANAGER $MTYPE 20
./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS

MANAGER="metacontrol"
./rosa_runner.sh $GUI $MANAGER $MTYPE 20
./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS

MANAGER="bt"
./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS

MANAGER="none"
./rosa_runner.sh $GUI $MANAGER $MTYPE 20
./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS

MANAGER="random"
./rosa_runner.sh $GUI $MANAGER $MTYPE 20
# MANAGER="random"
# ./rosa_runner.sh $GUI $MANAGER $MTYPE $RUNS
14 changes: 7 additions & 7 deletions runner/rosa_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if [ $# -lt 1 ]; then
echo "usage: $0 gui adaptation_manager mission_type runs"
echo example:
echo " "$0 "[true | false] [metacontrol | random | none | rosa] [time | distance] runs(integer)"
echo " "$0 "[true | false] [metacontrol | random | none | bt | rosa] [time | distance] runs(integer)"
exit 1
fi

Expand All @@ -30,7 +30,7 @@ else
exit 1
fi

if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [ "$2" == "none" ] || [ "$2" == "rosa" ];
if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [ "$2" == "none" ] || [ "$2" == "bt" ] || [ "$2" == "rosa" ];
then
MANAGER=$2
else
Expand Down Expand Up @@ -112,18 +112,18 @@ run_missions(){
xfce4-terminal --execute ./scripts/launch_sim.sh $GUI &
sleep 30 #let it boot up

rm -f ~/suave_ws/mission.done
rm -f /tmp/mission.done
xfce4-terminal --execute ./scripts/launch_mission.sh $MANAGER $MTYPE $FILENAME &
sleep 30 #let it boot up

echo "start waiting for mission to finish"
start_time=$SECONDS
while [ ! -f ~/suave_ws/mission.done ]
while [ ! -f /tmp/mission.done ]
do
if [ -f ~/suave_ws/mission.done ]
if [ -f /tmp/mission.done ]
then
echo "mission done"
rm ~/suave_ws/mission.done
rm /tmp/mission.done
break;
fi
current_time=$SECONDS
Expand All @@ -145,7 +145,7 @@ cd ~/ardupilot
./waf configure && make sub
cd $CURDIR

NOW=$(date +"%d_%m_%y_%H_%M_%S")
NOW=$(date +"%y_%m_%d_%H_%M")
MISSIONCONFIG=${NOW}"_mission_config.yaml"
mkdir -p ~/suave/results
cp ~/suave_ws/install/suave_missions/share/suave_missions/config/mission_config.yaml ~/suave/results/${MISSIONCONFIG}
Expand Down
14 changes: 9 additions & 5 deletions runner/scripts/launch_mission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
MANAGER=""
MTYPE=""

if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ] || [ "$1" == "rosa" ];
if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ] || [ "$1" == "bt" ] || [ "$1" == "rosa" ];
then
MANAGER=$1
else
Expand All @@ -33,14 +33,18 @@ else
fi
fi


FILE=$3
MCFILE=${FILE}"_mc_reasoning_time"
if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [ "$1" == "none" ];
then
ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$3
elif [ "$1" == "rosa" ]
ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$FILE mc_reasoning_time_filename:=$MCFILE
elif [ "$1" == "bt" ];
then
ros2 launch suave_bt suave_bt.launch.py result_filename:=$3
elif [ "$1" == "rosa" ]
then
xfce4-terminal --execute typedb server &
ros2 launch suave_rosa suave_rosa.launch.py mission_type:=$MTYPE result_filename:=$3
ros2 launch suave_rosa_bt suave_rosa_bt.launch.py mission_type:=$MTYPE result_filename:=$3
else
echo "adaptation_manager invalid or missing"
exit 1
Expand Down

0 comments on commit f71fc3f

Please sign in to comment.