Skip to content

Commit

Permalink
Merge pull request #203 from gabrik/5gdive-orchestrator
Browse files Browse the repository at this point in the history
Initial implementation of FOrcE
  • Loading branch information
gabrik authored Oct 8, 2020
2 parents 7c2ea4d + c2d6cf0 commit 2724539
Show file tree
Hide file tree
Showing 19 changed files with 4,893 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ before_install:
- docker run -it -d --name build debian:10-slim bash
- docker exec build apt update
# install deps
- docker exec build apt install build-essential devscripts lintian dh-make git wget jq libev-dev libssl-dev python3 python3-dev python3-pip m4 pkg-config rsync unzip cmake sudo -y
- docker exec build apt install build-essential devscripts lintian dh-make curl git wget jq libev-dev libssl-dev python3 python3-dev python3-pip m4 pkg-config rsync unzip cmake sudo -y
- docker exec build pip3 install pyangbind
- docker exec build bash -c "cd /root/ && wget https://golang.org/dl/go1.15.2.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.15.2.linux-amd64.tar.gz"
# install opam
- docker exec build wget -O opam https://github.com/ocaml/opam/releases/download/2.0.6/opam-2.0.6-x86_64-linux
- docker exec build bash -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rust.sh && chmod +x /tmp/rust.sh"
- docker exec build bash -c "/tmp/rust.sh --default-toolchain nightly -y"
- docker exec build install ./opam /usr/local/bin/opam
- docker exec build opam init --disable-sandboxing
# copying repo inside container
- docker cp ../fog05 build:/root/
script:
- docker exec build bash -c "eval \$(opam env) && cd /root/fog05 && ./build.sh"
- docker exec build bash -c 'export PATH=${PATH}:/usr/local/go/bin && eval $(opam env) && source ${HOME}/.cargo/env && cd /root/fog05 && ./build.sh'
# building a debian package
# - docker exec build bash -c "mkdir /root/build && cd /root && mv fog05 build/fog05-0.1 && cd build && tar -czvf fog05-0.1.tar.gz fog05-0.1"
# - docker exec build bash -c "eval \$(opam env) && cd /root/build/fog05-0.1 && make clean && make -C api/api-python clean && make -C sdk/sdk-python clean"
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ api-python:
agent:
make -C src/agent

force:
make -C src/force

fosctl:
make -C src/utils/fosctl

install: sdk-python api-python


Expand Down Expand Up @@ -102,3 +108,5 @@ uninstall:

clean:
make -C src/agent clean
make -C src/force clean
make -C src/utils/fosctl clean
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ cd zenohd
make
cd ../..

echo "[BUILD] Building Fog05"
echo "[BUILD] Building fog05"
# build fog05
git submodule update --init --recursive
make
make


echo "[BUILD] fog05 FOrcE"
make force

echo "[BUILD] fog05 fosctl"
make fosctl
14 changes: 14 additions & 0 deletions src/force/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:3.12

LABEL maintainer="Gabriele Baldoni <gabriele.baldoni@adlinktech.com>"

RUN apk add --no-cache \
libc6-compat curl


RUN curl https://github.com/eclipse-fog05/fog05/releases/download/v0.2.1/libzenohc-amd64.so -L -o /usr/local/lib/libzenohc.so
COPY force /root/force

EXPOSE 9191

ENTRYPOINT ["/root/force"]
19 changes: 19 additions & 0 deletions src/force/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.PHONY: all clean image push-image


REGISTRY?=fog05/force
TAG?=$(shell git describe --tags --dirty)
ARCH?=amd64

all:
go build -o force src/app.go src/force.go src/main.go

clean:
rm -rf force


image:
docker build -f Dockerfile.$(ARCH) -t $(REGISTRY):$(TAG)-$(ARCH) .

push-image:
docker push $(REGISTRY):$(TAG)-$(ARCH)
29 changes: 29 additions & 0 deletions src/force/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'
volumes:
fog05-force:
fog05-zenoh:

networks:
netFORCE:
external:
name: fog05-forcenet

services:
fog05-zenoh:
image: fog05/zenoh
networks:
- netFORCE
fog05-force:
image: fog05/force
deploy:
restart_policy:
condition: on-failure
networks:
- netFORCE
environment:
ZENOH: fog05-zenoh
ports:
- "9191:9191"
depends_on:
- fog05-zenoh

5 changes: 5 additions & 0 deletions src/force/etc/force.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"address":"0.0.0.0",
"port":"9191",
"zenoh":"tcp/192.168.86.206:7447"
}
20 changes: 20 additions & 0 deletions src/force/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module src

go 1.13

require (
github.com/eclipse-fog05/api-go v0.2.2
github.com/eclipse-fog05/sdk-go v0.2.2
github.com/go-errors/errors v1.1.1 // indirect
github.com/googleapis/gnostic v0.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/juliangruber/go-intersect v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
k8s.io/client-go v0.19.0
k8s.io/utils v0.0.0-20200821003339-5e75c0163111 // indirect
)
Loading

0 comments on commit 2724539

Please sign in to comment.