Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(proto): add the initial rust-based system protocol #5

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions Cargo.lock

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

21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
[workspace]
members = ["ctl", "worker"]
members = ["ctl", "proto", "worker"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"

[workspace.dependencies]
# Internal deps
ctl.path = "ctl"
proto.path = "proto"
worker.path = "worker"
# External deps (keep alphabetically sorted)
axum = "0.7.4"
bty = { version = "0.1.0-pre.1", features = ["uuid"] }
chrono = { version = "0.4", default-features = false, features = [
"std",
"serde",
] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1", features = ["serde", "v4"] }

[workspace.lints.clippy]
all = "warn"
pedantic = "warn"
wildcard_imports = { level = "allow", priority = 2 }
wildcard_imports = "allow"
module_name_repetitions = "allow"
40 changes: 22 additions & 18 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,44 @@

# Diagrama do sistema

<!-- https://mermaid.live/edit -->

```mermaid
graph TB
user
user["User"]
user -- request --> balancer

sysadmin
sysadmin["SysAdmin"]
sysadmin -- (http) configures --> deployer
sysadmin ---> config_mgr
agent_mgr -- alerts --> sysadmin
sysadmin ---> config
sysadmin --> inspector
agent -- alerts --> sysadmin

subgraph system-network

subgraph ctrl
deployer
balancer
agent_mgr
config_mgr
discovery
subgraph Controller
deployer["Deployer"]
balancer["Load Balancer"]
agent["Agent Manager"]
config["Config Manager"]
inspector["Inspector"]
discovery["Discovery"]

deployer --> discovery
discovery --- balancer
agent_mgr --- discovery
agent --- discovery
end

balancer -- routes requests --> program
balancer -- routes requests --> service
deployer -- (http) deploy service --> runner
monitor -- (http) send metrics and status --> agent_mgr
monitor -- (http) send metrics and status --> agent

subgraph worker
monitor
runner
program
subgraph Worker
monitor["Monitor"]
runner["Runner"]
service["(service)"]

runner --> program
runner --> service
end

end
Expand Down
14 changes: 14 additions & 0 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "proto"
version.workspace = true
edition.workspace = true

[lints]
workspace = true

[dependencies]
bty.workspace = true
chrono.workspace = true
serde.workspace = true
serde_json.workspace = true
uuid.workspace = true
79 changes: 0 additions & 79 deletions proto/all.proto

This file was deleted.

2 changes: 2 additions & 0 deletions proto/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod node;
pub mod service;
Loading