-
Notifications
You must be signed in to change notification settings - Fork 0
DRF Expansion #24
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
base: main
Are you sure you want to change the base?
DRF Expansion #24
Changes from all commits
407ce27
1af5c05
96ba14d
a9bac15
5cf99ab
d73ab7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,48 +3,70 @@ syntax = "proto3"; | |
| package common.event; | ||
|
|
||
| import "google/protobuf/duration.proto"; | ||
| import "google/protobuf/timestamp.proto"; | ||
| import "google/protobuf/empty.proto"; | ||
|
|
||
| message Event { | ||
| message Clock { | ||
| int32 event_number = 1; | ||
| EventType event_type = 2; | ||
| optional google.protobuf.Duration delay = 3; | ||
| } | ||
| // Specifies a clock event with an optional delay to wait after the | ||
| // event fires. | ||
|
|
||
| message Clock { | ||
| enum EventType { | ||
| HARDWARE = 0; | ||
| SOFTWARE = 1; | ||
| EITHER = 2; | ||
| } | ||
|
|
||
| message Periodic { | ||
| bool continuous = 1; | ||
| google.protobuf.Duration period = 2; | ||
| bool immediate = 3; | ||
| int32 event_number = 1; | ||
| EventType event_type = 2; | ||
|
Contributor
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. We should deprecate this. Can we mark it as deprecated? I think the default is good, which is good news!
Contributor
Author
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. What do you feel is deprecated?
Contributor
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. The |
||
| optional google.protobuf.Duration delay = 3; | ||
| } | ||
|
|
||
| message State { | ||
| string state_name = 1; | ||
| optional google.protobuf.Duration delay = 2; | ||
|
|
||
| oneof expression { | ||
| int32 equal = 3; | ||
| int32 not_equal = 4; | ||
| int32 less_than = 5; | ||
| int32 less_than_or_equal = 6; | ||
| int32 greater_than = 7; | ||
| int32 greater_than_or_equal = 8; | ||
| google.protobuf.Empty any_value = 9; | ||
| } | ||
| } | ||
|
|
||
| message ArmEvent { | ||
| oneof event { | ||
| google.protobuf.Empty never = 1; | ||
| google.protobuf.Empty immediate = 2; | ||
| Clock clock = 3; | ||
| State state = 4; | ||
| google.protobuf.Timestamp time = 5; | ||
| } | ||
| } | ||
|
|
||
| message State { | ||
| string state_name = 1; | ||
| optional google.protobuf.Duration delay = 2; | ||
|
|
||
| oneof expression { | ||
| int32 equal = 3; | ||
| int32 not_equal = 4; | ||
| int32 less_than = 5; | ||
| int32 less_than_or_equal = 6; | ||
| int32 greater_than = 7; | ||
| int32 greater_than_or_equal = 8; | ||
| google.protobuf.Empty any_value = 9; | ||
| } | ||
| message SampleEvent { | ||
| message Periodic { | ||
| google.protobuf.Duration period = 1; | ||
| bool immediate = 2; | ||
|
Contributor
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. I think
Contributor
Author
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. Maybe we could come up with a better name.
Contributor
Author
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.
Contributor
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. Yeah. I like
Contributor
Author
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. Or
Contributor
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. I don't think |
||
| } | ||
|
|
||
| oneof event { | ||
| google.protobuf.Empty immediate = 1; | ||
| Periodic periodic = 2; | ||
| Clock clock = 3; | ||
| State state = 4; | ||
| google.protobuf.Empty never = 5; | ||
| } | ||
| int32 count = 5; | ||
| } | ||
|
|
||
| message StopEvent { | ||
| oneof event { | ||
| google.protobuf.Empty never = 1; | ||
| google.protobuf.Duration delay = 2; | ||
| Clock clock = 3; | ||
| State state = 4; | ||
| google.protobuf.Timestamp time = 5; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
What I have implemented has slightly different syntax here. Instead of the fields:
arm,sample, andstop, I essentially use four fields;sample,arm,trigger, andstop(though I call them other names and I didn't implement them as a proto).The semantics I had in mind is that
sampleis what is continuously generating the data stream and the other fields act as a "valve" that controls if that data stream is emitted to the client.I think this allows for slightly more flexible acquisition triggering. For example, we could be sampling 1440Hz data and trigger on the first 1D after a 12 up until the extraction event by setting the fields like so:
sample: Periodic 1440Hz
arm: 0x12
trigger: 0x1D
stop: 0X1F
Or sampling 1440Hz ftp only on 1Ds that are accompanied by the HEP enable event 52 like so:
sample: 1440Hz
arm: 0x1D
trigger: 0x52
stop: 0x1F
Essentially, compared to this change, separating
sampleandtriggerallows for an additional clock condition (or other condition, like a state change) that needs to be cleared before sending data. However, one could imagine allowing for arbitrarily long sequences of clock events (or other conditions) that need to happen in a sequence before allowing data to be emitted, so having this additional condition might not really buy us much.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.
Does this request "feel" good to you?
I think this would require something like:
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.
I like it!
We may be able to complicate/enhance it further in order to support more complex trigger conditions. It doesn't guarantee all front-ends will be ale to support it. But DPM should be able to simulate to conditions that the FE can't. For instance, it could ask for 1440Hz data and do all the filtering itself based on monitoring the clock system.
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.
My understanding from @KitFieldhouse is that is what KitDPM does.
I think we should pull that into a service, but that's nitpicking.
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.
Speaking to "complex trigger conditions" I was considering posting this and decided not to. Does this align with what you were thinking?
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.
I guess I need to know how a "user trigger" works. Is it a hardware signal that a user can activate? Or a gRPC request? Setting a state device would be similar complexity as the latter.
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.
RE: your LLM examples. Those are fairly messy for a developer to use. But I would imagine that our libraries would provide a cleaner interface and would generate those messages.
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.
I had assumed the latter. @KitFieldhouse did you mean something different?
Uh oh!
There was an error while loading. Please reload this page.
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.
For this architecture yeah it would be a gRPC request.
The idea was that, when submitting a request with a user trigger, you would get some unique ID for that trigger that you could then use with another API endpoint to satisfy that trigger.
The implementation I had originally had in mind might not fit very well with the current and planned daq architecture, but the idea was for the API route that fires the user trigger to be a simple HTTP POST with an empty body and a query parameter equal to the "User Trigger ID". By sending that request the trigger is then satisfied. The idea is that this trigger then essentially has a unique URL that can then be used for firing that trigger, either through a browser or with a command line utility like curl.
For the gRPC architecture, maybe this would be a new API endpoint that takes a "User Trigger ID" and then fires that trigger on the DPMs or returns some sort of error if no user trigger matches that ID?
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.
I feel like this is slightly more formal than state events but does, essentially, the same thing. Except the DPMs already listen to state multicasts.