Issue with Route Creation in Tutorial

microservices
iofog-controller
create-route

(jono) #1

Hey,

So, I was doing the tutorial (https://iofog.org/docs/1.0.0/tutorial/deploy-your-microservice.html#setup-our-routes) and I noticed that one of the create-route cmds isn’t actually creating a route when its executed.

After removing the existing route between the API and Sensors I list the microservices and get this:

$ iofog-controller microservice list
{
  "microservices": [
    {
      "uuid": "L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M",
      "config": "{}",
      "name": "API",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 14,
      "iofogUuid": "GGRdYWCPxJJNxqJtxjmXL22K4MFmqjxD",
      "userId": 1
    },
    {
      "uuid": "w3ZfnYbhk3v88NbqHXJ84hfxN3PT9Z9T",
      "config": "{}",
      "name": "Sensors",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 13,
      "iofogUuid": "QjnzvcW8DvZ8pVkK6RYF9LNDKVWPtQpV",
      "userId": 1
    },
    {
      "uuid": "vkdLpbr7yvBkQnHkHJXvvMTVG9YCYTBZ",
      "config": "{}",
      "name": "freeboard",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 15,
      "iofogUuid": "GGRdYWCPxJJNxqJtxjmXL22K4MFmqjxD",
      "userId": 1
    },
    {
      "uuid": "tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY",
      "config": "{ \"maxWindowSize\": 10 }",
      "name": "Moving Average 1",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 16,
      "iofogUuid": "QjnzvcW8DvZ8pVkK6RYF9LNDKVWPtQpV",
      "userId": 1
    }
  ]
}
Microservices have been retrieved successfully.

Note that I don’t have any of the networking microservices that are built when a route exists. Next I continue with the tutorial and create the first route between the Sensors and moving_average services:

$ iofog-controller microservice route-create --route w3ZfnYbhk3v88NbqHXJ84hfxN3PT9Z9T:tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY

{"route":"w3ZfnYbhk3v88NbqHXJ84hfxN3PT9Z9T:tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY"}
Microservice route with source microservice w3ZfnYbhk3v88NbqHXJ84hfxN3PT9Z9T and dest microservice tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY has been created successfully.

Note that the response is incomplete but still says successful. When I list all of the microservices again, I get the same list of 4 microservices before I created the route. Now if I continue on and create the second route between moving_average and the API, I get this:

$ iofog-controller microservice route-create --route tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY:L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M

{"route":"tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY:L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M"}
200
{ status: 'ok',
  id: 'a9b849cf-5521-43e7-97e1-f22ecbc702d5',
  port1: 32768,
  port2: 32769,
  passcode1: '17680478-b3d9-4b81-a0fd-a5a5982d1dbe',
  passcode2: '562be987-65bd-4afa-aae4-181b48cbc5f6',
  timestamp: 1548032515170 }
Microservice route with source microservice tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY and dest microservice L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M has been created successfully.

Much more promising. Now when I list all of the microservices I get the previous 4 microservices plus two networking microservices, one for the API and one for moving_average:

$ iofog-controller microservice list
{
  "microservices": [
    {
      "uuid": "L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M",
      "config": "{}",
      "name": "API",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 14,
      "iofogUuid": "GGRdYWCPxJJNxqJtxjmXL22K4MFmqjxD",
      "userId": 1
    },
    {
      "uuid": "w3ZfnYbhk3v88NbqHXJ84hfxN3PT9Z9T",
      "config": "{}",
      "name": "Sensors",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 13,
      "iofogUuid": "QjnzvcW8DvZ8pVkK6RYF9LNDKVWPtQpV",
      "userId": 1
    },
    {
      "uuid": "vkdLpbr7yvBkQnHkHJXvvMTVG9YCYTBZ",
      "config": "{}",
      "name": "freeboard",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 15,
      "iofogUuid": "GGRdYWCPxJJNxqJtxjmXL22K4MFmqjxD",
      "userId": 1
    },
    {
      "uuid": "tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY",
      "config": "{ \"maxWindowSize\": 10 }",
      "name": "Moving Average 1",
      "rootHostAccess": false,
      "logSize": 0,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 16,
      "iofogUuid": "QjnzvcW8DvZ8pVkK6RYF9LNDKVWPtQpV",
      "userId": 1
    },
    {
      "uuid": "CkbWVPJpf6NZLb8hvR2krfWyr3JVK3P4",
      "config": "{\"mode\":\"private\",\"host\":\"172.17.0.2\",\"port\":32768,\"passcode\":\"17680478-b3d9-4b81-a0fd-a5a5982d1dbe\",\"connectioncount\":1,\"localhost\":\"iofog\",\"localport\":0,\"heartbeatfrequency\":20000,\"heartbeatabsencethreshold\":60000,\"devmode\":true}",
      "name": "Network for Microservice tytWyYZZFLtPzc7YJF66nt3LwzRMC4PY",
      "rootHostAccess": false,
      "logSize": 50,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 1,
      "iofogUuid": "QjnzvcW8DvZ8pVkK6RYF9LNDKVWPtQpV",
      "userId": 1
    },
    {
      "uuid": "dBCCNbfXx9mtzwWVZh4X6Cd2xBQkDVVB",
      "config": "{\"mode\":\"private\",\"host\":\"172.17.0.2\",\"port\":32769,\"passcode\":\"562be987-65bd-4afa-aae4-181b48cbc5f6\",\"connectioncount\":1,\"localhost\":\"iofog\",\"localport\":0,\"heartbeatfrequency\":20000,\"heartbeatabsencethreshold\":60000,\"devmode\":true}",
      "name": "Network for Microservice L8n8wpP7hyKY9NYt4KYMgBkZbnY8kT9M",
      "rootHostAccess": false,
      "logSize": 50,
      "delete": false,
      "deleteWithCleanup": false,
      "flowId": 1,
      "catalogItemId": 1,
      "iofogUuid": "GGRdYWCPxJJNxqJtxjmXL22K4MFmqjxD",
      "userId": 1
    }
  ]
}
Microservices have been retrieved successfully.

I’m a little perplexed as to why the networking microservices are being built correctly between moving_average and the API but not between the Sensors and moving_average.

Am I doing something wrong?

P.S. I think that this part of the tutorial is out of date (https://iofog.org/docs/1.0.0/tutorial/manage-your-microservices.html#routes). It still shows routes as being a property of the microservice containers but it seems at some point you switched to having the routes as their own networking containers


(Eugene) #2

Hi @jonoberg,

We are looking into the issue with route creation.
For now I want to clarify few points regarding routing thing:
Network containers are created in 2 cases:

  1. If you create route between two microservices that resides on different physical machines (on different IoFog Agents). In this case on each route “side” core network container is created. These system containers are used to connect to IoFog Connector which is in charge of communication provision between the two microservices.
  2. If you create public access link to any of you microservices. Again core network container is created which in turn connects to IoFog Connector.

So for the two microservices that resides on the same IoFog Agent core network containers are not required.

Hope this helps.

Thank you,
Eugene.


(jono) #3

Hey @Eugene,

Thanks for the reply. Thanks for the explanation that helps me understand a little bit better. When I was first playing around with this, I originally thought it was the case that the networking containers were only used as an overlay to connect microservices on different iofog-agents. It was only after I realized that the microservices on the same iofog-agent were missing the routes field as mentioned in the tutorial (https://iofog.org/docs/1.0.0/tutorial/manage-your-microservices.html#routes) that I began to think something was going wrong.

Should I be seeing a “routes” object between my microservices that share the same iofog-agent?


(Eugene) #4

@jonoberg,
Yep, I think you should be able to see it. But for some reason it’s not shown in the output you provided.
We will take a look on this and get back to you.

Thank you,
Eugene.


(Eugene) #5

Hi @jonoberg,

Tomorrow we are going to release new version of iofog-contoroller (1.0.34).
The issue with routes should be fixed there.

Thank you,
Eugene