Azure-Samples / NVIDIA-Deepstream-Azure-IoT-Edge-on-a-NVIDIA-Jetson-Nano

This is a sample showing how to do real-time video analytics with NVIDIA DeepStream connected to Azure via Azure IoT Edge. It uses a NVIDIA Jetson Nano device that can process up to 8 real-time video streams concurrently.
MIT License
172 stars 56 forks source link

how to run the latest release on jetson? #24

Open AndreV84 opened 3 years ago

AndreV84 commented 3 years ago

no errros, but neither there is ds-test thing

[IoTHubMonitor] Start monitoring message arrived in built-in endpoint for device [nvidia-jetson] ...
[IoTHubMonitor] Created partition receiver [0] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [1] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [2] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [3] for consumerGroup [$Default]

So how to troubleshoot? RTSP streaming seems enabled at the jetson /var/deepstream/configs folder test5 file @ebertrams , I anticipate that it might be broken deployment file that prevents the whole thing from functioning, right? maybe you have the deployment json that you could attach for reference? or sugegst other ways on how to possibly to resolve the issue or how to do diagnostics to see what exactly fails or what exactly works?

AndreV84 commented 3 years ago

the problem seems that the deployment temlate changes won't get reflected at the deployment json file

{
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.1",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {}
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.2",
              "createOptions": "{}"
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.2",
              "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
            }
          }
        },
        "modules": {
          "NVIDIADeepStreamSDK": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "marketplace.azurecr.io/nvidia/deepstream51-l4t:latest",
              "createOptions": "{\"HostConfig\":{\"runtime\":\"nvidia\"},\"WorkingDir\":\"/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/configs\",\"Entrypoint\":[\"/usr/bin/deepstream-test5-app\",\"-c\",\"test5_config_file_src_infer_azure_iotedge.txt\",\"-p\",\"1\",\"-m\",\"1\"]}"
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.2",
        "routes": {
          "DeepstreamToIoTHub": "FROM /messages/modules/NVIDIADeepStreamSDK/outputs/* INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

while the template is

{
  "$schema-template": "4.0.0",
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.1",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {}
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.2",
              "createOptions": {}
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.2",
              "createOptions": {
                "HostConfig": {
                  "PortBindings": {
                    "5671/tcp": [
                      {
                        "HostPort": "5671"
                      }
                    ],
                    "8883/tcp": [
                      {
                        "HostPort": "8883"
                      }
                    ],
                    "443/tcp": [
                      {
                        "HostPort": "443"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "modules": {
          "NVIDIADeepStreamSDK": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "marketplace.azurecr.io/nvidia/deepstream51-l4t:latest",
              "createOptions": {
                "ExposedPorts":{
                  "8554/tcp": {}
              },             
                "HostConfig": {
                  "PortBindings": {
                    "8554/tcp": [
                        {
                        "HostPort": "8554"
                        }
                    ]
                },               
                  "Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"],
                  "runtime": "nvidia"
                },
                "WorkingDir": "/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/",
                "Entrypoint":["/usr/bin/deepstream-test5-app","-c","test5_config_file_src_infer_azure_iotedge_edited.txt"]

              }
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.2",
        "routes": {
          "DeepstreamToIoTHub": "FROM /messages/modules/NVIDIADeepStreamSDK/outputs/* INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

so it seems that the changes that were added by the directions of the readme file to the corresponding places at the template deployment file won't get processed/ applied to the deployment manifest thus are not incorporated at the device at all How to approach it?

AndreV84 commented 3 years ago

first edit lines 63-66 modifying to

"HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"]

                  "runtime": "nvidia"
                },

as per the instruction from the github repository readme

ount your updated config file in the Deepstream module by adding its createOptions in the deployment.template.json file from your development's machine:

Add the following to your Deepstream createOptions:

is it correct lines to add , also the correct form of the edit or it lke missees something like a bracket or something? then second proposed edit is to edit the WorkFolder. So putting like:

  "runtime": "nvidia"
                },
                "WorkingDir": "/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/",

at line 67 Next edit seems to be to add

"Entrypoint":["/usr/bin/deepstream-test5-app","-c","test5_config_file_src_infer_azure_iotedge_edited.txt"]

so taking lines 68-76 deleting this excerpt:

"Entrypoint": [
                  "/usr/bin/deepstream-test5-app",
                  "-c",
                  "test5_config_file_src_infer_azure_iotedge.txt",
                  "-p",
                  "1",
                  "-m",
                  "1"
                ]

placing instead the excerpt fro mthe readme of the github:

"Entrypoint":["/usr/bin/deepstream-test5-app","-c","test5_config_file_src_infer_azure_iotedge_edited.txt"]

However next instruction says:

Add the following to your Deepstream createOptions, at the root: "ExposedPorts":{ "8554/tcp": {} }

so It will move the whole lines numberation as it will get added ahead of already added edits.
So adding it between these two lines 61-62:

"createOptions": { "HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"]

so it becomes all like line 61-64

"createOptions": {"ExposedPorts":{ "8554/tcp": {} }, "HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"]

I guess by now the integrity of the code is already broken so the edited json file won\t get deployed, but lets try to add the last edit:
this one directs to add extra element to already added element, right?
so lines 64-68 that I have by now s:

"HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"]

              "runtime": "nvidia"
            },
will become more like:
so by now 61-76 becomes like

"createOptions": {"ExposedPorts":{ "8554/tcp": {} }, "HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"]

              "runtime": "nvidia"
            },
            "PortBindings": 
              "8554/tcp": [
                  {
                  "HostPort": "8554"
                  }
              ],

            "WorkingDir": "/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/",

now it most likely got broken
could you maybe attach the already edited file? the file that incorporates already these all minor edits to the json file, please?
 so it could be just downloaded or completely copy pasted instead of the vscode json content?
AndreV84 commented 3 years ago

after editing few brackets/ commas suggested by vscode also after generating the deployment manifest it becomes more like

{
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.1",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {}
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.2",
              "createOptions": "{}"
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.2",
              "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
            }
          }
        },
        "modules": {
          "NVIDIADeepStreamSDK": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "marketplace.azurecr.io/nvidia/deepstream51-l4t:latest",
              "createOptions": "{\"HostConfig\":{\"runtime\":\"nvidia\"},\"WorkingDir\":\"/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/configs\",\"Entrypoint\":[\"/usr/bin/deepstream-test5-app\",\"-c\",\"test5_config_file_src_infer_azure_iotedge.txt\",\"-p\",\"1\",\"-m\",\"1\"]}"
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.2",
        "routes": {
          "DeepstreamToIoTHub": "FROM /messages/modules/NVIDIADeepStreamSDK/outputs/* INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

the json itself , however looks like

{
  "$schema-template": "4.0.0",
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.1",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {}
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.2",
              "createOptions": {}
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.2",
              "createOptions": {
                "HostConfig": {
                  "PortBindings": {
                    "5671/tcp": [
                      {
                        "HostPort": "5671"
                      }
                    ],
                    "8883/tcp": [
                      {
                        "HostPort": "8883"
                      }
                    ],
                    "443/tcp": [
                      {
                        "HostPort": "443"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "modules": {
          "NVIDIADeepStreamSDK": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "marketplace.azurecr.io/nvidia/deepstream51-l4t:latest",
              "createOptions": {"ExposedPorts":{
                "8554/tcp": {}
            },
                "HostConfig": {"Binds": ["/var/deepstream/custom_configs/:/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/"],

                  "runtime": "nvidia"
                },
                "PortBindings": { "8554/tcp": [
                      {
                      "HostPort": "8554"
                      }
                  ]},

                "WorkingDir": "/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/custom_configs/",
                "Entrypoint":["/usr/bin/deepstream-test5-app","-c","test5_config_file_src_infer_azure_iotedge_edited.txt"]

              }
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.2",
        "routes": {
          "DeepstreamToIoTHub": "FROM /messages/modules/NVIDIADeepStreamSDK/outputs/* INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

the problem seems that while it says deployment is successful it won't reflect anything related to incorporated changes or 8554 port added; any ideas?

BriggsyUK-NC commented 2 years ago

looking for fix for this!