Skip to content

Commit

Permalink
add agent sidecar flame for implementation (#404)
Browse files Browse the repository at this point in the history
* add agent sidecar

Signed-off-by: kpango <i.can.feel.gravity@gmail.com>

* fix

Signed-off-by: kpango <i.can.feel.gravity@gmail.com>

* fix

Signed-off-by: kpango <i.can.feel.gravity@gmail.com>

* fix

Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
  • Loading branch information
Yusuke Kato authored May 26, 2020
1 parent fb392fc commit 7d5c1d1
Show file tree
Hide file tree
Showing 107 changed files with 8,068 additions and 170 deletions.
16 changes: 11 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
area/agent:
- apis/proto/agent/**/*
- apis/grpc/agent/**/*
- cmd/agent/**/*
- pkg/agent/**/*
area/agent/core:
- apis/proto/agent/core/**/*
- apis/grpc/agent/core/**/*
- cmd/agent/core/**/*
- pkg/agent/core/**/*

area/agent/sidecar:
- apis/proto/agent/sidecar/**/*
- apis/grpc/agent/sidecar/**/*
- cmd/agent/sidecar/**/*
- pkg/agent/sidecar/**/*

area/discoverer:
- apis/proto/discoverer/**/*
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dockers-agent-ngt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/agent/ngt/**'
- 'cmd/agent/ngt/**'
- 'pkg/agent/core/ngt/**'
- 'cmd/agent/core/ngt/**'
- 'dockers/base/Dockerfile'
- 'dockers/agent/ngt/Dockerfile'
- 'dockers/agent/core/ngt/Dockerfile'
- 'versions/GO_VERSION'
- 'versions/NGT_VERSION'
pull_request:
Expand All @@ -25,10 +25,10 @@ on:
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/agent/ngt/**'
- 'cmd/agent/ngt/**'
- 'pkg/agent/core/ngt/**'
- 'cmd/agent/core/ngt/**'
- 'dockers/base/Dockerfile'
- 'dockers/agent/ngt/Dockerfile'
- 'dockers/agent/core/ngt/Dockerfile'
- 'versions/GO_VERSION'
- 'versions/NGT_VERSION'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e-bench-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- '.github/workflows/e2e-bench-agent.yml'
- 'internal/**'
- 'apis/grpc/**'
- 'pkg/agent/ngt/**'
- 'cmd/agent/ngt/**'
- 'pkg/agent/core/ngt/**'
- 'cmd/agent/core/ngt/**'
- 'hack/benchmark/**'
- 'versions/GO_VERSION'
- 'versions/NGT_VERSION'
Expand All @@ -17,8 +17,8 @@ on:
- '.github/workflows/e2e-bench-agent.yml'
- 'internal/**'
- 'apis/grpc/**'
- 'pkg/agent/ngt/**'
- 'cmd/agent/ngt/**'
- 'pkg/agent/core/ngt/**'
- 'cmd/agent/core/ngt/**'
- 'hack/benchmark/**'
- 'versions/GO_VERSION'
- 'versions/NGT_VERSION'
Expand Down
28 changes: 14 additions & 14 deletions Makefile.d/bench.mk
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@ bench/agent: \
## run benchmark for agent gRPC stream
bench/agent/stream: \
ngt/install
$(call bench-pprof,pprof/agent/ngt,agent,gRPC_Stream,stream,\
./hack/benchmark/e2e/agent/ngt/ngt_bench_test.go \
$(call bench-pprof,pprof/agent/core/ngt,agent,gRPC_Stream,stream,\
./hack/benchmark/e2e/agent/core/ngt/ngt_bench_test.go \
-dataset=$(DATASET_ARGS))

.PHONY: bench/agent/sequential/grpc
## run benchmark for agent gRPC sequential
bench/agent/sequential/grpc: \
ngt/install
$(call bench-pprof,pprof/agent/ngt,agent,gRPC_Sequential,sequential-grpc,\
./hack/benchmark/e2e/agent/ngt/ngt_bench_test.go \
$(call bench-pprof,pprof/agent/core/ngt,agent,gRPC_Sequential,sequential-grpc,\
./hack/benchmark/e2e/agent/core/ngt/ngt_bench_test.go \
-dataset=$(DATASET_ARGS))

.PHONY: bench/agent/sequential/rest
## run benchmark for agent REST
bench/agent/sequential/rest: \
ngt/install
$(call bench-pprof,pprof/agent/ngt,agent,REST_Sequential,sequential-rest,\
./hack/benchmark/e2e/agent/ngt/ngt_bench_test.go \
$(call bench-pprof,pprof/agent/core/ngt,agent,REST_Sequential,sequential-rest,\
./hack/benchmark/e2e/agent/core/ngt/ngt_bench_test.go \
-dataset=$(DATASET_ARGS))

.PHONY: bench/ngtd
Expand Down Expand Up @@ -186,15 +186,15 @@ profile: \

.PHONY: profile/agent/stream
profile/agent/stream:
$(call profile-web,pprof/agent/ngt,agent,stream,":6061",":6062",":6063")
$(call profile-web,pprof/agent/core/ngt,agent,stream,":6061",":6062",":6063")

.PHONY: profile/agent/sequential/grpc
profile/agent/sequential/grpc:
$(call profile-web,pprof/agent/ngt,agent,sequential-grpc,":6061",":6062",":6063")
$(call profile-web,pprof/agent/core/ngt,agent,sequential-grpc,":6061",":6062",":6063")

.PHONY: profile/agent/sequential/rest
profile/agent/sequential/rest:
$(call profile-web,pprof/agent/ngt,agent,sequential-rest,":6061",":6062",":6063")
$(call profile-web,pprof/agent/core/ngt,agent,sequential-rest,":6061",":6062",":6063")

.PHONY: profile/ngtd/stream
profile/ngtd/stream:
Expand All @@ -216,14 +216,14 @@ metrics: \
.PHONY: metrics/agent
## calculate agent metrics
metrics/agent: \
metrics/agent/ngt
metrics/agent/core/ngt

.PHONY: metrics/agent/ngt
## calculate agent/ngt metrics
metrics/agent/ngt: $(ROOTDIR)/metrics.gob
.PHONY: metrics/agent/core/ngt
## calculate agent/core/ngt metrics
metrics/agent/core/ngt: $(ROOTDIR)/metrics.gob

$(ROOTDIR)/metrics.gob:
go test -v --timeout=1h ./hack/benchmark/e2e/agent/ngt/... -output=$(ROOTDIR)/metrics.gob
go test -v --timeout=1h ./hack/benchmark/e2e/agent/core/ngt/... -output=$(ROOTDIR)/metrics.gob

.PHONY: metrics/chart
## create metrics chart
Expand Down
2 changes: 1 addition & 1 deletion Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ docker/name/agent-ngt:
.PHONY: docker/build/agent-ngt
## build agent-ngt image
docker/build/agent-ngt: docker/build/base
docker build -f dockers/agent/ngt/Dockerfile -t $(REPO)/$(AGENT_IMAGE) .
docker build -f dockers/agent/core/ngt/Dockerfile -t $(REPO)/$(AGENT_IMAGE) .

.PHONY: docker/name/discoverer-k8s
docker/name/discoverer-k8s:
Expand Down
10 changes: 5 additions & 5 deletions apis/docs/agent/docs.md → apis/docs/agent/core/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

## Table of Contents

- [agent.proto](#agent.proto)
- [Agent](#agent.Agent)
- [core/agent.proto](#core/agent.proto)
- [Agent](#core.Agent)

- [Scalar Value Types](#scalar-value-types)



<a name="agent.proto"></a>
<a name="core/agent.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## agent.proto
## core/agent.proto



Expand All @@ -23,7 +23,7 @@



<a name="agent.Agent"></a>
<a name="core.Agent"></a>

### Agent

Expand Down
57 changes: 57 additions & 0 deletions apis/docs/agent/sidecar/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Protocol Documentation
<a name="top"></a>

## Table of Contents

- [sidecar/sidecar.proto](#sidecar/sidecar.proto)
- [Sidecar](#sidecar.Sidecar)

- [Scalar Value Types](#scalar-value-types)



<a name="sidecar/sidecar.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## sidecar/sidecar.proto









<a name="sidecar.Sidecar"></a>

### Sidecar


| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|





## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

Loading

0 comments on commit 7d5c1d1

Please sign in to comment.