Skip to content

Commit

Permalink
feat: add new agent.proto func
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-xiaofeng authored and askyrie committed Oct 9, 2024
1 parent d3f6333 commit 716a833
Show file tree
Hide file tree
Showing 65 changed files with 9,676 additions and 56 deletions.
624 changes: 624 additions & 0 deletions cli/ctl/agent_check.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cli/ctl/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func Execute(version string) {
root.AddCommand(RegisterPluginCommand())
root.AddCommand(RegisterPrometheusCommand())
root.AddCommand(RegisterPromQLCommand())
//root.AddCommand(AgentCheckRegisterCommand())

cmd.RegisterIngesterCommand(root)

Expand Down
24 changes: 24 additions & 0 deletions cli/ctl/common/domainenabled_string.go

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

35 changes: 35 additions & 0 deletions cli/ctl/common/domainstate_string.go

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

77 changes: 77 additions & 0 deletions cli/ctl/common/domaintype_string.go

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

26 changes: 26 additions & 0 deletions cli/ctl/common/plugintype_string.go

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

25 changes: 25 additions & 0 deletions cli/ctl/common/pluginuser_string.go

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

33 changes: 33 additions & 0 deletions cli/ctl/common/vtapexception_string.go

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

26 changes: 26 additions & 0 deletions cli/ctl/common/vtapstate_string.go

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

25 changes: 25 additions & 0 deletions cli/ctl/common/vtaptapmode_string.go

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

47 changes: 47 additions & 0 deletions cli/ctl/common/vtaptype_string.go

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

18 changes: 7 additions & 11 deletions message/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ service Synchronizer {
rpc KubernetesAPISync(KubernetesAPISyncRequest) returns (KubernetesAPISyncResponse) {}
rpc GetKubernetesClusterID(KubernetesClusterIDRequest) returns (KubernetesClusterIDResponse) {}
rpc GPIDSync(GPIDSyncRequest) returns (GPIDSyncResponse) {}
rpc ShareGPIDLocalData(ShareGPIDSyncRequests) returns (ShareGPIDSyncRequests) {}
rpc Plugin(PluginRequest) returns (stream PluginResponse) {}
// because gRPC cannot be initiated by server, the req/resp of this rpc is reversed
rpc RemoteExecute(stream RemoteExecResponse) returns (stream RemoteExecRequest) {}
Expand All @@ -25,7 +26,6 @@ service Debug {
rpc DebugGPIDAgentData(GPIDSyncRequest) returns (GPIDAgentData) {}
rpc DebugRealGlobalData(GPIDSyncRequest) returns (RealGlobalData) {}
rpc DebugRIPToVIP(GPIDSyncRequest) returns (RVData) {}
rpc DebugAgentCache(AgentCacheRequest) returns (AgentCacheResponse) {}
}

enum AgentType {
Expand Down Expand Up @@ -621,6 +621,12 @@ enum GPIDSyncCompressAlgorithm {
COMPRESS_ALGO_IGNORE_IF_EQUAL_TO_PREVIOUS = 1;
}

message ShareGPIDSyncRequests {
optional string server_ip = 1;
repeated GPIDSyncRequest sync_requests = 2;
optional uint32 org_id = 3;
}

message GPIDSyncRequest {
optional string ctrl_ip = 1;
optional string ctrl_mac = 2;
Expand Down Expand Up @@ -697,16 +703,6 @@ message GPIDAgentData {
optional GPIDSyncRequest sync_request = 2;
}

message AgentCacheRequest {
optional string ctrl_ip = 1;
optional string ctrl_mac = 2;
optional string team_id = 3; // agent team identity
}

message AgentCacheResponse {
optional bytes content = 1; // json数据
}

message AgentId {
optional string ip = 1;
optional string mac = 2;
Expand Down
2 changes: 1 addition & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ generated_libs = libs/hmap/idmap/ubig_id_map.go libs/hmap/idmap/ubig_id_map_test
libs/hmap/lru/ubig_lru.go libs/hmap/lru/ubig_lru_test.go \
libs/flow-metrics/pooled_meters.go libs/kubernetes/watcher.gen.go

proto = vendor/${MESSAGE}/common/common.pb.go vendor/${MESSAGE}/trident/trident.pb.go vendor/${MESSAGE}/agent/agent.pb.go vendor/${MESSAGE}/controller/controller.pb.go vendor/${MESSAGE}/alert_event/alert_event.pb.go vendor/${MESSAGE}/k8s_event/k8s_event.pb.go libs/datatype/pb/flow_log.pb.go libs/flow-metrics/pb/metric.pb.go libs/stats/pb/stats.pb.go
proto = vendor/${MESSAGE}/common/common.pb.go vendor/${MESSAGE}/trident/trident.pb.go vendor/${MESSAGE}/agent/agent.pb.go vendor/${MESSAGE}/controller/controller.pb.go vendor/${MESSAGE}/alert_event/alert_event.pb.go vendor/${MESSAGE}/k8s_event/k8s_event.pb.go libs/datatype/pb/flow_log.pb.go libs/flow-metrics/pb/metric.pb.go libs/stats/pb/stats.pb.go

$(generated_libs): $(generate_sources)
go generate ./...
Expand Down
3 changes: 3 additions & 0 deletions server/agent_config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import _ "embed"
//go:embed example.yaml
var YamlAgentGroupConfig []byte

//go:embed template.yaml
var YamlAgentGroupConfigTemplate []byte

type AgentGroupConfig struct {
VTapGroupID *string `json:"VTAP_GROUP_ID" yaml:"vtap_group_id,omitempty"`
VTapGroupLcuuid *string `json:"VTAP_GROUP_LCUUID" yaml:"vtap_group_lcuuid,omitempty"`
Expand Down
Loading

0 comments on commit 716a833

Please sign in to comment.