-
Notifications
You must be signed in to change notification settings - Fork 64
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
Better device proxy cache #4792
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4792 +/- ##
==========================================
- Coverage 78.64% 78.59% -0.05%
==========================================
Files 324 325 +1
Lines 15265 15296 +31
Branches 3507 3512 +5
==========================================
+ Hits 12005 12022 +17
- Misses 3260 3274 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pervious code had hard coded path on my machine, this moves it to under FLOWFORGE_HOME in `var/device/cache`
@Steve-Mcl the default path for a localfs test is And e.g. in Also needs the head of device agent to work |
Thanks Ben. First job for me this morning will be to pull and test this locally. |
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.
Ben, this review is next on my list but before I pull and test, can you update the date on the migration please - there have been other migrations since Nov 15th.
Thanks.
@Steve-Mcl done (this will probably break the pre-staging env) |
@ppawlowski is it possible to delete / refresh the pre-staging for this? @hardillb will this affect staging? |
@Steve-Mcl we have already deleted the pre-staging env, we did not recreate it. It can't be tested on pre-staging as there is no broker for the device comms needed to enable device editor mode. At the moment we are not deploying the @node-red/editor-client packages in the containers so this will run as "normal" and not use the cached copies. The update to the containers will get done later. |
…tting FS. wrap in try-catch
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.
As discussed in slack, I added the try-catch and fall through to original tunneling logic.
This works fantastically well Ben I gotta say, its like night & day!
For the record, I added temporary logging to ensure things were working as expected, here are the results:
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\red\style.min.css
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\vendor.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\red\red.min.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\monaco\dist\editor.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\red\style.min.css
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\vendor.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\red\red.min.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\monaco\dist\editor.js
[2024-12-18T12:20:59.777Z] INFO: Device 36LO0L3Odb tunnel id:1 - new editor connection req:54
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\mermaid\mermaid.min.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\monaco\dist\css.worker.js
Serving cached file: C:\Users\xxx\repos\github\flowfuse\dev-env\packages\flowfuse\var\device\cache\4.0.7\node_modules\@node-red\editor-client\public\vendor\monaco\dist\ts.worker.js
part of #3414
Description
Rather than requesting the 4 largest files from the device agent every time the device editor is loaded it will load them from a local instance on @node-red/editor-client of the matching version if present.
Still need to work out how to install the right versions of @node-red/editor
Related Issue(s)
#3414
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label