Commit cf6abcf0 authored by Samuel GAIST's avatar Samuel GAIST Committed by André Anjos
Browse files

[scripts] Update buildout_compile_cxx_algorithm for V2 algorithms

parent fb815482
#! /bin/bash
ALGORITHMS_ROOT="beat/core/test/prefix/algorithms/user"
DOCKER_IMAGE="docker.idiap.ch/beat/beat.env.client:1.3.0r1"
BEAT_CORE_PATH=$(dirname "$0")
......@@ -11,19 +10,46 @@ cd $BEAT_CORE_PATH
# Compilation of the algorithm
if [ "$1" == "build" ]; then
cd $ALGORITHMS_ROOT
tar -cf cxx_integers_echo.tar cxx_integers_echo/
docker run -dti --name build $DOCKER_IMAGE > /dev/null
docker cp cxx_integers_echo.tar build:/tmp/cxx_integers_echo.tar
docker exec build bash -c 'cd /tmp ; tar -xf /tmp/cxx_integers_echo.tar'
docker exec build bash -c 'cd /tmp/cxx_integers_echo ; mkdir build ; cd build ; cmake .. ; make'
docker cp build:/tmp/cxx_integers_echo/1.so cxx_integers_echo/.
docker stop build > /dev/null
docker rm build > /dev/null
rm cxx_integers_echo.tar
# # V1 build
# echo "Building v1 algorithm"
# DOCKER_IMAGE="docker.idiap.ch/beat/beat.env.client:1.3.0r1"
# tar -cf cxx_integers_echo.tar cxx_integers_echo/
# docker run -dti --name build $DOCKER_IMAGE > /dev/null
# docker cp cxx_integers_echo.tar build:/tmp/cxx_integers_echo.tar
# docker exec build bash -c 'cd /tmp ; tar -xf /tmp/cxx_integers_echo.tar'
# docker exec build bash -c 'cd /tmp/cxx_integers_echo ; mkdir build ; cd build ; cmake .. ; make'
# docker cp build:/tmp/cxx_integers_echo/1.so cxx_integers_echo/.
# docker stop build > /dev/null
# docker rm build > /dev/null
# rm cxx_integers_echo.tar
# V2 builds
echo "Building v2 algorithm"
DOCKER_IMAGE="docker.idiap.ch/beat/beat.env.client:2.0.0"
types=('legacy' 'autonomous' 'sequential' 'analyzer')
# types=('autonomous')
for type in "${types[@]}"; do
algorithm_name="cxx_integers_echo_$type"
archive_name="$algorithm_name.tar"
echo "$archive_name" "$algorithm_name/"
tar -cf "$archive_name" "$algorithm_name/"
docker run -dti --name build $DOCKER_IMAGE > /dev/null
docker cp "$archive_name" "build:/tmp/$archive_name"
docker exec build bash -c "cd /tmp ; tar -xf /tmp/$archive_name"
docker exec build bash -c "cd /tmp/$algorithm_name ; mkdir build ; cd build ; cmake .. ; make"
docker cp "build:/tmp/$algorithm_name/1.so" "$algorithm_name/."
docker stop build > /dev/null
docker rm build > /dev/null
rm "$archive_name"
done
fi
# Cleanup of the compiled algorithms
if [ "$1" == "clean" ]; then
rm -f "$ALGORITHMS_ROOT/cxx_integers_echo/1.so"
for type in ['legacy', 'autonomous', 'sequential', 'analyzer']; do
rm -f "$ALGORITHMS_ROOT/cxx_integers_echo_$type/1.so"
done
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment