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

feature: Reference plugin JSON schemas #2035

Merged
merged 7 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: rr_json_schema_validation

on:
push:
branches:
- master
- stable
pull_request:

nickdnk marked this conversation as resolved.
Show resolved Hide resolved
jobs:
validate-json-schema:
name: Validate JSON Schema files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: "22"
nickdnk marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Test Script Dependencies
run: npm install
working-directory: ./schemas

- name: Run Script
run: node test.js
working-directory: ./schemas
nickdnk marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 0 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@ on:
pull_request:

jobs:
validate-config-file:
name: Validate config file
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: "14"

- name: Install linter
run: npm install -g ajv-cli # Package page: <https://www.npmjs.com/package/ajv-cli>

- name: Run linter
run: ajv validate --all-errors --verbose -s ./schemas/config/3.0.schema.json --spec=draft2019 -d ./.rr.yaml

golangci-lint:
name: Golang-CI (lint)
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ rr.exe
.vscode
.DS_Store
**/.DS_Store
**/node_modules
87 changes: 45 additions & 42 deletions .rr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ server:
# Username (not UID) of the user from whom the on_init command is executed. An empty value means to use the RR process user.
#
# Default: ""
user: ""
# user: ""

# Worker starting command, with any required arguments.
#
Expand All @@ -57,12 +57,12 @@ server:
# Username (not UID) for the worker processes. An empty value means to use the RR process user.
#
# Default: ""
user: ""
# user: ""

# Group name (not GID) for the worker processes. An empty value means to use the RR process group.
#
# Default: ""
group: ""
# group: ""

# Environment variables for the worker processes.
#
Expand Down Expand Up @@ -104,12 +104,12 @@ logs:
# Output can be file (eg.: "/var/log/rr_errors.log"), "stderr" or "stdout".
#
# Default: "stderr"
output: stderr
output: [ stderr ]
nickdnk marked this conversation as resolved.
Show resolved Hide resolved

# Errors only output can be file (eg.: "/var/log/rr_errors.log"), "stderr" or "stdout".
#
# Default: "stderr"
err_output: stderr
err_output: [ stderr ]

# File logger options
#
Expand Down Expand Up @@ -150,20 +150,20 @@ logs:
mode: development
level: panic
encoding: console
output: stdout
err_output: stderr
output: [ stdout ]
err_output: [ stderr ]
server:
mode: production
level: info
encoding: json
output: stdout
err_output: stdout
output: [ stdout ]
err_output: [ stdout ]
rpc:
mode: raw
level: debug
encoding: console
output: stderr
err_output: stdout
output: [ stderr ]
err_output: [ stdout ]

# Workflow and activity mesh service.
#
Expand Down Expand Up @@ -456,7 +456,7 @@ kv:
#
# Default: none
driver: memory
config: {}
config: { }

# Service plugin settings
service:
Expand Down Expand Up @@ -560,25 +560,25 @@ otel:
# https://github.com/open-telemetry/opentelemetry-specification/blob/v1.25.0/specification/resource/semantic_conventions/README.md
resource:

# User's service name
#
# Default: RoadRunner
service_name: "rr_test"
# User's service name
#
# Default: RoadRunner
service_name: "rr_test"

# User's service version
#
# Default: RoadRunner
service_version: "1.0.0"
# User's service version
#
# Default: RoadRunner
service_version: "1.0.0"

# User's service namespace
#
# Default: RoadRunner
service_namespace: "RR-Shop"
# User's service namespace
#
# Default: RoadRunner
service_namespace: "RR-Shop"

# User's service instance id
#
# Default: Generated UUID
service_instance_id: "UUID"
# User's service instance id
#
# Default: Generated UUID
service_instance_id: "UUID"
# Use insecure endpoint (http) or insecure gRPC
#
# Default: false
Expand All @@ -602,7 +602,7 @@ otel:
# Used for the http client to override the default URL
#
# Default: empty
custom_url: ""
# custom_url: ""

# Consumer's endpoint
#
Expand Down Expand Up @@ -976,15 +976,19 @@ metrics:

# Application-specific metrics (published using an RPC connection to the server).
collect:
app_metric:
type: histogram
help: "Custom application metric"
app_metric_summary:
type: summary
help: "Custom summary application metric"
labels: [ "type" ]
buckets: [ 0.1, 0.2, 0.3, 1.0 ]
# Objectives defines the quantile rank estimates with their respective absolute error (for summary only).
objectives:
- 1.4: 2.3
- 2.0: 1.4
0.1: 2.3
1.0: 1.4
app_metric_histogram:
type: histogram
help: "Custom histogram application metric"
labels: [ "type" ]
buckets: [ 0.1, 0.2, 0.3, 1.0 ]

# Health check endpoint (docs: https://roadrunner.dev/docs/app-server-health/2.x/en). If response code is 200 - it means at
# least one worker ready to serve requests. 500 - there are no workers ready to service requests.
Expand Down Expand Up @@ -1133,7 +1137,7 @@ kafka:
# Kafka brokers addresses
#
# Required to use Kafka driver
brokers: ["127.0.0.1:9092", "127.0.0.1:9002"]
brokers: [ "127.0.0.1:9092", "127.0.0.1:9002" ]

# SSL/TLS configuration
#
Expand Down Expand Up @@ -1951,18 +1955,17 @@ tcp:
# Default: CRLF (\r\n)
delimiter: "\r\n"

# Chunks that RR uses to read the data. In MB. If you expect big payloads on a TCP server, to reduce `read` syscalls, would be a good practice to use a fairly big enough buffer.
#
# Default: 1MB
read_buf_size: 1
server2:
addr: 127.0.0.1:8811
read_buf_size: 10
server3:
addr: 127.0.0.1:8812
delimiter: "\r\n"
read_buf_size: 1
# Chunks that RR uses to read the data. In MB. If you expect big payloads on a TCP server, to reduce `read` syscalls, would be a good practice to use a fairly big enough buffer.
#
# Default: 1MB
read_buf_size: 10

# The worker pool to use for the TCP service.
pool:
# Debug mode for the pool. In this mode, pool will not pre-allocate the worker. Worker (only 1, num_workers ignored) will be allocated right after the request arrived.
#
Expand Down
Loading
Loading