-
Notifications
You must be signed in to change notification settings - Fork 247
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
Use component method calls for some of the envelope->weavelet calls. #686
Conversation
Previously, all envelope initiated communicaton to the weavelet was carried over a pair of pipes. This change switches some of that communication to be based on component method calls. In particular, the signal to start components is now carried by a method call (UpdateComponents) to a component hosted by the weavelet. Main changes ------------ 1. Introduce a controller component that is hosted by every remoteweavelet. 2. The envelope picks the name of a Unix domain socket and passes it to the weavelet it creates. 3. The envelope creates a stub pointing at this socket and makes calls to it to control the weavelet. (Currently only UpdateComponents is handled this way.) 4. remoteweavelet creates a controller implementation to handle method calls received over this Unix domain socket. Other changes ------------- 1. envelope.NewEnvelope() now takes an Options struct as an argument. This struct can contain an optional Logger and an optional Tracer. The supplied Logger and Tracer are used for calls made to the controller component. 2. envelope.NewEnvelope() creates a temporary directory and allocates a Unix domain socket inside the directory. It also arranges to remove the directory when cleaning up (by catching termination signals for examples). 3. The socket name is passed in the EnvelopeInfo proto sent to the weavelet. 4. RemoteWeavelet creates a controller component and listens for calls to it on the supplied socket. 5. Added deployers.NewUnixSocketPath(), which allocates a new socket name inside a supplied directory. 6. weavertest multi deployer manages its own socket creation when it bypasses envelope.NewEnvelope(). 7. website/blog/deployers/deployers_test.go kills child processes using SIGTERM instead of SIGKILL. This allows the child process a chance to clean up its temporary directories. 8. deployers_test.go logs the stderr and stdout lines it receives instead of dropping them on the floor. This can be very helpful when things aren't working as expected. 9. The deployer examples in the blog import the weaver package so they have access to the controller component registration.
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.
Awesome change, Sanjay! When I tried to imagine what it would like to transition from using the pipe to using component method calls, I didn't foresee the change being so elegant.
And very helpful CL description too, thanks! 🙏
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.
Thanks!
Previously, all envelope initiated communicaton to the weavelet was carried over a pair of pipes. This change switches some of that communication to be based on component method calls. In particular, the signal to start components is now carried by a method call (UpdateComponents) to a component hosted by the weavelet.
Main changes
Other changes