-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add MessageUpgrader to validator #286
Conversation
The validator doesn't appear to be process state messages with this change - when a state message is published, nothing appears in the command line output or output directory. I have compared against the current master (checksum |
Did you update your cloud functions? There's been a bunch of changes there
that need to go along with this. Do I have access to the project? What is
it? Would just make it easier for me to poke at it!
…On Sun, Apr 3, 2022 at 4:15 PM Noureddine ***@***.***> wrote:
The validator doesn't appear to be process state messages with this change
- when a state message is published, nothing appears in the command line
output or output directory.
I have compared against the current master (checksum
29530a7) and this does process state
messages, so my message flow seems to be working. In both cases I was
manually triggering state messages from an older instance of pubber so I'm
certain there were state messages being sent
—
Reply to this email directly, view it on GitHub
<#286 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIEPDY5H74ZZOIJJQLCH6LVDIQ7LANCNFSM5SJDQ5ZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I did deploy the cloud functions - I had to manually add the GCP project ID as an environment variable in the You have access to my GCP project. You run the validator with the following command I have configured a script to publish a static state payload every minute under device AHU-9 (you do have access to my site model but the payload I'm publishing doesn't match up with the site model) |
Ok, I can reproduce the problem... I think I was just so focused on the
config and event messages that status kinda for lost :-).
…On Mon, Apr 4, 2022 at 3:35 AM Noureddine ***@***.***> wrote:
I did deploy the cloud functions
<https://console.cloud.google.com/functions/list?project=daq1-273309> - I
had to manually add the GCP project ID as an environmental variable in the
dashboard_deploy_gcloud script as it was coming up undefined (same issue
as Francesco)
You have access to my GCP project. You run the validator with the
following command
bin/validator <any site model> daq1-273309 udmi_target
I have configured a script to publish a static state payload every minute
under device AHU-9
<https://console.cloud.google.com/iot/locations/us-central1/registries/registrar_test/devices/details/AHU-9/history?project=daq1-273309>
(you do have access to my site model
<https://github.com/noursaidi/nes-site-model> but the payload I'm
publishing doesn't match up with the site model)
—
Reply to this email directly, view it on GitHub
<#286 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIEPD7MZQWW6PPGGWIR43TVDLAXDANCNFSM5SJDQ5ZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ok, fixed. It was an update to the cloud functions that was required -- so
the daq1 project is updated and working now (at least I tested against it).
Also, I noticed that you had tried to set a UDMI_GCP_PROJECT env
variable... but that wouldn't work, it would need to be GCP_PROJECT. I did
update the gcloud deploy command to automatically set the GCP_PROJECT
variable appropriately. GCP changed some things about their default env
variables with the node runtime so it was confusing a few things.
…On Mon, Apr 4, 2022 at 8:23 AM Trevor Pering ***@***.***> wrote:
Ok, I can reproduce the problem... I think I was just so focused on the
config and event messages that status kinda for lost :-).
On Mon, Apr 4, 2022 at 3:35 AM Noureddine ***@***.***>
wrote:
> I did deploy the cloud functions
> <https://console.cloud.google.com/functions/list?project=daq1-273309> -
> I had to manually add the GCP project ID as an environmental variable in
> the dashboard_deploy_gcloud script as it was coming up undefined (same
> issue as Francesco)
>
> You have access to my GCP project. You run the validator with the
> following command
> bin/validator <any site model> daq1-273309 udmi_target
>
> I have configured a script to publish a static state payload every minute
> under device AHU-9
> <https://console.cloud.google.com/iot/locations/us-central1/registries/registrar_test/devices/details/AHU-9/history?project=daq1-273309>
> (you do have access to my site model
> <https://github.com/noursaidi/nes-site-model> but the payload I'm
> publishing doesn't match up with the site model)
>
> —
> Reply to this email directly, view it on GitHub
> <#286 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAIEPD7MZQWW6PPGGWIR43TVDLAXDANCNFSM5SJDQ5ZQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
I did add Though for this, It is now processing state messages and old payloads aren't triggering an error - but behaviour has changed. There used to be separate |
Expected... kinda? I wasn't going into the changes with a specific target
in mind, but more of a "trying to make it logically consistent." Right now
it's validating the entire "state.json" message, which is why there is one
"state.out" file -- it's not individually validating the sub-blocks
(state_pointset.json) -- the sequence tester does that (well, and records
both), but it's operating in a different way.
This PR was primarily about adding the MessageUpgrader to the validator, so
it didn't try to validate against metadata -- that would be something else.
…On Mon, Apr 4, 2022 at 9:59 AM Noureddine ***@***.***> wrote:
I did add const PROJECT_ID = process.env.UDMI_GCP_PROJECT in the cloud
function, I was testing something with Firebase deploy which is also not
working for me.
Though for this, FIREBASE_CONFIG is set and within this there is a field
projectId with the project ID which can be used in place of
process.env.GCLOUD_PROJECT for this deploy method
It is now processing state messages and old payloads aren't triggering an
error - but behaviour has changed. There used to be separate
state_pointset.out and state_system.out etc, but now there's a single
state.out - was this expected? It's also still not validating (against
metadata) the points in pointset (issue #193
<#193>)
—
Reply to this email directly, view it on GitHub
<#286 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIEPD72YKRNT3K7ECDPKN3VDMNWDANCNFSM5SJDQ5ZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Note that one change that IS for sure expected is the location of the
output files. They used to be rooted in the udmi/out/ directory, but now
they should appear in the {site_model}/out/ directory -- moving towards the
general expectation that the udmi directory would be "system level" so all
site-specific things would be kept differently. Validator and sequencer
should work this way now, but I think pubber is till in the old model.
On Mon, Apr 4, 2022 at 10:38 AM Trevor Pering ***@***.***>
wrote:
… Expected... kinda? I wasn't going into the changes with a specific
target in mind, but more of a "trying to make it logically consistent."
Right now it's validating the entire "state.json" message, which is why
there is one "state.out" file -- it's not individually validating the
sub-blocks (state_pointset.json) -- the sequence tester does that (well,
and records both), but it's operating in a different way.
This PR was primarily about adding the MessageUpgrader to the validator,
so it didn't try to validate against metadata -- that would be something
else.
On Mon, Apr 4, 2022 at 9:59 AM Noureddine ***@***.***>
wrote:
> I did add const PROJECT_ID = process.env.UDMI_GCP_PROJECT in the cloud
> function, I was testing something with Firebase deploy which is also not
> working for me.
>
> Though for this, FIREBASE_CONFIG is set and within this there is a field
> projectId with the project ID which can be used in place of
> process.env.GCLOUD_PROJECT for this deploy method
>
> It is now processing state messages and old payloads aren't triggering an
> error - but behaviour has changed. There used to be separate
> state_pointset.out and state_system.out etc, but now there's a single
> state.out - was this expected? It's also still not validating (against
> metadata) the points in pointset (issue #193
> <#193>)
>
> —
> Reply to this email directly, view it on GitHub
> <#286 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAIEPD72YKRNT3K7ECDPKN3VDMNWDANCNFSM5SJDQ5ZQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
@@ -379,7 +379,6 @@ private synchronized void cancelExecutor() { | |||
if (scheduledFuture != null) { | |||
try { | |||
scheduledFuture.cancel(false); | |||
scheduledFuture.get(); |
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.
Was this creating problems or is it just cleanup to not wait? Sometimes these small changes are tricky to gauge.
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.
It actually causes problems -- once the Future is cancelled (previous line) the get() fails... Just never noticed it until I started to trace down errors...
@@ -473,7 +484,7 @@ private File makeDeviceDir(String deviceId) { | |||
return deviceDir; | |||
} | |||
|
|||
private String makeSchemaName(Map<String, String> attributes) { | |||
private String mungeAndExtractSchema(Map<String, String> attributes) { |
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.
It isn't immediately obvious why we are crossing subFolder and subType values.
Can we either make it more clear with comments, or, reference the doc? envelope.md doesn't explain it ... ?
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.
Ok, you shamed me into fixing the underlying confusion, so the crossing the values is no longer required. It did involve some additional changes, but it's now a lot cleaner overall, I think.
I'm submitting this now even though there might be further tweaks necessary, since it at least cleans up a bunch of underlying issues that might be impacting other threads. If there's any additional comments/changes, just post them and I can address in another PR. |
No description provided.