@rulebricks/cli 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/benchmarks/README.md +98 -0
  3. package/benchmarks/Test Flow.rbf +4088 -0
  4. package/benchmarks/benchmark-flow.json +26 -0
  5. package/benchmarks/lib/payload.js +101 -0
  6. package/benchmarks/lib/report.js +929 -0
  7. package/benchmarks/qps-test.js +136 -0
  8. package/benchmarks/run-qps-test.sh +115 -0
  9. package/benchmarks/run-throughput-test.sh +123 -0
  10. package/benchmarks/throughput-report.html +632 -0
  11. package/benchmarks/throughput-results.json +298 -0
  12. package/benchmarks/throughput-test.js +159 -0
  13. package/dist/commands/benchmark.d.ts +11 -0
  14. package/dist/commands/benchmark.js +173 -0
  15. package/dist/commands/deploy.js +15 -4
  16. package/dist/commands/destroy.js +2 -2
  17. package/dist/commands/logs.js +1 -0
  18. package/dist/components/Wizard/steps/BenchmarkSteps.d.ts +31 -0
  19. package/dist/components/Wizard/steps/BenchmarkSteps.js +304 -0
  20. package/dist/components/Wizard/steps/DatabaseStep.js +49 -35
  21. package/dist/index.js +42 -6
  22. package/dist/lib/benchmark.d.ts +63 -0
  23. package/dist/lib/benchmark.js +466 -0
  24. package/dist/lib/dns.d.ts +3 -1
  25. package/dist/lib/dns.js +138 -56
  26. package/dist/lib/helm.d.ts +14 -1
  27. package/dist/lib/helm.js +36 -1
  28. package/dist/lib/kubernetes.js +2 -0
  29. package/dist/types/index.d.ts +90 -0
  30. package/dist/types/index.js +51 -0
  31. package/package.json +8 -6
  32. package/terraform/aws/main.tf +22 -0
  33. package/terraform/azure/main.tf +45 -0
  34. package/terraform/gcp/main.tf +34 -0
  35. /package/{email-templates → templates}/email_change.html +0 -0
  36. /package/{email-templates → templates}/invite.html +0 -0
  37. /package/{email-templates → templates}/password_change.html +0 -0
  38. /package/{email-templates → templates}/verify.html +0 -0
package/README.md CHANGED
@@ -45,7 +45,7 @@ rulebricks init
45
45
  rulebricks deploy my-deployment
46
46
  ```
47
47
 
48
- ## Commands
48
+ ## Main Commands
49
49
 
50
50
  | Command | Description |
51
51
  | --------------------------- | -------------------------------------- |
@@ -57,10 +57,10 @@ rulebricks deploy my-deployment
57
57
  | `rulebricks logs [name]` | Inspect services |
58
58
  | `rulebricks open [name]` | Open the generated configuration files |
59
59
 
60
- Add `-h` to any command to learn more about its options.
60
+ Use `rulebricks -h` to explore all commands, and add `-h` to any command to learn more about a particular command's options.
61
61
 
62
62
  ## Notes
63
63
 
64
64
  There are a uniquely wide variety of customization options this CLI makes available (multi-cloud, hybrid vs. self-hosted database deployment, custom email templates, etc.), and not all combinations have been validated.
65
65
 
66
- If you encounter any issue deploying your private Rulebricks cluster, please [email us](mailto:support@rulebricks.com) or [open an issue](https://github.com/rulebricks/cli/issues) and we will follow up promptly.
66
+ If you encounter any issue deploying your private Rulebricks cluster, please [email us](mailto:support@rulebricks.com) or [open an issue](https://github.com/rulebricks/cli/issues) and we will follow up promptly. If you are particularly familiar with helm/k8s, you are also free to review generated values.yaml files and reconcile them with our [Helm chart](https://github.com/rulebricks/helm).
@@ -0,0 +1,98 @@
1
+ ## Rulebricks Benchmarking Toolkit
2
+
3
+ A simple benchmarking suite for testing your Rulebricks deployment performance.
4
+
5
+ | Test | Purpose | Measures |
6
+ | ------------------- | ------------------ | ----------------------------------------- |
7
+ | **QPS Test** | API responsiveness | Requests per second (individual payloads) |
8
+ | **Throughput Test** | Engine capacity | Solutions per second (bulk processing) |
9
+
10
+ ### Prerequisites
11
+
12
+ - [k6](https://k6.io/docs/get-started/installation/) load testing tool installed
13
+ - A deployed Rulebricks instance
14
+ - The benchmark flow imported into your instance
15
+ - An API key with access to the benchmark flow
16
+
17
+ ### Quick Start
18
+
19
+ #### 1. Import the Benchmark Flow
20
+
21
+ Import the `Test Flow.rbf` file into your Rulebricks instance:
22
+
23
+ 1. Log into your Rulebricks dashboard
24
+ 2. Navigate to **Flows** → **Import**
25
+ 3. Upload the test flow file, click into the flow and ensure it is published
26
+ 4. Note the published flow API URL (e.g., `https://your-instance.com/api/v1/flows/YOUR_FLOW_ID`)
27
+
28
+ #### 2. Get Your API Key
29
+
30
+ 1. Navigate to the **API** tab on your Rulebricks dashboard
31
+ 2. Copy the API Key
32
+
33
+ #### 3. Run the Tests
34
+
35
+ ```bash
36
+ # QPS Test
37
+ ./run-qps-test.sh -u https://your-instance.com/api/v1/flows/YOUR_FLOW_ID -k your-api-key
38
+
39
+ # Throughput Test
40
+ ./run-throughput-test.sh -u https://your-instance.com/api/v1/flows/YOUR_FLOW_ID -k your-api-key
41
+ ```
42
+
43
+ ### Configuration
44
+
45
+ All configuration is done via environment variables passed to k6:
46
+
47
+ #### Required Variables
48
+
49
+ | Variable | Description |
50
+ | --------- | -------------------------------------------------------------------------------------- |
51
+ | `API_URL` | Full URL to your flow endpoint (e.g., `https://rb.example.com/api/v1/flows/ds_abc123`) |
52
+ | `API_KEY` | Your Rulebricks API key |
53
+
54
+ #### Optional Variables
55
+
56
+ | Variable | Default | Description |
57
+ | --------------- | -------------------------------- | ------------------------------------------------ |
58
+ | `TEST_DURATION` | `4m` | Measurement duration (after 1m warm-up) |
59
+ | `TARGET_RPS` | `500` (QPS) / `100` (Throughput) | Target requests per second |
60
+ | `BULK_SIZE` | `50` | Payloads per bulk request (throughput test only) |
61
+
62
+ ### Test Structure
63
+
64
+ Each test consists of two phases:
65
+
66
+ 1. **Warm-up Phase (1 minute)**: Allows the cluster to scale up and stabilize. Results from this phase are excluded from the final metrics.
67
+ 2. **Measurement Phase (4 minutes by default)**: Steady-state performance measurement. Only this phase contributes to the reported metrics.
68
+
69
+ Total test time = 1m warm-up + `TEST_DURATION`
70
+
71
+ ### Understanding the Tests
72
+
73
+ #### QPS Test (`qps-test.js`)
74
+
75
+ Measures how many **individual requests** your deployment can handle per second. Useful for understanding API gateway performance, connection handling capacity, and latency under load.
76
+
77
+ Sends single-payload requests at a constant rate and measures response times and success rates.
78
+
79
+ #### Throughput Test (`throughput-test.js`)
80
+
81
+ Measures how many **rule evaluations (solutions)** your deployment can process per second. Useful for understanding rule engine processing capacity and bulk API performance.
82
+
83
+ Sends bulk requests (arrays of payloads) at a constant rate. Each request contains multiple payloads that are processed together.
84
+
85
+ ```
86
+ Solutions/second = Successful Requests × Bulk Size / Test Duration
87
+ ```
88
+
89
+ ---
90
+
91
+ ### Note on Autoscaling
92
+
93
+ The 1-minute warm-up phase helps clusters with autoscaling (HPA) scale up before measurement begins. However, if you still see inconsistent results, you may want to:
94
+
95
+ 1. **Set fixed replica counts** temporarily by adjusting `hps.minReplicas` and `hps.maxReplicas` in your Helm values to the same value
96
+ 2. **Increase test duration** with `-d 10m` for longer measurement after warm-up
97
+
98
+ Refer to the Helm chart documentation for tuning autoscaling behavior.