generated from edgexfoundry-holding/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: camera mgmt docker build, secret names, and go mods #229
Merged
ajcasagrande
merged 2 commits into
edgexfoundry:main
from
EdgeX-Camera-Management:docker-compose
Jun 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,15 @@ package appcamera | |
import ( | ||
"net/http" | ||
"sync" | ||
"time" | ||
|
||
"github.com/edgexfoundry/app-functions-sdk-go/v3/pkg/interfaces" | ||
"github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" | ||
"github.com/pkg/errors" | ||
"github.com/edgexfoundry/go-mod-core-contracts/v3/errors" | ||
) | ||
|
||
const ( | ||
maxRetries = 10 | ||
) | ||
|
||
type CameraManagementApp struct { | ||
|
@@ -37,23 +42,31 @@ func NewCameraManagementApp(service interfaces.ApplicationService) *CameraManage | |
|
||
func (app *CameraManagementApp) Run() error { | ||
if err := app.service.LoadCustomConfig(app.config, "AppCustom"); err != nil { | ||
return errors.Wrap(err, "failed to load custom configuration") | ||
return errors.NewCommonEdgeX(errors.KindServerError, "failed to load custom configuration", err) | ||
} | ||
|
||
var err error | ||
for i := 0; i < maxRetries; i++ { | ||
app.lc.Infof("Querying EVAM pipeline statuses.") | ||
if err = app.queryAllPipelineStatuses(); err != nil { | ||
app.lc.Errorf("Unable to query EVAM pipeline statuses. Is EVAM running? %s", err.Error()) | ||
time.Sleep(time.Second) | ||
} else { | ||
break // no error, so lets continue | ||
} | ||
} | ||
if err != nil { | ||
app.lc.Errorf("Unable to query EVAM pipeline statuses after %d tries. .") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to put in the value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also there is an extra period in the message. |
||
return err // exit. we do not want to run if evam is not accessible | ||
} | ||
|
||
if err := app.addRoutes(); err != nil { | ||
return err | ||
} | ||
|
||
// Subscribe to events. | ||
err := app.service.SetDefaultFunctionsPipeline( | ||
app.processEdgeXDeviceSystemEvent) | ||
if err != nil { | ||
return errors.Wrap(err, "failed to set default pipeline to processEdgeXEvent") | ||
} | ||
|
||
if err = app.queryAllPipelineStatuses(); err != nil { | ||
// do not exit, just log | ||
app.lc.Errorf("Unable to query EVAM pipeline statuses. Is EVAM running? %s", err.Error()) | ||
if err := app.service.SetDefaultFunctionsPipeline(app.processEdgeXDeviceSystemEvent); err != nil { | ||
return errors.NewCommonEdgeX(errors.KindServerError, "failed to set default pipeline to processEdgeXEvent", err) | ||
} | ||
|
||
devices, err := app.getAllDevices() | ||
|
@@ -68,7 +81,7 @@ func (app *CameraManagementApp) Run() error { | |
} | ||
|
||
if err = app.service.Run(); err != nil { | ||
return errors.Wrap(err, "failed to run pipeline") | ||
return errors.NewCommonEdgeX(errors.KindServerError, "failed to run pipeline", err) | ||
} | ||
|
||
return nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all other commands are make commands it would be nice to also have docker compose ones under make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normally I would agree, but in this case I think it is fine to keep as docker compose, as the user has more control over it