Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved mnedc logic to discoverymgr, which fixes #178 #180

Merged
merged 1 commit into from
Nov 22, 2020

Conversation

ayush-kr
Copy link
Contributor

@ayush-kr ayush-kr commented Nov 19, 2020

Signed-off-by: ayush.kumar [email protected]

Description

Since MNEDC responsibility is similar to the Discovery Manager, the mnedcmgr package has now been moved inside discoverymgr package and renamed to mnedc.

Fixes #178

Type of change

  • Code cleanup/refactoring

How Has This Been Tested?

Similar to testing steps in #146

Test Configuration:

  • Firmware version: Ubuntu 16.04
  • Hardware: x86-64

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@MoonkiHong MoonkiHong added the refactoring Any tasks and issues w.r.t. the code refactoring label Nov 19, 2020
Copy link
Contributor

@MoonkiHong MoonkiHong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayush-kr @suresh-lc Could we refer to any testing logs like that we refered to from #146 (comment)?

Copy link
Contributor

@tiokim tiokim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Will implement discoverymgr to call StartMNEDCServer() and StartMNEDCClient(), not in main.go.

Copy link
Contributor

@suresh-lc suresh-lc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayush-kr
Copy link
Contributor Author

@ayush-kr @suresh-lc Could we refer to any testing logs like that we refered to from #146 (comment)?

MNEDC Server logs

2020/11/19 11:28:03 server.go:194: [mnedcserver][handleConnection] Connection request from107.110.5.22:55206
2020/11/19 11:28:03 server.go:205: [mnedcserver][handleConnection] Client connected! IP: 107.110.5.22:55206
2020/11/19 11:28:03 server.go:245: [mnedcserver] [NewConnection] The ip given is 10.0.0.2
2020/11/19 11:28:03 client_conn.go:41: [mnedcserver][initClient] New connection from 107.110.5.22:55206 (edge-orchestration-107.108.87.226
3334

) initialised
2020/11/19 11:28:03 servercontrol.go:99: Registered
2020/11/19 11:28:03 servercontrol.go:128: [mnedcmgr] map content:  10.0.0.1 107.108.87.226
2020/11/19 11:28:03 internalhandler.go:319: [RestInternalInterface] APIV1DiscoveryFromMNEDCServer
2020/11/19 11:28:03 internalhandler.go:339: RestInternalInterface Info from MNEDC server received
2020/11/19 11:28:03 internalhandler.go:340: RestInternalInterface Device ID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 internalhandler.go:341: RestInternalInterface Private Add: 107.110.5.22
2020/11/19 11:28:03 internalhandler.go:342: RestInternalInterface Virtual Add: 10.0.0.2
2020/11/19 11:28:03 discovery.go:247: [discoverymgr] [AddDeviceInfo] private Addr 107.110.5.22
2020/11/19 11:28:03 discovery.go:248: [discoverymgr] [AddDeviceInfo] Virtual Addr 10.0.0.2
2020/11/19 11:28:03 discovery.go:272: [discoverymgr] Error in getting network info of edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 route.go:125: From [10.0.0.1:33312] POST /api/v1/discoverymgr/register APIV1DiscoverymgrMNEDCDeviceInfoPost 295.8µs
2020/11/19 11:28:03 restclient.go:199: [restclient] DoGetOrchestrationInfo for 10.0.0.2
2020/11/19 11:28:03 restclient.go:222: [JSON] :  map[ExecutionType:container Platform:docker ServiceList:<nil>]
2020/11/19 11:28:03 restclient.go:224: [restclient] GetOrchInfoResponse Platform: docker
2020/11/19 11:28:03 restclient.go:226: [restclient] GetOrchInfoResponse ExecutionType: container
2020/11/19 11:28:03 restclient.go:233: [restclient] GetOrchinfoResp ServiceList couldnt be populated
2020/11/19 11:28:03 restclient.go:235: [restclient] GetOrchInfoResponse ServiceList: []
2020/11/19 11:28:03 discovery.go:303: [discoverymgr] Got The Info
2020/11/19 11:28:03 discovery.go:304: [discoverymgr] edge-orchestration-107.108.87.226 3334
 docker container []
2020/11/19 11:28:03 discovery.go:319: [discoverymgr] netInfoIP: [10.0.0.2]
2020/11/19 11:28:03 discovery.go:320: [discoverymgr] netInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:321: [discoverymgr] confInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:322: [discoverymgr] confInfoExec: container
2020/11/19 11:28:03 discovery.go:323: [discoverymgr] confInfoPlatf: docker
2020/11/19 11:28:03 discovery.go:324: [discoverymgr] serviceInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:325: [discoverymgr] serviceInfoServices: []
2020/11/19 11:28:03 internalhandler.go:354: [RestInternalInterface] APIV1DiscoverymgrOrchestrationInfoGet
2020/11/19 11:28:03 discovery.go:262: [discoverymgr] Orch info requested
2020/11/19 11:28:04 route.go:125: From [10.0.0.2:40214] GET /api/v1/discoverymgr/orchestrationinfo APIV1DiscoverymgrOrchestrationInfoGet 100.481024ms

MNEDC client logs

2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 detector_netlink.go:85: detector_netlink [DetectionHandler] Disconnected :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] false
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:248: [networkmgr] [notify]  subchan is not receiving
2020/11/19 11:28:03 client.go:429: [mnedcclient] Registering to Broadcast server
2020/11/19 11:28:03 networkhelper.go:124: [networkmgr] Virtual IP asked
2020/11/19 11:28:03 networkhelper.go:128: [networkmgr] returning 10.0.0.2
2020/11/19 11:28:03 restclient.go:245: [restclient] DoNotifyMNEDCBroadcastServer
2020/11/19 11:28:03 internalhandler.go:354: [RestInternalInterface] APIV1DiscoverymgrOrchestrationInfoGet
2020/11/19 11:28:03 discovery.go:262: [discoverymgr] Orch info requested
2020/11/19 11:28:03 internalhandler.go:319: [RestInternalInterface] APIV1DiscoveryFromMNEDCServer
2020/11/19 11:28:03 internalhandler.go:339: RestInternalInterface Info from MNEDC server received
2020/11/19 11:28:03 internalhandler.go:340: RestInternalInterface Device ID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 internalhandler.go:341: RestInternalInterface Private Add: 107.108.87.226
2020/11/19 11:28:03 internalhandler.go:342: RestInternalInterface Virtual Add: 10.0.0.1
2020/11/19 11:28:03 discovery.go:247: [discoverymgr] [AddDeviceInfo] private Addr 107.108.87.226
2020/11/19 11:28:03 discovery.go:248: [discoverymgr] [AddDeviceInfo] Virtual Addr 10.0.0.1
2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:248: [networkmgr] [notify]  subchan is not receiving
2020/11/19 11:28:03 route.go:125: From [10.0.0.1:55506] GET /api/v1/discoverymgr/orchestrationinfo APIV1DiscoverymgrOrchestrationInfoGet 100.710538ms

2020/11/19 11:28:03 route.go:125: From [10.0.0.1:55504] POST /api/v1/discoverymgr/register APIV1DiscoverymgrMNEDCDeviceInfoPost 100.819534ms
2020/11/19 11:28:03 restclient.go:199: [restclient] DoGetOrchestrationInfo for 10.0.0.1
2020/11/19 11:28:03 restclient.go:222: [JSON] :  map[ExecutionType:container Platform:docker ServiceList:<nil>]
2020/11/19 11:28:03 restclient.go:224: [restclient] GetOrchInfoResponse Platform: docker
2020/11/19 11:28:03 restclient.go:226: [restclient] GetOrchInfoResponse ExecutionType: container
2020/11/19 11:28:03 restclient.go:233: [restclient] GetOrchinfoResp ServiceList couldnt be populated
2020/11/19 11:28:03 restclient.go:235: [restclient] GetOrchInfoResponse ServiceList: []
2020/11/19 11:28:03 discovery.go:303: [discoverymgr] Got The Info
2020/11/19 11:28:03 discovery.go:304: [discoverymgr] edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410
 docker container []
2020/11/19 11:28:03 discovery.go:319: [discoverymgr] netInfoIP: [10.0.0.1]
2020/11/19 11:28:03 discovery.go:320: [discoverymgr] netInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 discovery.go:321: [discoverymgr] confInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 discovery.go:322: [discoverymgr] confInfoExec: container
2020/11/19 11:28:03 discovery.go:323: [discoverymgr] confInfoPlatf: docker
2020/11/19 11:28:03 discovery.go:324: [discoverymgr] serviceInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

Service request logs on Main NAT device (Virtual IP - 10.0.0.1)

$ curl -X POST "107.108.87.226:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"ServiceName\": \"hello-world\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"run\", \"-v\", \"/var/run:/var/run:rw\", \"hello-world\"]}], \"StatusCallbackURI\": \"http://localhost:8888/api/v1/services/notification\", \"SelfSelection\": \"false\"}"

{"Message":"ERROR_NONE","RemoteTargetInfo":{"ExecutionType":"container","Target":"10.0.0.2"},"ServiceName":"hello-world"}

Service execution on Sub NAT device (Virtual IP - 10.0.0.2)

2020/11/19 11:28:48 internalhandler.go:236: [RestInternalInterface] APIV1ScoringmgrScoreLibnameGet
2020/11/19 11:28:48 route.go:125: From [10.0.0.1:55948] GET /api/v1/scoringmgr/score APIV1ScoringmgrScoreLibnameGet 695.647µs
2020/11/19 11:28:51 internalhandler.go:130: [RestInternalInterface] APIV1ServicemgrServicesPost
2020/11/19 11:28:51 internalhandler.go:153: [RestInternalInterface] Requested AppInfo
2020/11/19 11:28:51 internalhandler.go:154: [RestInternalInterface] Requester    : curl
2020/11/19 11:28:51 internalhandler.go:155: [RestInternalInterface] ServiceID    : 1
2020/11/19 11:28:51 internalhandler.go:156: [RestInternalInterface] ServiceName  : hello-world
2020/11/19 11:28:51 internalhandler.go:157: [RestInternalInterface] NotificationTargetURL : 10.0.0.1
2020/11/19 11:28:51 internalhandler.go:158: [RestInternalInterface] ExecutionCmd : [docker run -v /var/run:/var/run:rw hello-world container]
2020/11/19 11:28:51 route.go:125: From [10.0.0.1:55974] POST /api/v1/servicemgr/services APIV1ServicemgrServicesPost 261.852µs
2020/11/19 11:28:51 containerexecutor.go:70: [containerexecutor] hello-world [docker run -v /var/run:/var/run:rw hello-world]
2020/11/19 11:28:51 containerexecutor.go:71: [containerexecutor] parameter length : 5
{"status":"Pulling from library/hello-world","id":"latest"}
{"status":"Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323"}
{"status":"Status: Image is up to date for hello-world:latest"}
2020/11/19 11:28:56 containerexecutor.go:91: [containerexecutor] create container : ef1dcf052c
2020-11-19T11:28:57.674232524Z
2020-11-19T11:28:57.674289950Z Hello from Docker!
2020-11-19T11:28:57.674303382Z This message shows that your installation appears to be working correctly.
2020-11-19T11:28:57.674313372Z
2020-11-19T11:28:57.674322334Z To generate this message, Docker took the following steps:
2020-11-19T11:28:57.674331106Z  1. The Docker client contacted the Docker daemon.
2020-11-19T11:28:57.674339850Z  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
2020-11-19T11:28:57.674349267Z     (amd64)
2020-11-19T11:28:57.674357992Z  3. The Docker daemon created a new container from that image which runs the
2020-11-19T11:28:57.674367536Z     executable that produces the output you are currently reading.
2020-11-19T11:28:57.674376518Z  4. The Docker daemon streamed that output to the Docker client, which sent it
2020-11-19T11:28:57.674385870Z     to your terminal.
2020-11-19T11:28:57.674394857Z
2020-11-19T11:28:57.674404158Z To try something more ambitious, you can run an Ubuntu container with:
2020-11-19T11:28:57.674413605Z  $ docker run -it ubuntu bash
2020-11-19T11:28:57.674422656Z
2020-11-19T11:28:57.674431095Z Share images, automate workflows, and more with a free Docker ID:
2020-11-19T11:28:57.674440149Z  https://hub.docker.com/
2020-11-19T11:28:57.674449067Z
2020-11-19T11:28:57.674457590Z For more examples and ideas, visit:
2020-11-19T11:28:57.674467049Z  https://docs.docker.com/get-started/
2020-11-19T11:28:57.674476465Z

Copy link
Contributor

@tdrozdovsky tdrozdovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MoonkiHong
Copy link
Contributor

@ayush-kr @suresh-lc Could we refer to any testing logs like that we refered to from #146 (comment)?

MNEDC Server logs

2020/11/19 11:28:03 server.go:194: [mnedcserver][handleConnection] Connection request from107.110.5.22:55206
2020/11/19 11:28:03 server.go:205: [mnedcserver][handleConnection] Client connected! IP: 107.110.5.22:55206
2020/11/19 11:28:03 server.go:245: [mnedcserver] [NewConnection] The ip given is 10.0.0.2
2020/11/19 11:28:03 client_conn.go:41: [mnedcserver][initClient] New connection from 107.110.5.22:55206 (edge-orchestration-107.108.87.226
3334

) initialised
2020/11/19 11:28:03 servercontrol.go:99: Registered
2020/11/19 11:28:03 servercontrol.go:128: [mnedcmgr] map content:  10.0.0.1 107.108.87.226
2020/11/19 11:28:03 internalhandler.go:319: [RestInternalInterface] APIV1DiscoveryFromMNEDCServer
2020/11/19 11:28:03 internalhandler.go:339: RestInternalInterface Info from MNEDC server received
2020/11/19 11:28:03 internalhandler.go:340: RestInternalInterface Device ID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 internalhandler.go:341: RestInternalInterface Private Add: 107.110.5.22
2020/11/19 11:28:03 internalhandler.go:342: RestInternalInterface Virtual Add: 10.0.0.2
2020/11/19 11:28:03 discovery.go:247: [discoverymgr] [AddDeviceInfo] private Addr 107.110.5.22
2020/11/19 11:28:03 discovery.go:248: [discoverymgr] [AddDeviceInfo] Virtual Addr 10.0.0.2
2020/11/19 11:28:03 discovery.go:272: [discoverymgr] Error in getting network info of edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 route.go:125: From [10.0.0.1:33312] POST /api/v1/discoverymgr/register APIV1DiscoverymgrMNEDCDeviceInfoPost 295.8µs
2020/11/19 11:28:03 restclient.go:199: [restclient] DoGetOrchestrationInfo for 10.0.0.2
2020/11/19 11:28:03 restclient.go:222: [JSON] :  map[ExecutionType:container Platform:docker ServiceList:<nil>]
2020/11/19 11:28:03 restclient.go:224: [restclient] GetOrchInfoResponse Platform: docker
2020/11/19 11:28:03 restclient.go:226: [restclient] GetOrchInfoResponse ExecutionType: container
2020/11/19 11:28:03 restclient.go:233: [restclient] GetOrchinfoResp ServiceList couldnt be populated
2020/11/19 11:28:03 restclient.go:235: [restclient] GetOrchInfoResponse ServiceList: []
2020/11/19 11:28:03 discovery.go:303: [discoverymgr] Got The Info
2020/11/19 11:28:03 discovery.go:304: [discoverymgr] edge-orchestration-107.108.87.226 3334
 docker container []
2020/11/19 11:28:03 discovery.go:319: [discoverymgr] netInfoIP: [10.0.0.2]
2020/11/19 11:28:03 discovery.go:320: [discoverymgr] netInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:321: [discoverymgr] confInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:322: [discoverymgr] confInfoExec: container
2020/11/19 11:28:03 discovery.go:323: [discoverymgr] confInfoPlatf: docker
2020/11/19 11:28:03 discovery.go:324: [discoverymgr] serviceInfoID: edge-orchestration-107.108.87.226 3334

2020/11/19 11:28:03 discovery.go:325: [discoverymgr] serviceInfoServices: []
2020/11/19 11:28:03 internalhandler.go:354: [RestInternalInterface] APIV1DiscoverymgrOrchestrationInfoGet
2020/11/19 11:28:03 discovery.go:262: [discoverymgr] Orch info requested
2020/11/19 11:28:04 route.go:125: From [10.0.0.2:40214] GET /api/v1/discoverymgr/orchestrationinfo APIV1DiscoverymgrOrchestrationInfoGet 100.481024ms

MNEDC client logs

2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 detector_netlink.go:85: detector_netlink [DetectionHandler] Disconnected :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] false
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:248: [networkmgr] [notify]  subchan is not receiving
2020/11/19 11:28:03 client.go:429: [mnedcclient] Registering to Broadcast server
2020/11/19 11:28:03 networkhelper.go:124: [networkmgr] Virtual IP asked
2020/11/19 11:28:03 networkhelper.go:128: [networkmgr] returning 10.0.0.2
2020/11/19 11:28:03 restclient.go:245: [restclient] DoNotifyMNEDCBroadcastServer
2020/11/19 11:28:03 internalhandler.go:354: [RestInternalInterface] APIV1DiscoverymgrOrchestrationInfoGet
2020/11/19 11:28:03 discovery.go:262: [discoverymgr] Orch info requested
2020/11/19 11:28:03 internalhandler.go:319: [RestInternalInterface] APIV1DiscoveryFromMNEDCServer
2020/11/19 11:28:03 internalhandler.go:339: RestInternalInterface Info from MNEDC server received
2020/11/19 11:28:03 internalhandler.go:340: RestInternalInterface Device ID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 internalhandler.go:341: RestInternalInterface Private Add: 107.108.87.226
2020/11/19 11:28:03 internalhandler.go:342: RestInternalInterface Virtual Add: 10.0.0.1
2020/11/19 11:28:03 discovery.go:247: [discoverymgr] [AddDeviceInfo] private Addr 107.108.87.226
2020/11/19 11:28:03 discovery.go:248: [discoverymgr] [AddDeviceInfo] Virtual Addr 10.0.0.1
2020/11/19 11:28:03 detector_netlink.go:81: detector_netlink [DetectionHandler] New Connection :  10.0.0.2
2020/11/19 11:28:03 networkhelper.go:215: [networkmgr] true
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 107.110.5.22/24
2020/11/19 11:28:03 networkhelper.go:193: [networkmgr] addr 10.0.0.2/24
2020/11/19 11:28:03 networkhelper.go:248: [networkmgr] [notify]  subchan is not receiving
2020/11/19 11:28:03 route.go:125: From [10.0.0.1:55506] GET /api/v1/discoverymgr/orchestrationinfo APIV1DiscoverymgrOrchestrationInfoGet 100.710538ms

2020/11/19 11:28:03 route.go:125: From [10.0.0.1:55504] POST /api/v1/discoverymgr/register APIV1DiscoverymgrMNEDCDeviceInfoPost 100.819534ms
2020/11/19 11:28:03 restclient.go:199: [restclient] DoGetOrchestrationInfo for 10.0.0.1
2020/11/19 11:28:03 restclient.go:222: [JSON] :  map[ExecutionType:container Platform:docker ServiceList:<nil>]
2020/11/19 11:28:03 restclient.go:224: [restclient] GetOrchInfoResponse Platform: docker
2020/11/19 11:28:03 restclient.go:226: [restclient] GetOrchInfoResponse ExecutionType: container
2020/11/19 11:28:03 restclient.go:233: [restclient] GetOrchinfoResp ServiceList couldnt be populated
2020/11/19 11:28:03 restclient.go:235: [restclient] GetOrchInfoResponse ServiceList: []
2020/11/19 11:28:03 discovery.go:303: [discoverymgr] Got The Info
2020/11/19 11:28:03 discovery.go:304: [discoverymgr] edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410
 docker container []
2020/11/19 11:28:03 discovery.go:319: [discoverymgr] netInfoIP: [10.0.0.1]
2020/11/19 11:28:03 discovery.go:320: [discoverymgr] netInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 discovery.go:321: [discoverymgr] confInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

2020/11/19 11:28:03 discovery.go:322: [discoverymgr] confInfoExec: container
2020/11/19 11:28:03 discovery.go:323: [discoverymgr] confInfoPlatf: docker
2020/11/19 11:28:03 discovery.go:324: [discoverymgr] serviceInfoID: edge-orchestration-7e841a12-a083-48fe-8040-83815e0b7410

Service request logs on Main NAT device (Virtual IP - 10.0.0.1)

$ curl -X POST "107.108.87.226:56001/api/v1/orchestration/services" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"ServiceName\": \"hello-world\", \"ServiceInfo\": [{ \"ExecutionType\": \"container\", \"ExecCmd\": [ \"docker\", \"run\", \"-v\", \"/var/run:/var/run:rw\", \"hello-world\"]}], \"StatusCallbackURI\": \"http://localhost:8888/api/v1/services/notification\", \"SelfSelection\": \"false\"}"

{"Message":"ERROR_NONE","RemoteTargetInfo":{"ExecutionType":"container","Target":"10.0.0.2"},"ServiceName":"hello-world"}

Service execution on Sub NAT device (Virtual IP - 10.0.0.2)

2020/11/19 11:28:48 internalhandler.go:236: [RestInternalInterface] APIV1ScoringmgrScoreLibnameGet
2020/11/19 11:28:48 route.go:125: From [10.0.0.1:55948] GET /api/v1/scoringmgr/score APIV1ScoringmgrScoreLibnameGet 695.647µs
2020/11/19 11:28:51 internalhandler.go:130: [RestInternalInterface] APIV1ServicemgrServicesPost
2020/11/19 11:28:51 internalhandler.go:153: [RestInternalInterface] Requested AppInfo
2020/11/19 11:28:51 internalhandler.go:154: [RestInternalInterface] Requester    : curl
2020/11/19 11:28:51 internalhandler.go:155: [RestInternalInterface] ServiceID    : 1
2020/11/19 11:28:51 internalhandler.go:156: [RestInternalInterface] ServiceName  : hello-world
2020/11/19 11:28:51 internalhandler.go:157: [RestInternalInterface] NotificationTargetURL : 10.0.0.1
2020/11/19 11:28:51 internalhandler.go:158: [RestInternalInterface] ExecutionCmd : [docker run -v /var/run:/var/run:rw hello-world container]
2020/11/19 11:28:51 route.go:125: From [10.0.0.1:55974] POST /api/v1/servicemgr/services APIV1ServicemgrServicesPost 261.852µs
2020/11/19 11:28:51 containerexecutor.go:70: [containerexecutor] hello-world [docker run -v /var/run:/var/run:rw hello-world]
2020/11/19 11:28:51 containerexecutor.go:71: [containerexecutor] parameter length : 5
{"status":"Pulling from library/hello-world","id":"latest"}
{"status":"Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323"}
{"status":"Status: Image is up to date for hello-world:latest"}
2020/11/19 11:28:56 containerexecutor.go:91: [containerexecutor] create container : ef1dcf052c
2020-11-19T11:28:57.674232524Z
2020-11-19T11:28:57.674289950Z Hello from Docker!
2020-11-19T11:28:57.674303382Z This message shows that your installation appears to be working correctly.
2020-11-19T11:28:57.674313372Z
2020-11-19T11:28:57.674322334Z To generate this message, Docker took the following steps:
2020-11-19T11:28:57.674331106Z  1. The Docker client contacted the Docker daemon.
2020-11-19T11:28:57.674339850Z  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
2020-11-19T11:28:57.674349267Z     (amd64)
2020-11-19T11:28:57.674357992Z  3. The Docker daemon created a new container from that image which runs the
2020-11-19T11:28:57.674367536Z     executable that produces the output you are currently reading.
2020-11-19T11:28:57.674376518Z  4. The Docker daemon streamed that output to the Docker client, which sent it
2020-11-19T11:28:57.674385870Z     to your terminal.
2020-11-19T11:28:57.674394857Z
2020-11-19T11:28:57.674404158Z To try something more ambitious, you can run an Ubuntu container with:
2020-11-19T11:28:57.674413605Z  $ docker run -it ubuntu bash
2020-11-19T11:28:57.674422656Z
2020-11-19T11:28:57.674431095Z Share images, automate workflows, and more with a free Docker ID:
2020-11-19T11:28:57.674440149Z  https://hub.docker.com/
2020-11-19T11:28:57.674449067Z
2020-11-19T11:28:57.674457590Z For more examples and ideas, visit:
2020-11-19T11:28:57.674467049Z  https://docs.docker.com/get-started/
2020-11-19T11:28:57.674476465Z

@ayush-kr Thank you for the kind information (and your passionate efforts to validate the PR).

Copy link
Contributor

@MoonkiHong MoonkiHong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the log, it looks good to me.

@MoonkiHong MoonkiHong merged commit 1d45f03 into lf-edge:master Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Any tasks and issues w.r.t. the code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MNEDC] Refactoring in terms of Architecture
5 participants