-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## MEC - Added docker files for Multi-access Edge Application Orchestrator to facilitate his deployment - Fixed bugs in both MEC Platform and MEAO with respect to data stored in the registry and response format - Added tests for Mm1 interface and Mm5 interface, that validates both Client and Servers - Fixed bug in the logging of errors in MEAO
- Loading branch information
Showing
21 changed files
with
760 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from ubuntu:xenial | ||
|
||
LABEL authors="Gabriele Baldoni" | ||
|
||
RUN apt update && \ | ||
DEBIAN_FRONTEND=noninteractive apt install libev-dev libssl-dev libgmp-dev -y | ||
|
||
copy ./ocaml/mec_meao_mepmv/_build/default/meao/meao.exe /root/meao | ||
|
||
EXPOSE 8071 | ||
|
||
CMD /root/meao -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from ubuntu:xenial | ||
|
||
LABEL authors="Gabriele Baldoni" | ||
|
||
RUN apt update && \ | ||
DEBIAN_FRONTEND=noninteractive apt install libev-dev libssl-dev curl -y && \ | ||
DEBIAN_FRONTEND=noninteractive curl -L -o /tmp/yaks.tar.gz https://www.dropbox.com/s/g4tnzvjwlx3zcr2/yaksd.tar.gz && \ | ||
tar -xzvf /tmp/yaks.tar.gz -C /root/ | ||
|
||
EXPOSE 7887 | ||
|
||
CMD /root/yaksd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3' | ||
volumes: | ||
fog05-meao-yaks: | ||
fog05-meao: | ||
|
||
networks: | ||
netMEAO: | ||
external: | ||
name: fog05-meaonet | ||
|
||
services: | ||
fog05-meao-yaks: | ||
image: fog05/yaks | ||
# ports: | ||
# - "7887:7887" | ||
networks: | ||
- netMEAO | ||
fog05-meao: | ||
image: fog05/meao | ||
networks: | ||
- netMEAO | ||
environment: | ||
YAKS_HOST: fog05-meao-yaks | ||
YAKS_PORT: 7887 | ||
ports: | ||
- "8071:8071" | ||
depends_on: | ||
- fog05-meao-yaks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
# INSTALL SNAPD - LXD - DOCKER | ||
# CREATE MEAO/YAKS container (DOCKER) | ||
# CREATE TEST MEC Container (LXD) | ||
|
||
# docker swarm init --advertise-addr 192.168.100.134 | ||
|
||
POSITIONAL=() | ||
while [[ $# -gt 0 ]] | ||
do | ||
key="$1" | ||
|
||
case $key in | ||
-t|--test) | ||
TEST=true | ||
shift;; | ||
*) | ||
POSITIONAL+=("$1") | ||
shift | ||
;; | ||
esac | ||
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 | ||
|
||
docker network rm fog05-meaonet | ||
docker network create -d overlay --attachable fog05-meaonet | ||
|
||
|
||
sg docker -c "docker build . -f ./docker/Dockerfile-yaks -t fog05/yaks --no-cache" | ||
sg docker -c "docker build . -f ./docker/Dockerfile-meao -t fog05/meao --no-cache" | ||
|
||
docker stack deploy -c ./docker/docker-compose.yaml meao | ||
|
||
|
||
if [ $TEST ] | ||
then | ||
make -C ocaml/mec_platform clean | ||
make -C ocaml/mec_platform | ||
./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 | ||
|
||
|
||
|
||
|
||
|
||
|
||
# lxc launch images:ubuntu/bionic meao | ||
# sleep 3; | ||
|
||
# lxc exec meao -- sudo apt update -qq | ||
# lxc exec meao -- sudo apt install curl -y | ||
# lxc exec meao -- sudo useradd -m mec | ||
# lxc exec meao -- usermod -aG sudo mec | ||
# lxc exec meao -- echo "mec ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers > /dev/null | ||
# lxc exec meao -- mkdir -p /etc/fos/utils/mec | ||
# lxc exec meao -- mkdir -p /etc/fos/utils/ | ||
# lxc exec meao -- curl -L -o /tmp/yaks.tar.gz https://www.dropbox.com/s/g4tnzvjwlx3zcr2/yaksd.tar.gz | ||
# lxc exec meao -- tar -xzvf /tmp/yaks.tar.gz -C /etc/fos | ||
# lxc exec meao -- rm -rf /tmp/yaks.tar.gz | ||
# lxc file push ./ocaml/mec_meao_mepmv/_build/default/meao/meao.exe meao/etc/fos/utils/meao | ||
# lxc exec meao -- sudo chown mec:mec -R /etc/fos | ||
|
||
# lxc file push ../../etc/yaks.service meao/lib/systemd/system/ | ||
# lxc file push ../../etc/yaks.target meao/lib/systemd/system/ | ||
# lxc file push ./ocaml/mec_meao_mepmv/etc/mec_meao.service meao/lib/systemd/system/ | ||
# lxc exec meao -- sudo apt install libev-dev libssl-dev nginx -y | ||
|
||
# lxc file push ./ocaml/mec_meao_mepmv/etc/nginx meao/etc/nginx/sites-available/default | ||
# lxc file push ./ocaml/mec_meao_mepmv/etc/ip_replace.sh meao/tmp/ | ||
|
||
# lxc exec meao -- /tmp/ip_replace.sh | ||
|
||
# lxc exec meao -- systemctl stop nginx | ||
|
||
# lxc exec meao -- systemctl daemon-reload | ||
# lxc exec meao -- systemctl enable nginx | ||
# lxc exec meao -- systemctl enable yaks | ||
# lxc exec meao -- systemctl enable mec_meao | ||
|
||
# lxc exec meao -- systemctl start nginx | ||
# lxc exec meao -- systemctl start yaks | ||
# lxc exec meao -- systemctl start mec_meao | ||
|
||
# # lxc list -c4 --format json plat | ||
|
||
# MEAOIP=$(lxc list -c4 --format csv meao | cut -d' ' -f1) | ||
|
||
# sudo iptables -t nat -A PREROUTING -i lo -p tcp --dport 8071 -j DNAT --to $MEAOIP:8071 | ||
|
||
# echo "export MEAO=127.0.0.1:8071/exampleAPI/mm1/v1" >> ~/.profile | ||
|
||
# export MEAO="127.0.0.1:8071/exampleAPI/mm1/v1" |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...l/mec_meao_mepmv/etc/mec_platform.service → ...ocaml/mec_meao_mepmv/etc/mec_meao.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
server { | ||
listen 192.168.11.254:8081; | ||
#server_name mp1.platfrom.mec; | ||
location / { | ||
proxy_pass http://127.0.0.1:8081; | ||
} | ||
} | ||
|
||
|
||
server { | ||
listen ip:8091; | ||
#server_name mm5.platform.mec; | ||
listen ip:8071; | ||
#server_name mm1.meao.mec; | ||
location / { | ||
|
||
proxy_pass http://127.0.0.1:8091; | ||
proxy_pass http://127.0.0.1:8071; | ||
} | ||
} | ||
|
||
server { | ||
listen ip:9999; | ||
#server_name dyndns.platfrom.mec; | ||
location / { | ||
proxy_pass http://127.0.0.1:9999; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.