filecoin-project / oni

👹 (DEPRECATED; see README) Project Oni | Network Validation
https://docs.google.com/document/d/16jYL--EWYpJhxT9bakYq7ZBGLQ9SB940Wd1lTDOAbNE
7 stars 5 forks source link

Project Oni 👹


🌑 Deprecated


Our mandate is:

To verify the successful end-to-end outcome of the filecoin protocol and filecoin implementations, under a variety of real-world and simulated scenarios.

➡️ Find out more about our goals, requirements, execution plan, and team culture, in our Project Description.

Table of Contents

Testing topics

These are the topics we are currently centering our testing efforts on. Our testing efforts include fault induction, stress tests, and end-to-end testing.

Repository contents

This repository consists of test plans built to be run on Testground.

The source code for the various test cases can be found in the lotus-soup directory.

Running the test cases

If you are unfamiliar with Testground, we strongly suggest you read the Testground Getting Started guide in order to learn how to install Testground and how to use it.

You can find various composition files describing various test scenarios built as part of Project Oni at lotus-soup/_compositions directory.

We've designed the test cases so that you can run them via the local:exec, local:docker and the cluster:k8s runners. Note that Lotus miners are quite resource intensive, requiring gigabytes of memory. Hence you would have to run these test cases on a beafy machine (when using local:docker and local:exec), or on a Kubernetes cluster (when using cluster:k8s).

Here are the basics of how to run the baseline deals end-to-end test case:

Running the baseline deals end-to-end test case

  1. Compile and Install Testground from source code.

  2. Run a Testground daemon

testground daemon
  1. Download required Docker images for the lotus-soup test plan
make pull-images

Alternatively you can build them locally with

make build-images
  1. Import the lotus-soup test plan into your Testground home directory
testground plan import --from ./lotus-soup
  1. Init the filecoin-ffi Git submodule in the extra folder.
git submodule update --init --recursive
  1. Compile the filecoin-ffi version locally (necessary if you use local:exec)
cd extra/filecoin-ffi
make
  1. Run a composition for the baseline deals end-to-end test case
testground run composition -f ./lotus-soup/_compositions/baseline-docker-5-1.toml

Batch-running randomised test cases

The Oni testkit supports range parameters, which test cases can use to generate random values, either at the instance level (each instance computes a random value within range), or at the run level (one instance computes the values, and propagates them to all other instances via the sync service).

For example:

latency_range   = '["20ms", "500ms"]'
loss_range      = '[0, 0.2]'

Could pick a random latency between 20ms and 500ms, and a packet loss probability between 0 and 0.2. We could apply those values through the netclient.ConfigureNetwork Testground SDK API.

Randomized range-based parameters are specially interesting when combined with batch runs, as it enables Monte Carlo approaches to testing.

The Oni codebase includes a batch test run driver in package lotus-soup/runner. You can point it at a composition file that uses range parameters and tell it to run N iterations of the test:

$ go run ./runner -runs 5 _compositions/net-chaos/latency.toml

This will run the test as many times as instructed, and will place all outputs in a temporary directory. You can pass a concrete output directory with the -output flag.

Catalog

Test cases part of lotus-soup

Compositions part of lotus-soup

Debugging

Find commands and how-to guides on debugging test plans at DELVING.md

  1. Querying the Lotus RPC API

  2. Useful commands / checks

Dependencies

Our current test plan lotus-soup is building programatically the Lotus filecoin implementation and therefore requires all it's dependencies. The build process is slightly more complicated than a normal Go project, because we are binding a bit of Rust code. Lotus codebase is in Go, however its proofs and crypto libraries are in Rust (BLS signatures, SNARK verification, etc.).

Depending on the runner you want to use to run the test plan, these dependencies are included in the build process in a different way, which you should be aware of should you require to use the test plan with a newer version of Lotus:

Filecoin FFI libraries

The Rust libraries are included in the Filecoin FFI Git submodule, which is part of the iptestground/oni-buildbase image. If the FFI changes on Lotus, we have to rebuild this image with the make build-images command, where X is the next version (see Docker images changelog below).

The Rust libraries are included via the extra directory. Make sure that the test plan reference to Lotus in go.mod and the extra directory are pointing to the same commit of the FFI git submodule. You also need to compile the extra/filecoin-ffi libraries with make.

The same process as for local:docker, however you need to make sure that the respective iptestground/oni-buildbase image is available as a public Docker image, so that the Kubernetes cluster can download it.

proof parameters

Additional to the Filecoin FFI Git submodules, we are also bundling proof parameters in the iptestground/oni-runtime image. If these change, you will need to rebuild that image with make build-images command, where X is the next version.

Docker images changelog

oni-buildbase

oni-runtime

oni-runtime-debug

Team