Skip to content
Open
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
109 changes: 59 additions & 50 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion out/openapi.json

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

11 changes: 0 additions & 11 deletions packages/common/config/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod clickhouse;
pub mod db;
pub mod guard;
pub mod logs;
pub mod pegboard;
pub mod pegboard_gateway;
pub mod pegboard_tunnel;
pub mod pubsub;
Expand All @@ -25,7 +24,6 @@ pub use clickhouse::*;
pub use db::Database;
pub use guard::*;
pub use logs::*;
pub use pegboard::*;
pub use pegboard_gateway::*;
pub use pegboard_tunnel::*;
pub use pubsub::PubSub;
Expand Down Expand Up @@ -73,9 +71,6 @@ pub struct Root {
#[serde(default)]
pub api_peer: Option<ApiPeer>,

#[serde(default)]
pub pegboard: Option<Pegboard>,

#[serde(default)]
pub pegboard_gateway: Option<PegboardGateway>,

Expand Down Expand Up @@ -113,7 +108,6 @@ impl Default for Root {
guard: None,
api_public: None,
api_peer: None,
pegboard: None,
pegboard_gateway: None,
pegboard_tunnel: None,
logs: None,
Expand Down Expand Up @@ -144,11 +138,6 @@ impl Root {
self.api_peer.as_ref().unwrap_or(&DEFAULT)
}

pub fn pegboard(&self) -> &Pegboard {
static DEFAULT: LazyLock<Pegboard> = LazyLock::new(Pegboard::default);
self.pegboard.as_ref().unwrap_or(&DEFAULT)
}

pub fn pegboard_gateway(&self) -> &PegboardGateway {
static DEFAULT: LazyLock<PegboardGateway> = LazyLock::new(PegboardGateway::default);
self.pegboard_gateway.as_ref().unwrap_or(&DEFAULT)
Expand Down
34 changes: 0 additions & 34 deletions packages/common/config/src/config/pegboard.rs

This file was deleted.

8 changes: 0 additions & 8 deletions packages/common/test-deps/src/datacenter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,10 @@ pub async fn setup_single_datacenter(
dc = dc.datacenter_label,
"containers started, waiting for services to be ready"
);
// Pick ports for other services
let pegboard_port = portpicker::pick_unused_port().context("pegboard_port")?;

tracing::info!(
dc = dc.datacenter_label,
api_peer_port,
pegboard_port,
guard_port,
"using ports for test services"
);
Expand All @@ -80,10 +77,6 @@ pub async fn setup_single_datacenter(
port: Some(api_peer_port),
..Default::default()
});
root.pegboard = Some(rivet_config::config::Pegboard {
port: Some(pegboard_port),
..Default::default()
});

root.topology = Some(rivet_config::config::topology::Topology {
datacenter_label: dc.datacenter_label,
Expand Down Expand Up @@ -111,7 +104,6 @@ pub async fn setup_single_datacenter(
container_names,
api_peer_port,
guard_port,
pegboard_port,
stop_docker_containers_on_drop: true,
})
}
5 changes: 0 additions & 5 deletions packages/common/test-deps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub struct TestDeps {
pub config: rivet_config::Config,
container_names: Vec<String>,
api_peer_port: u16,
pegboard_port: u16,
guard_port: u16,
stop_docker_containers_on_drop: bool,
}
Expand Down Expand Up @@ -87,10 +86,6 @@ impl TestDeps {
self.api_peer_port
}

pub fn pegboard_port(&self) -> u16 {
self.pegboard_port
}

pub fn guard_port(&self) -> u16 {
self.guard_port
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/guard/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ once_cell.workspace = true
pegboard-gateway.workspace = true
pegboard-tunnel.workspace = true
pegboard.workspace = true
pegboard-runner-ws.workspace = true
regex.workspace = true
rivet-api-public.workspace = true
rivet-cache.workspace = true
Expand Down
17 changes: 3 additions & 14 deletions packages/core/guard/server/src/routing/runner_ws.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::*;
use gas::prelude::*;
use rivet_guard_core::proxy_service::{RouteConfig, RouteTarget, RoutingOutput, RoutingTimeout};
use std::sync::Arc;

/// Route requests to the API service
#[tracing::instrument(skip_all)]
Expand All @@ -10,22 +11,10 @@ pub async fn route_request(
_host: &str,
path: &str,
) -> Result<Option<RoutingOutput>> {
// Check target
if target != "runner-ws" {
return Ok(None);
}

let targets = vec![RouteTarget {
actor_id: None,
host: ctx.config().pegboard().lan_host().to_string(),
port: ctx.config().pegboard().port(),
path: path.to_owned(),
}];

return Ok(Some(RoutingOutput::Route(RouteConfig {
targets,
timeout: RoutingTimeout {
routing_timeout: 10, // 10 seconds for API routing timeout
},
})));
let tunnel = pegboard_runner_ws::PegboardRunnerWsCustomServe::new(ctx.clone());
Ok(Some(RoutingOutput::CustomServe(Arc::new(tunnel))))
}
8 changes: 8 additions & 0 deletions packages/core/pegboard-runner-ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ edition.workspace = true

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
bytes.workspace = true
futures-util.workspace = true
gas.workspace = true
http-body.workspace = true
http-body-util.workspace = true
# Idk how to get this working with the workspace version
hyper = "1.6"
hyper-tungstenite.workspace = true
hyper-util = "0.1"
rivet-config.workspace = true
rivet-error.workspace = true
rivet-guard-core.workspace = true
rivet-metrics.workspace = true
rivet-runner-protocol.workspace = true
rivet-runtime.workspace = true
Expand Down
Loading
Loading