-
Notifications
You must be signed in to change notification settings - Fork 33
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
Anycable #1859
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1859 +/- ##
==========================================
- Coverage 79.56% 79.55% -0.02%
==========================================
Files 517 519 +2
Lines 40739 40763 +24
==========================================
+ Hits 32414 32428 +14
- Misses 8325 8335 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -41,7 +41,7 @@ def stop | |||
if running_script | |||
target_name = running_script['name'].split('/')[0] | |||
return unless authorization('script_run', target_name: target_name) | |||
ActionCable.server.broadcast("cmd-running-script-channel:#{params[:id]}", "stop") | |||
running_script_publish("cmd-running-script-channel:#{params[:id]}", "stop") |
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.
Where is running_script_publish
defined? I only see running_script_anycable_publish
@@ -38,6 +38,17 @@ | |||
SCRIPT_API = 'script-api' | |||
RUNNING_SCRIPTS = 'running-scripts' | |||
|
|||
def running_script_publish(channel_name, data) |
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.
Running script publish is here
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.
Why isn't it all anycable?
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.
The anycable stream is for broadcasting out to clients.
We also use pub/sub for communicating with running scripts and that one isn't "anycable"
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.
So the anycable-go-linux
files allow it to run directly in the container. These are precompiled? Where did you get these and how do we update them?
running = Store.smembers("running-scripts") | ||
if running is None: | ||
running = [] | ||
running_script_anycable_publish( |
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.
wrong indentation
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 don't think so.
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 don't see any problem here.
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.
Sorry you're right ... it just looked weird to me
@@ -38,6 +38,17 @@ | |||
SCRIPT_API = 'script-api' | |||
RUNNING_SCRIPTS = 'running-scripts' | |||
|
|||
def running_script_publish(channel_name, data) |
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.
Why isn't it all anycable?
@@ -1,5 +1,5 @@ | |||
user healthcheck on nopass -@all +cluster|info +ping | |||
user openc3 on #022bd57403439b2a3ec0c081cdd35d40a199bbd4ee6fc0e5113edd4fe1c10071 allkeys allchannels -@all +@read +@write +@pubsub +@connection +@transaction +info | |||
user scriptrunner on #e808c74e210256ee7cf3ec165271544167de776d526f7fa94243e5cdcc08b0c1 resetkeys resetchannels ~running-script* ~*script-locks ~*script-breakpoints ~*openc3_log_messages &_action_cable_internal &script-api:* -@all +@read +@write +@pubsub +@hash +@connection | |||
user scriptrunner on #e808c74e210256ee7cf3ec165271544167de776d526f7fa94243e5cdcc08b0c1 resetkeys resetchannels ~running-script* ~*script-locks ~*script-breakpoints ~*openc3_log_messages &__anycable__ &_action_cable_internal &script-api:* -@all +@read +@write +@pubsub +@hash +@connection |
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.
Will have to make sure to get this change in the project files
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.
Sync should update them.
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.
Sync will update this.
@@ -73,6 +78,11 @@ RUN apk update \ | |||
yaml-dev \ | |||
&& gem update --system 3.3.14 \ | |||
&& gem install rake \ | |||
# These need to be installed with the --platform flag to avoid errors on linux-musl | |||
# See: https://github.com/protocolbuffers/protobuf/issues/16853#issuecomment-2583135716 | |||
# Should be fixed April 2025 |
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.
There's a chance this gets fixed earlier judging by the comments but I wouldn't hold my breath
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.
Its affecting everyone on alpine so I hope they fix it.
rule: PathPrefix(`/openc3-api/cable`) | ||
service: service-api-cable | ||
priority: 10 | ||
# Route to the openc3 cmd/tlm api websockets |
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.
wrong comment, should be script api websockets
openc3-traefik/traefik.yaml
Outdated
rule: PathPrefix(`/openc3-api/cable`) | ||
service: service-api-cable | ||
priority: 10 | ||
# Route to the openc3 cmd/tlm api websockets |
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.
comment
I'm currently compiling the anycable-go binaries from source to fix the go CVEs. Hopefully we can find a better way of installing in the future. |
Quality Gate passedIssues Measures |
Replaces ActionCable with Anycable
Anycable requires adding two new processes to each of our API containers.
Anycable-go is the websocket server and what initially accepts connections. It also listens for broadcasts on both the redis pub/sub stream anycable and on an http interface at port 8090.
There is also a Ruby RPC server that receives the ActionCable actions and handles the ruby part of our code. This is very similar to our original ActionCable code but did require a few tweaks to be anycable compatible. Most notably it does not support @instance variables because Channel objects are not long lived. This required switching to using class variables.
closes #1826