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

chore: update docs to include simulation specs #187

Merged
Changes from all commits
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
90 changes: 90 additions & 0 deletions keramik/src/simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ To run a simulation, first define a simulation. Available simulation types are
- `ceramic-new-streams` - A simulation that only creates new streams
- `ceramic-model-reuse` - A simulation that reuses the same model and queries instances across workers
- `recon-event-sync` - A simulation that creates events for Recon to sync at a fixed rate (~300/s by default). Designed for a 2 node network but should work on any.
- `cas-benchmark` - A simulation that benchmarks the CAS network.
- `cas-anchoring-benchmark` - A simulation that benchmarks the Ceramic with anchoring enabled.

Using one of these scenarios, we can then define the configuration for that scenario:

Expand Down Expand Up @@ -124,3 +126,91 @@ spec:
kubectl apply -f custom-ipfs.yaml
```

### Example Custom CAS Api Url Network Spec

Use this example in the network definition while using `cas-benchmark` or `cas-anchoring-benchmark`. This is specifically for testing against the CAS dev network.

```yaml
# custom-cas-api.yaml
---
apiVersion: keramik.3box.io/v1alpha1
kind: Network
metadata:
name: ceramic-benchmark
spec:
ceramic:
- env:
CERAMIC_RECON_MODE: "true"
ipfs:
rust:
env:
CERAMIC_ONE_RECON: "true"
casApiUrl: https://cas-dev-direct.3boxlabs.com
networkType: dev-unstable
privateKeySecret: ceramic-v4-dev
ethRpcUrl: ""
```

```shell
kubectl apply -f custom-cas-api.yaml
```

### Example Custom Simulation for Ceramic Anchoring Benchmark

Use this example to run a simulation which uses the CAS Api defined in the network spec.
`anchorWaitTime`: Wait time in seconds for how long we want to wait after streams have been created to check when they have been anchored. This should be a high number like 30-40 minutes.
`throttleRequests`: Number of requests to send per second.

```yaml
# ceramic-anchoring-benchamrk.yaml
---
apiVersion: "keramik.3box.io/v1alpha1"
kind: Simulation
metadata:
name: basic
# Must be the same namespace as the network to test
namespace: keramik-ceramic-benchmark
spec:
scenario: ceramic-anchoring-benchmark
users: 16
runTime: 60
throttleRequests: 100
anchorWaitTime: 2400
```


```shell
kubectl apply -f ceramic-anchoring-benchamrk.yaml
```

### Example Custom Simulation for cas-benchmark

Use this example to run a simulation you can pass in the the cas-api-url, the network-type, and the private secret key in the spec.
By default the casNetwork and casController are set to run against cas-dev-direct Api.

`casNetwork`: The url of the CAS network to run the simulation against.

`casController`: The private key of the controller DID to use for the simulation.

```yaml
# cas-benchmark.yaml
---
apiVersion: "keramik.3box.io/v1alpha1"
kind: Simulation
metadata:
name: basic
# Must be the same namespace as the network to test
namespace: keramik-ceramic-benchmark
spec:
scenario: ceramic-anchoring-benchmark
users: 16
runTime: 60
throttleRequests: 100
casNetwork: "https://cas-dev-direct.3boxlabs.com"
casController: "did:key:<secret>"
```

```shell
kubectl apply -f cas-benchmark.yaml
```

Loading