Quick Start

In this Quick Start guide we'll download a simple ioFog setup containing a Controller, Connector, and an Agent. This gives you a quick way to establish a mininal Edge Compute Network (ECN) on our local machine and start playing with ioFog. This setup can also be used as a minimal local development environment on any machine that can run Docker.

Minimum Requirements

ioFog requires a Linux environment, however this Tutorial has everything already setup inside a Linux Docker container that can run on Mac or Windows as well.

  • Linux v3.10+ (Ubuntu, CentOS, etc), macOS 10.12+, or Windows 7+
  • Docker 1.10+

Install Docker and Docker-Compose

Linux

We can install the latest version of Docker with following command:

curl -sSf https://get.docker.com/ | sh

Or download Docker manually for: Ubuntu, Debian, Fedora or CentOS.

Next we need to install Docker Compose. For the latest instructions, see the Docker Compose Install Guide. This tutorial requires docker-compose version 1.24.

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

macOS

Docker for Mac can be installed from the Docker Store

Download Docker from Docker Store

To install Docker Compose on Mac, follow the instructions at Docker Compose Install Guide. This tutorial requires docker-compose version 1.24.

Windows

Docker for Windows can be installed from the Docker Store:

Download Docker from Docker Store

To install Docker Compose on Windows, follow the instructions atDocker Compose Install Guide. This tutorial requires docker-compose version 1.24.

Raspbian Usage

While we fully support using Raspberry Pi's as workers on the edge environment, they are not meant to be used as the Controller and Connector infrastructure. The normal quick-starts above will bring up an entire containerized edge environment for usage, while this section will specify using the Raspberry Pi as an agent in our edge infrastructure.

Raspbian Agents

We have a general guide for Agent Setup Here.

Download Tutorial Project

Finally, we need to download the Tutorial project, which will use Docker to run Linux containers for an ioFog Agent, Controller, and Connector that are already set up.

On Unix based systems, download our tar.gz package.

cd where/we/want/iofog-demo
curl -L -o demo.tar.gz https://github.com/eclipse-iofog/demo/archive/v1.0.0.tar.gz
tar -zxvf demo.tar.gz --strip-components=1

On windows, download tutorial .zip package. Then unzip the contents into a preferred working directory.

Bootstrap the Project

Start by spinning up the ioFog stack (Agent, Controller, and Connector) on our local machine. This creates a fully configured Edge Compute Network (ECN) without any microservices.

$ ./start.sh

We can optionally verify the ioFog stack is provisioned correctly. The automated tests run a smoke test suite on the ioFog stack, testing basic operations.

$ ./test.sh

When we are finished, we can tear down the ioFog stack and all services deployed on it.

$ ./stop.sh

Shell Into Your Containers

Your newly setup development environment has three containers: iofog-agent, iofog-controller, and iofog-connector. As their names imply, they contain a running Agent, Controller, and Connector respectively.

You can think of each of these containers as if they were separate devices; the Controller is controlling the Agent the same way it would if the devices were hundreds of miles away, and the Connector can broker communication between any microservices you run.

To create a shell (bash) environment into one of your containers you can use the docker exec -ti command.

docker exec -ti iofog-controller bash

Now we're inside the iofog-controller container and can issue commands to our Controller. Try this one:

iofog-controller iofog list

This should give you a JSON response containing a list of edge nodes already registered with the Controller. In our case, a single node "name": "ioFog Node". That "node" is actually the environment running inside the iofog-agent container.

Conclusion

You that you have a local ioFog environment running, you can learn more about Microservices, take the Tutorial, or setup your production environment.