The iota open-source iot platform consists of a number of open source components including larger components such a Kafka, Mesos and others. The core iota components found in the folders in this code repository and they include:
Fey is a Scala framework developed using Akka Actors (http://akka.io/). If still don't know the Actor model offered by Akka, We suggested that you take sometime to look into it and get at least a basic idea of the Akka Actor model and concepts. The current version of Akka that is being used on Fey is 2.10.4
In order to be able to build and run it you will need to install the following on your machine:
Once your environment is ready to go, you will need to download the source code:
Choose the directory where you want to download the source code to. Lets call it IOTA_SOURCE_DIR.
The source code for IOTA is available at GitHub (https://github.com/apache/incubator-iota). Make sure you have git installed.
>> cd IOTA_SOURCE_DIR >> git clone git@github.com:apache/incubator-iota.git
Once the git clone command has finished with success, you should see the source code for IOTA in the folder incubator-iota
IOTA project is composed by 3 main components: fey-core, performers and deployments.
We will be focused on the fey-core and performers components.
Fey core uses the SBT tool. In order to build the fey-core .jar go to your terminal and:
>> cd IOTA_SOURCE_DIR\incubator-iota >> sbt >> project fey-core >> assembly
The command assembly
will run all fey-core unit tests and build the .jar. If everything is executed successfuly you should see a message like:
[info] SHA-1: 5644d19b7ebc9dec87646e9327a4c163c62936d3 [info] Packaging IOTA_SOURCE_DIR/incubator-iota/fey-core/target/scala-2.11/iota-fey-core.jar ... [info] Done packaging. [success] Total time: 70 s, completed Feb 7, 2017 11:13:30 AM
Check at IOTA_SOURCE_DIR/incubator-iota/fey-core/target/scala-2.11
for the iota-fey-core.jar
Once you have built fey-core, you should configure it propertly. Fey-core reads a .conf file. The default configuration can be find at IOTA_SOURCE_DIR/incubator-iota/fey-core\src\main\resources\application.conf
The basic configuration you should worry about are the directories used by Fey. Fey core does not create the directories, therefore, the directories must be already created before starting Fey.
Let's create a basic configuration for fey.
fey-global-configuration{ enable-checkpoint = true checkpoint-directory = ${HOME}"/feyCheckpoint" json-repository = ${HOME}"/feyJSONRepo" json-extension = ".json" jar-repository = ${HOME}"/feyJarRepo" log-level = "INFO" }
Create the directories that are going to be used by Fey:
Once you have defined the my-fey.conf configuration file for fey, and created all the necessary directories you should be ready to run Fey.
>> java -jar IOTA_SOURCE_DIR/incubator-iota/fey-core/target/scala-2.11/iota-fey-core.jar PATH_TO/my-fey.conf
You should see an output like:
[INFO] [17/02/07 12:11:17] akka.event.slf4j.Slf4jLogger [] : Slf4jLogger started [INFO] [17/02/07 12:11:17] org.apache.iota.fey.FeyCore [akka://FEY-MANAGEMENT-SYSTEM/user/FEY-CORE] : Starting Fey Core [INFO] [17/02/07 12:11:17] org.apache.iota.fey.GlobalWatchService [akka://FEY-MANAGEMENT-SYSTEM/user/FEY-CORE/GLOBAL_WATCH_SERVICE] : Starting Global Watcher from PRE-START [INFO] [17/02/07 12:11:17] org.apache.iota.fey.Monitor [akka://FEY-MANAGEMENT-SYSTEM/user/FEY-MONITOR] : START | 1486498277506 | akka://FEY-MANAGEMENT-SYSTEM/user/FEY-CORE | [INFO] [17/02/07 12:11:17] org.apache.iota.fey.Monitor [akka://FEY-MANAGEMENT-SYSTEM/user/FEY-MONITOR] : START | 1486498277514 | akka://FEY-MANAGEMENT-SYSTEM/user/FEY-CORE/JSON_RECEIVER | [INFO] [17/02/07 12:11:17] akka.event.slf4j.Slf4jLogger [] : Slf4jLogger started [INFO] [17/02/07 12:11:17] play.api.Play [] : Application started (Prod) [INFO] [17/02/07 12:11:17] play.core.server.NettyServer [] : Listening for HTTP on /0:0:0:0:0:0:0:0:16666
To make sure everything is running smoothly, check the Fey monitoring end points.
Go to your browser and type in http://localhost:16666/fey/activeactors. You should see one Actor System and 2 Actors running:
Open another tab in your browser and go to http://localhost:16666/fey/monitoringevents
You should see the START event for the two Actors running on Fey:
TBD