Skip to content
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

Refactor termination policy #442

Closed
4 of 6 tasks
Tracked by #422
mostafa opened this issue Feb 18, 2024 · 0 comments · Fixed by #458 or #451
Closed
4 of 6 tasks
Tracked by #422

Refactor termination policy #442

mostafa opened this issue Feb 18, 2024 · 0 comments · Fixed by #458 or #451
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mostafa
Copy link
Member

mostafa commented Feb 18, 2024

The current termination policy relies on the boolean terminate to be passed from the plugin to GatewayD, while the changes in #422 requires it to be sent to GatewayD as a signal (in the list of signals). Refactoring this involves changing all the plugins and docs.

  • GatewayD
  • Cache
  • JS?
  • enterprise plugins
  • plugin template?
  • Docs
@mostafa mostafa added the enhancement New feature or request label Feb 18, 2024
@mostafa mostafa added this to the v0.9.x milestone Feb 18, 2024
@mostafa mostafa self-assigned this Feb 18, 2024
@mostafa mostafa moved this from ✨ New to 📋 Backlog in GatewayD Core Public Roadmap Feb 18, 2024
@mostafa mostafa moved this from 📋 Backlog to 🚧 In progress in GatewayD Core Public Roadmap Feb 25, 2024
@mostafa mostafa mentioned this issue Feb 29, 2024
13 tasks
@mostafa mostafa linked a pull request Feb 29, 2024 that will close this issue
13 tasks
@mostafa mostafa mentioned this issue Mar 1, 2024
13 tasks
@mostafa mostafa moved this from 🚧 In progress to 👀 In review in GatewayD Core Public Roadmap Mar 1, 2024
mostafa added a commit that referenced this issue Mar 1, 2024
This giant PR adds the very first version of the Act system that was proposed in [this proposal](gatewayd-io/proposals#5). The old way of signaling was static and only supported a single signal: `terminate`. The new system support more signals, adds proper policies that can be easily controlled by the users and the actions are executed in sync and async mode.

The Act system consists of these components:
1. **Act Registry**: takes care of registering signals, policies and actions. It also applies policies to signals to produce outputs for actions and runs actions using those outputs.
2. **Signals**: plugins' hooks can return signal(s) as part of their request/response. These signals tell GatewayD what to do.
3. **Policies**: signals pass through predefined policies that will decide whether GatewayD should react to the signal or not.
4. **Actions**: actions run in sync or async mode and perform a function. Sync actions are used to control traffic (passthrough, terminate, etc.) and other parts of the system, and async actions can other things (log, publish a message to Kafka, etc.).
5. **Plugin Registry**: after running a hook on each plugin, the signals are extracted and the policies are applied to those signals. The output of those policy evaluations are returned to the caller, which knows how to run action and use its results.

And the code spans over two projects:
1. **GatewayD**: all the above components of the Act system are in GatewayD.
2. **SDK**: types and helper functions for creating and exporting signals are in the SDK.

### Breaking changes 
The old way of terminating requests don't work anymore, as it was refactored in #442 and all the plugins are updated to pick up the changes.
@mostafa mostafa linked a pull request Mar 1, 2024 that will close this issue
13 tasks
@mostafa mostafa moved this from 👀 In review to 🔀 Merged in GatewayD Core Public Roadmap Mar 1, 2024
@mostafa mostafa closed this as completed Mar 1, 2024
@mostafa mostafa moved this from 🔀 Merged to 🎉 Done in GatewayD Core Public Roadmap Mar 4, 2024
smnmna99 pushed a commit that referenced this issue Mar 13, 2024
This giant PR adds the very first version of the Act system that was proposed in [this proposal](gatewayd-io/proposals#5). The old way of signaling was static and only supported a single signal: `terminate`. The new system support more signals, adds proper policies that can be easily controlled by the users and the actions are executed in sync and async mode.

The Act system consists of these components:
1. **Act Registry**: takes care of registering signals, policies and actions. It also applies policies to signals to produce outputs for actions and runs actions using those outputs.
2. **Signals**: plugins' hooks can return signal(s) as part of their request/response. These signals tell GatewayD what to do.
3. **Policies**: signals pass through predefined policies that will decide whether GatewayD should react to the signal or not.
4. **Actions**: actions run in sync or async mode and perform a function. Sync actions are used to control traffic (passthrough, terminate, etc.) and other parts of the system, and async actions can other things (log, publish a message to Kafka, etc.).
5. **Plugin Registry**: after running a hook on each plugin, the signals are extracted and the policies are applied to those signals. The output of those policy evaluations are returned to the caller, which knows how to run action and use its results.

And the code spans over two projects:
1. **GatewayD**: all the above components of the Act system are in GatewayD.
2. **SDK**: types and helper functions for creating and exporting signals are in the SDK.

### Breaking changes 
The old way of terminating requests don't work anymore, as it was refactored in #442 and all the plugins are updated to pick up the changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant