3 ms·
We use Jsonnet extensively in Aperture project for generating control policies. - Policy spec is expressed in protobuf format - GRPC gateway plugin is used to
by gillh 4y ago
We use Jsonnet extensively in Aperture project for generating control policies.
- Policy spec is expressed in protobuf format
- GRPC gateway plugin is used to generate Swagger (OpenAPI v2) spec from proto files
- Jsonnet bindings are generated from Swagger spec.
- Blueprints are implemented using Jsonnet bindings. The users generate policies from blueprints by providing configuration in yaml (using aperturectl CLI) or via jsonnet mixin.
Relevant links:
- Aperture Blueprints (Jsonnet): https://github.com/fluxninja/aperture/tree/main/blueprints https://github.com/fluxninja/aperture/tree/main/blueprints
- Generated doc example: https://docs.fluxninja.com/development/reference/policies/bundled-blueprints/policies/latency-aimd-concurrency-limiting https://docs.fluxninja.com/development/reference/policies/bu...
- CLI for generating policies from blueprints: https://docs.fluxninja.com/development/reference/aperturectl/blueprints/ https://docs.fluxninja.com/development/reference/aperturectl...
- Policy spec: https://docs.fluxninja.com/development/reference/policies/spec https://docs.fluxninja.com/development/reference/policies/sp...
- Duologic 4y agoI'm interested in the code that processes the swagger/openapi into jsonnet, can you link to that?
- gillh 4y agoIt’s customized to our policy spec. But you can learn from this and adapt it to your spec. https://github.com/fluxninja/aperture/blob/main/scripts/jsonnet-lib-gen.py https://github.com/fluxninja/aperture/blob/main/scripts/json...