-
Notifications
You must be signed in to change notification settings - Fork 55
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
Handle container lifecycle events through eventbridge #261
Conversation
This pull request introduces 1 alert when merging 3699aae into 5bb9d69 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging dc0136c into 5bb9d69 - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts and fixes 1 when merging ae39fa7 into 5bb9d69 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 3 alerts and fixes 1 when merging 512c83d into 5bb9d69 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 1 when merging 79719b1 into 5bb9d69 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 1 when merging ee55c2a into 5bb9d69 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 1 when merging 843867e into 5bb9d69 - view on LGTM.com new alerts:
fixed alerts:
|
@cablej can you take a look when you get a chance? I tested this on the old staging environment and everything seemed to work. |
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.
This looks good, we can consider fetching logs inline in the future
Fixes #257.
Adds infrastructure for handling events (task start, task stop) through EventBridge. When an event is called, it calls the updateScanTaskStatus lambda function, which updates the scantask's status accordingly.
This approach is better than the earlier approach because we can be sure we catch all errors (previously, sometimes if the entire process crashed, the db wouldn't update that the task had stopped and it would be marked as "started" forever).
Local development
For local development, there is a handler that listens to Docker events (container start / stop) and then invokes updateScanTaskStatus with the right payload. This handler runs on the
backend
container during local development.Logs
One change is that the
output
column no longer contains the error directly, as that is not returned from the EventBridge stopped event. Logs can now be accessed by directly going to a link on CloudWatch on the AWS console. Perhaps in the future we can show logs directly in Crossfeed by pulling data directly from CloudWatch.Testing
I've deployed this on https://staging.crossfeed.cyber.dhs.gov/ and it seems to work well.