Skip to content

Commit

Permalink
Merge pull request #49 from berty/dsbench
Browse files Browse the repository at this point in the history
feat: implement basic datastore benchmark
  • Loading branch information
n0izn0iz authored Feb 9, 2022
2 parents 9ad4a83 + baa754c commit 1130845
Show file tree
Hide file tree
Showing 48 changed files with 3,594 additions and 1,506 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
- name: Lint
run: buf lint api

- name: Setup protoc
uses: arduino/[email protected]
with:
version: "3.x"

- name: Regenerate
run: make regen

Expand Down
28 changes: 25 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
all:
@echo You probably want to cd rn
.PHONY: all

clean.gen:
rm -fr \
go/pkg/ipfsman/ipfsman_grpc.pb.go go/pkg/ipfsman/ipfsman.pb.go rn/src/api/ipfsman \
go/pkg/blmod/blmod_grpc.pb.go go/pkg/blmod/blmod.pb.go rn/src/api/blmod
for api in $$(ls api); do rm -fr \
go/pkg/$${api}/$${api}_grpc.pb.go \
go/pkg/$${api}/ipfsman.pb.go \
rn/src/api/$${api} \
; done
rm -f rn/src/api/index.ts
.PHONY: clean-gen

generate:
$(MAKE) -C rn node_modules/.mkt
buf generate api
set -e; for api in $$(ls api); do \
echo '/* eslint-disable no-dupe-class-members */' > rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
cat rn/src/api/$${api}/v1/$${api}_pb_service.d.ts >> rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts; \
mv rn/src/api/$${api}/v1/$${api}_pb_service.new.d.ts rn/src/api/$${api}/v1/$${api}_pb_service.d.ts; \
\
echo '/* eslint-disable eslint-comments/no-unlimited-disable */' > rn/src/api/$${api}/v1/$${api}_pb.new.js; \
cat rn/src/api/$${api}/v1/$${api}_pb.js >> rn/src/api/$${api}/v1/$${api}_pb.new.js; \
mv rn/src/api/$${api}/v1/$${api}_pb.new.js rn/src/api/$${api}/v1/$${api}_pb.js; \
\
echo "export * from './$${api}_pb'" > rn/src/api/$${api}/v1/index.ts; \
echo "export * from './$${api}_pb_service'" >> rn/src/api/$${api}/v1/index.ts; \
\
echo "export * as $${api} from './$${api}/v1'" >> rn/src/api/index.ts; \
done
$(MAKE) -C rn lint.fix
.PHONY: generate

regen: clean.gen
Expand Down
11 changes: 3 additions & 8 deletions api/blmod/v1/blmod.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ message ModuleInfo {

service LabsModulesService {
rpc AllModules(AllModulesRequest) returns (AllModulesResponse) {}
rpc RunModule(RunModuleRequest) returns (RunModuleResponse) {}
rpc RunModule(RunModuleRequest) returns (stream RunModuleResponse) {}
}


Expand All @@ -34,14 +34,9 @@ message AllModulesResponse {

message RunModuleRequest {
string name = 1;
bytes args = 2;
}

message RunModuleResponse {
enum ReportKind {
REPORT_KIND_UNSPECIFIED = 0;
REPORT_KIND_UTF = 1;
REPORT_KIND_MARKDOWN = 2;
}
ReportKind report_kind = 1;
bytes report_data = 2;
bytes payload = 1;
}
2 changes: 1 addition & 1 deletion api/ipfsman/v1/ipfsman.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ message StartNodeRequest {
message StartNodeResponse {
string id = 1;
repeated string api_maddrs = 2;
repeated string gateway_maddrs = 4;
repeated string gateway_maddrs = 3;
}

message StopNodeRequest {
Expand Down
11 changes: 7 additions & 4 deletions buf.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,36 @@ module berty.tech/labs
go 1.17

require (
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/improbable-eng/grpc-web v0.15.0
github.com/ipfs-shipyard/gomobile-ipfs/go v0.0.0-20220201124626-a36f2adc5a3a
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-ds-badger v0.3.0
github.com/ipfs/go-ds-badger2 v0.1.3
github.com/ipfs/go-ds-flatfs v0.5.1
github.com/ipfs/go-ds-leveldb v0.5.0
github.com/ipfs/go-ds-sql v0.3.0
github.com/ipfs/go-ipfs-chunker v0.0.5
github.com/ipfs/go-ipfs-config v0.18.0
github.com/multiformats/go-multiaddr v0.5.0
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
github.com/peterbourgon/ff/v3 v3.1.2
github.com/pkg/errors v0.9.1
github.com/syndtr/goleveldb v1.0.0
go.uber.org/multierr v1.7.0
go.uber.org/zap v1.20.0
golang.org/x/mobile v0.0.0-20220112015953-858099ff7816
google.golang.org/grpc v1.44.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.27.1
moul.io/u v1.27.0
)

require (
bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/DataDog/zstd v1.4.1 // indirect
github.com/Stebalien/go-bitfield v0.0.1 // indirect
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 // indirect
Expand All @@ -37,7 +52,9 @@ require (
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger v1.6.2 // indirect
github.com/dgraph-io/ristretto v0.0.2 // indirect
github.com/dgraph-io/badger/v2 v2.2007.3 // indirect
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 // indirect
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
Expand All @@ -52,7 +69,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand All @@ -68,10 +85,6 @@ require (
github.com/ipfs/go-blockservice v0.2.1 // indirect
github.com/ipfs/go-cid v0.1.0 // indirect
github.com/ipfs/go-cidutil v0.0.2 // indirect
github.com/ipfs/go-datastore v0.5.1 // indirect
github.com/ipfs/go-ds-badger v0.3.0 // indirect
github.com/ipfs/go-ds-flatfs v0.5.1 // indirect
github.com/ipfs/go-ds-leveldb v0.5.0 // indirect
github.com/ipfs/go-ds-measure v0.2.0 // indirect
github.com/ipfs/go-fetcher v1.6.1 // indirect
github.com/ipfs/go-filestore v0.1.0 // indirect
Expand All @@ -80,9 +93,7 @@ require (
github.com/ipfs/go-ipfs v0.11.0 // indirect
github.com/ipfs/go-ipfs-api v0.3.0 // indirect
github.com/ipfs/go-ipfs-blockstore v0.2.1 // indirect
github.com/ipfs/go-ipfs-chunker v0.0.5 // indirect
github.com/ipfs/go-ipfs-cmds v0.6.0 // indirect
github.com/ipfs/go-ipfs-config v0.18.0 // indirect
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
github.com/ipfs/go-ipfs-ds-help v0.1.1 // indirect
github.com/ipfs/go-ipfs-exchange-interface v0.1.0 // indirect
Expand All @@ -101,7 +112,7 @@ require (
github.com/ipfs/go-ipld-legacy v0.1.0 // indirect
github.com/ipfs/go-ipns v0.1.2 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.4.0 // indirect
github.com/ipfs/go-log/v2 v2.5.0 // indirect
github.com/ipfs/go-merkledag v0.5.1 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-mfs v0.2.1 // indirect
Expand Down Expand Up @@ -179,6 +190,7 @@ require (
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/mattn/go-sqlite3 v1.14.11 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/miekg/dns v1.1.43 // indirect
Expand All @@ -190,7 +202,6 @@ require (
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.5.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
Expand All @@ -210,7 +221,6 @@ require (
github.com/rs/cors v1.7.0 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
Expand Down
Loading

0 comments on commit 1130845

Please sign in to comment.