FogFlow can be build and installed on Linux for both ARM and X86 processors (32bits and 64bits).
To build FogFlow, first install the following dependencies.
install git client: please follow the instruction at https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-16-04
install Docker CE: please follow the instruction at https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
Note
all the scripts are prepared under the assumption that you can run docker without sudo.
install the latest version of golang(>v1.9): please download and install it according to the information at https://golang.org/doc/install
install nodejs(>6.11) and npm (>3.10): please download and install them according to the information at https://nodejs.org/en/download/
To check the installed version
go version #output go version go1.9 linux/amd64 nodejs -v #output v6.10.2 npm -v #output 3.10.10
To set the environment variable GOPATH
Note
GOPATH defines the workspace for your go-based projects. Please note that the go workspace folder must have a "src" folder and your fogflow code repository must be cloned into this "src" folder. For example, assume that your home folder is "/home/smartfog" and then you create a new folder "go" as your workspace. In this case, you must create a "src" (must be exactly this name) under "/home/smartfog/go" first and then check out the FogFlow code repository within the "/home/smartfog/go/src" folder.
export GOPATH="/home/smartfog/go"
To check out the code repository
cd /home/smartfog/go/src/ git clone https://github.com/smartfog/fogflow.git
To build all components from the source code as below
to build the native executable program
# go the discovery folder cd /home/smartfog/go/src/fogflow/discovery # download its third-party library dependencies go get # build the source code go buildto build the docker image,
# you can simply run ./build to perform the following commands # download its third-party library dependencies go get # build the source code and link all libraries statically CGO_ENABLED=0 go build -a # create the docker image; you might have to use sudo to run this command # if your docker user is not in the sudo group docker build -t "fogflow/discovery" .
to build the native executable program
# go the broker folder cd /home/smartfog/go/src/fogflow/broker # download its third-party library dependencies go get # build the source code go buildto build the docker image
# you can simply run ./build to perform the following commands # download its third-party library dependencies go get # build the source code and link all libraries statically CGO_ENABLED=0 go build -a # create the docker image; you might have to use sudo to run this command # if your docker user is not in the sudo group docker build -t "fogflow/broker" .
to build the native executable program
# go the master folder cd /home/smartfog/go/src/fogflow/master # download its third-party library dependencies go get # build the source code go buildto build the docker image
# you can simply run ./build to perform the following commands # download its third-party library dependencies go get # build the source code and link all libraries statically CGO_ENABLED=0 go build -a # create the docker image; you might have to use sudo to run this command # if your docker user is not in the sudo group docker build -t "fogflow/master" .
to build the native executable program
# go the worker folder cd /home/smartfog/go/src/fogflow/worker # download its third-party library dependencies go get # build the source code go buildto build the docker image
# you can simply run ./build to perform the following commands # download its third-party library dependencies go get # build the source code and link all libraries statically CGO_ENABLED=0 go build -a # create the docker image; you might have to use sudo to run this command # if your docker user is not in the sudo group docker build -t "fogflow/worker" .
to install third-party library dependencies
# go the designer folder cd /home/smartfog/go/src/fogflow/designer # install all required libraries npm installto build the docker image
# you can simply run ./build to perform the following commands # install all required libraries npm install # create the docker image; you might have to use sudo to run this command # if your docker user is not in the sudo group docker build -t "fogflow/designer" .