Skip to content

feat: ability to disable RTSP server on startup via configuration#268

Merged
ajcasagrande merged 5 commits intoedgexfoundry:mainfrom
marcpfuller:enable_rtsp
Aug 15, 2023
Merged

feat: ability to disable RTSP server on startup via configuration#268
ajcasagrande merged 5 commits intoedgexfoundry:mainfrom
marcpfuller:enable_rtsp

Conversation

@marcpfuller
Copy link
Copy Markdown

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)N/A
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)
    N/A

Testing Instructions

  1. run make test
  2. start up edgex using edgex-compose make run no-secty
  3. build device-usb-camera make build
  4. enable/ disable EnableRtspServer in canfiguration.yml
  5. verify Rtsp server starts and does not start when enabled/disabled

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 8, 2023

Codecov Report

Merging #268 (e5325cd) into main (040a5a6) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff            @@
##            main    #268      +/-   ##
========================================
- Coverage   4.21%   4.10%   -0.12%     
========================================
  Files          8       8              
  Lines       1067    1096      +29     
========================================
  Hits          45      45              
- Misses      1022    1051      +29     
Files Changed Coverage Δ
internal/driver/driver.go 3.62% <0.00%> (-0.17%) ⬇️

@vyshali-chitikeshi
Copy link
Copy Markdown
Contributor

vyshali-chitikeshi commented Aug 10, 2023

Validation looks good both in secure and non-secure mode deployments. Below are more details

  1. When rtsp server disabled in configuration.yml file, streaming status, start streaming and stop
    streaming APIs gives error "Device resource rtsp server is not enabled" as expected.
  2. When rtsp server is enabled in configuration file, streaming status, start and stop streaming gives
    no error and works as expected. Also noticed below msg in logs
    "Starting rtsp authentication server on localhost:8000", This msg does not show up in logs when
    rtsp is disabled.
  3. Verified some general api's like camera status, camera info and camera status etc in both cases i.e.
    rtsp server enabled/disabled and they work correctly
  4. Negative test: Provided invalid value (something other than true/false) for rtsp server in configuration.yml file , noticed that it gave below error in logs, boot strapping exits before discovering cameras. I think this is expected.
    level=ERROR ts=2023-08-10T19:15:40.54388004Z app=device-usb-camera source=init.go:77 msg="ProtocolDriver init failed: failed to parse EnableRtspServer config: strconv.ParseBool: parsing "abcd": invalid syntax"
  5. Validated test cases from 1 to 4 both in secure and non secure modes, and results are same.

Copy link
Copy Markdown
Contributor

@seanohair22 seanohair22 left a comment

Choose a reason for hiding this comment

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

Tested, looks good! Just found one spelling error...

Comment thread internal/driver/driver.go Outdated
@ajcasagrande
Copy link
Copy Markdown
Contributor

PR name should be updated. this is a feat. Also the current functionality is that it is enabled, so something like this:

feat: ability to disable RTSP server on startup via configuration

@ajcasagrande ajcasagrande self-requested a review August 11, 2023 17:36
@marcpfuller marcpfuller changed the title fix: Enable Rtsp server at startup feat: ability to disable RTSP server on startup via configuration Aug 11, 2023
Marc-Philippe Fuller added 3 commits August 11, 2023 10:41
Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
… server is disabled

Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
Copy link
Copy Markdown
Contributor

@ajcasagrande ajcasagrande left a comment

Choose a reason for hiding this comment

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

Looks good! I have a few small suggestions.

Comment thread internal/driver/driver.go Outdated
Comment thread internal/driver/driver.go Outdated
Comment thread internal/driver/driver.go Outdated
Comment thread internal/driver/driver.go Outdated
Comment thread internal/driver/driver.go Outdated
Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
Comment thread internal/driver/driver.go Outdated
Comment thread internal/driver/driver.go
…t os.stat message

Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
Copy link
Copy Markdown
Contributor

@ajcasagrande ajcasagrande left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@seanohair22 seanohair22 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ajcasagrande ajcasagrande merged commit 01aee5a into edgexfoundry:main Aug 15, 2023
Copy link
Copy Markdown
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

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

A late review. I'm not sure how this is suppose to work with docker and snaps, in which both have other defined ways of starting the RTSP server.

Comment thread cmd/res/configuration.yaml
Comment thread internal/driver/driver.go
Comment thread internal/driver/driver.go
InputIndex = "InputIndex"
UrlRawQuery = "urlRawQuery"
EnableRtspServer = "EnableRtspServer"
RtspServerCmd = "./rtsp-simple-server"
Copy link
Copy Markdown
Member

@farshidtz farshidtz Aug 23, 2023

Choose a reason for hiding this comment

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

This should be made configurable. The executable path can vary depending on the deployment.

See the snap testing error, line 161:
Aug 15 00:10:47 fv-az570-769 edgex-device-usb-camera.device-usb-camera[5200]: level=ERROR ts=2023-08-15T00:10:47.372662735Z app=device-usb-camera source=init.go:77 msg="ProtocolDriver init failed: ./rtsp-simple-server file cannot be found: stat ./rtsp-simple-server: no such file or directory"
For the snap, it needs to be $SNAP/bin/rtsp-simple-server -> /snap/edgex-device-usb-camera/current/bin/rtsp-simple-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants