Skip to content

Latest commit

 

History

History
204 lines (124 loc) · 5.49 KB

build.rst

File metadata and controls

204 lines (124 loc) · 5.49 KB

Build all components from the source code

FogFlow can be build and installed on Linux for both ARM and X86 processors (32bits and 64bits).

Install dependencies

  1. To build FogFlow, first install the following dependencies.

  2. 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
  3. 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"
  4. To check out the code repository

    cd /home/smartfog/go/src/
    git clone https://github.com/smartfog/fogflow.git
  5. To build all components from the source code as below

Build IoT Discovery

  • 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 build
  • to 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" .

Build IoT Broker

  • 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 build
  • to 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" .

Build Topology Master

  • 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 build
  • to 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" .

Build Worker

  • 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 build
  • to 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" .

Build Task Designer

  • to install third-party library dependencies

    # go the designer folder
    cd /home/smartfog/go/src/fogflow/designer
    
    # install all required libraries
    npm install
  • to 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"  .