Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jimil749/reva-plugin-benchmark

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jimil749/reva-plugin-benchmark

  • v0.0.0-20210620084549-e82888c9efbf
  • Source
  • Go
  • Socket score

Version published
Created
Source

Reva Plugin Benchmarking

A comparison of plugin implementations for Golang. The reason for this is to evaluate plugin options for Reva, which is an interoperability platform, connecting storage, sync and share platforms and application providers. This benchmarking will give a good idea about viability of each plugin framework and its performance.

The following packages have been (ongoing) benchmarked:

Plugin

The "core" program exposes the following interface (defined in pkg/shared/interface.go) for the plugin system which uses RPC/gRPC(hashicorp and pie plugin systems) to implement:

type Manager interface {
	OnLoad(userFile string) error
	GetUser(*userpb.UserId) (*userpb.User, error)
	GetUserByClaim(claim, value string) (*userpb.User, error)
	GetUserGroups(*userpb.UserId) ([]string, error)
	FindUsers(query string) ([]*userpb.User, error)
}

This interface has an extra OnLoad method which is responsible for initializing the interface implementation, so that it can be used for further calls.

The responsibility of the plugin is to implement the above interface and make the implementation available to the main program. The framework used for communication b/w the host ("core") and the plugin is being benchmarked.

For plugin system, not using rpc, following interface will suffice:

type Manager interface {
	GetUser(*userpb.UserId) (*userpb.User, error)
	GetUserByClaim(claim, value string) (*userpb.User, error)
	GetUserGroups(*userpb.UserId) ([]string, error)
	FindUsers(query string) ([]*userpb.User, error)
}

Benchmarks

For the purpose of benchmarking, this project uses the existing reva plugin driver. Details about each plugin package and the corresponding benchmarks can be found in the respective directories, which can be accessed from the directory structure below.

File Directory Structure

Running locally

In order to run the benchmarks locally, follow:

  1. Clone this repository
git clone https://github.com/jimil749/reva-plugin-benchmark.git
cd reva-plugin-benchmark
  1. Run run.sh
./run.sh

That's it!

OR, if you want, you can(after cloning this repo):

  1. Build the plugin files
$ go build -o hashicorp-plugin ./pkg/plugins/hashicorp/netrpc
$ go build -o hashicorp-plugin-grpc ./pkg/plugins/hashicorp/grpc
$ go build -o buildmode=plugin -o go-plugin.so ./pkg/plugins/go-native/
$ go build -o pieplugin ./pkg/plugins/pie/
  1. Run the benchmarks
go test -bench=.

Backlog (TODO)

  1. Yaegi with Protobufs (See: https://github.com/traefik/yaegi/issues/1133)
  2. Hashicorp/Pie: Passing configurations to plugins without the use of OnLoad method [Is there a way around this??!!]
  3. Pie: Figure a way to check whether the plugin methods implements the exposed interface
  4. Hashicorp: Modify plugin methods like pie plugin. (rpc methods args and resp)

FAQs

Package last updated on 20 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc