Skip to content

Commit

Permalink
updated meao generation script (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
  • Loading branch information
gabrik committed May 13, 2019
1 parent aa75c39 commit 4b3e354
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/utils/generate_mec_orchestrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ case $key in
-t|--test)
TEST=true
shift;;
-b|--build)
BUILD=false
shift;;
*)
POSITIONAL+=("$1")
shift
Expand All @@ -26,8 +29,18 @@ done
docker image rm fog05/yaks --force
docker image rm fog05/meao --force

make -C ocaml/mec_meao_mepmv clean
make -C ocaml/mec_meao_mepmv

if [ $BUILD ]; then
make -C ocaml/mec_meao_mepmv clean
make -C ocaml/mec_meao_mepmv
else
mkdir -p ocaml/mec_meao_mepmv/_build/default/meao
curl -L -o /tmp/meao.tar.gz https://www.dropbox.com/s/91fw8iromfz3su6/meao.tar.gz
tar -xzvf /tmp/meao.tar.gz -C ocaml/mec_meao_mepmv/_build/default/meao
rm -rf /tmp/meao.tar.gz
fi



docker network rm fog05-meaonet
docker network create -d overlay --attachable fog05-meaonet
Expand All @@ -39,18 +52,26 @@ sg docker -c "docker build . -f ./docker/Dockerfile-meao -t fog05/meao --no-cach
docker stack deploy -c ./docker/docker-compose.yaml meao


if [ $TEST ]
then
make -C ocaml/mec_platform clean
make -C ocaml/mec_platform
if [ $TEST ]; then
if [ $BUILD ]; then
make -C ocaml/mec_platform clean
make -C ocaml/mec_platform
else
mkdir -p ocaml/mec_platform/_build/default/me_platform
curl -L -o /tmp/mecp.tar.gz https://www.dropbox.com/s/gx32gnr1y4gcm2w/mecp.tar.gz
tar -xzvf /tmp/mecp.tar.gz -C ocaml/mec_platform/_build/default/me_platform
rm -rf /tmp/mecp.tar.gz
fi
./generate_mec_platform.sh
MEC_IP=$(lxc list -c4 --format json plat | jq -r '.[0].state.network.eth0.addresses[0].address')
PL="{\"platformId\":\"testp\", \"endpoint\":{\"uris\":[\"/exampleAPI/mm5/v1\"], \"alternative\":{},\"addresses\":[{\"host\":\"$MEC_IP\",\"port\":8091}]}}"
curl -X POST http://127.0.1:8071/exampleAPI/mm1/v1/platforms -d "$PL"
fi


sleep 5

docker stack deploy -c docker/docker-compose.yaml meao



Expand Down
3 changes: 3 additions & 0 deletions src/utils/python/mec_mm1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ install:
uninstall:
pip uninstall fog05mm1 -y

package:
python setup.py sdist bdist_wheel

test:
rm -rf .tox
tox

0 comments on commit 4b3e354

Please sign in to comment.