Skip to content

Commit

Permalink
feat(pegboard): add process monitoring, wip sqlite (#1146)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->
Fixes RVTEE-608
## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Oct 9, 2024
1 parent 5f0085d commit 3019a65
Show file tree
Hide file tree
Showing 9 changed files with 750 additions and 143 deletions.
7 changes: 5 additions & 2 deletions lib/pegboard/container-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ const MAX_BUFFER_BYTES: usize = 1024 * 1024;
const MAX_PREVIEW_LINES: usize = 128;

fn main() -> anyhow::Result<()> {
let pegboard_container_dir = var("PEGBOARD_CONTAINER_DIR")?;
let pegboard_container_dir = std::env::args()
.skip(1)
.next()
.context("`container_dir` arg required")?;
let pegboard_container_dir = Path::new(&pegboard_container_dir);
let root_user_enabled = var("PEGBOARD_META_root_user_enabled")? == "1";

let root_user_enabled = var("PEGBOARD_META_root_user_enabled")? == "1";
let stakeholder = match var("PEGBOARD_META_stakeholder").ok() {
Some(x) if x == "dynamic_server" => Stakeholder::DynamicServer {
server_id: var("PEGBOARD_META_server_id")?,
Expand Down
15 changes: 15 additions & 0 deletions lib/pegboard/manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ license = "Apache-2.0"
[dependencies]
anyhow = "1.0.79"
futures-util = { version = "0.3" }
indoc = "2.0"
nix = { version = "0.27", default-features = false, features = ["user", "signal"] }
notify = { version = "6.1.1", default-features = false, features = [ "serde" ] }
reqwest = { version = "0.11", features = ["stream"] }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
Expand All @@ -26,3 +28,16 @@ url = "2.5.0"
uuid = { version = "1.6.1", features = ["v4"] }

pegboard = { path = "../../../svc/pkg/pegboard" }

[dependencies.sqlx]
git = "https://github.com/rivet-gg/sqlx"
rev = "08d6e61aa0572e7ec557abbedb72cebb96e1ac5b"
default-features = false
features = [
"runtime-tokio",
"migrate",
"sqlite",
"uuid",
"json",
"ipnetwork"
]
88 changes: 0 additions & 88 deletions lib/pegboard/manager/src/client.rs

This file was deleted.

Loading

0 comments on commit 3019a65

Please sign in to comment.