Skip to content
Closed
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
2 changes: 1 addition & 1 deletion docker/universal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CMD ["/usr/bin/rivet-engine", "start"]
# MARK: Engine (Slim)
FROM --platform=linux/amd64 debian:12.9-slim AS engine-slim

LABEL org.opencontainers.image.source https://github.com/rivet-gg/rivet
LABEL org.opencontainers.image.source=https://github.com/rivet-gg/rivet

# Docker automatically provides TARGETARCH
ARG TARGETARCH
Expand Down
6 changes: 2 additions & 4 deletions packages/core/api-peer/src/runner_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ pub struct ListQuery {

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ListPath {
pub namespace_id: Id,
}
pub struct ListPath {}

#[derive(Deserialize, Serialize, ToSchema)]
#[serde(deny_unknown_fields)]
Expand All @@ -33,7 +31,7 @@ pub struct ListResponse {
pub pagination: Pagination,
}

pub async fn list(ctx: ApiCtx, path: ListPath, query: ListQuery) -> Result<ListResponse> {
pub async fn list(ctx: ApiCtx, _path: ListPath, query: ListQuery) -> Result<ListResponse> {
let namespace = ctx
.op(namespace::ops::resolve_for_name_global::Input {
name: query.namespace.clone(),
Expand Down
6 changes: 6 additions & 0 deletions packages/core/pegboard-serverless/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ async fn tick(
})
.await?;

tracing::debug!(?serverless_data, ?runner_configs);

for (ns_id, runner_name, desired_slots) in &serverless_data {
let runner_config = runner_configs
.iter()
Expand Down Expand Up @@ -161,6 +163,10 @@ async fn tick(
.any(|(ns_id2, runner_name2, _)| ns_id == ns_id2 && runner_name == runner_name2)
});

tracing::debug!(
connection_counts=?outbound_connections.iter().map(|(k, v)| (k, v.len())).collect::<Vec<_>>(),
);

Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion packages/infra/engine/tests/common/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl TestRunner {

let manifest_dir = env!("CARGO_MANIFEST_DIR");
let runner_script_path =
Path::new(manifest_dir).join("../../../sdks/typescript/test-runner/dist/main.js");
Path::new(manifest_dir).join("../../../sdks/typescript/test-runner/dist/index.js");

if !runner_script_path.exists() {
panic!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub async fn bump_serverless_autoscaler_global(ctx: &OperationCtx, input: &Input
.await
} else {
// Remote datacenter - HTTP request
request_remote_datacenter(
request_remote_datacenter::<BumpServerlessAutoscalerResponse>(
ctx.config(),
dc.datacenter_label,
"/bump-serverless-autoscaler",
Expand All @@ -32,6 +32,7 @@ pub async fn bump_serverless_autoscaler_global(ctx: &OperationCtx, input: &Input
Option::<&()>::None,
)
.await
.map(|_| ())
}
}
}))
Expand All @@ -58,3 +59,7 @@ pub async fn bump_serverless_autoscaler_global(ctx: &OperationCtx, input: &Input

Ok(())
}

// TODO: This is cloned from api-peer because of a cyclical dependency
#[derive(Deserialize)]
pub struct BumpServerlessAutoscalerResponse {}
6 changes: 5 additions & 1 deletion packages/services/internal/src/ops/cache/purge_global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub async fn cache_purge_global(ctx: &OperationCtx, input: &Input) -> Result<()>
.await
} else {
// Remote datacenter - HTTP request
request_remote_datacenter(
request_remote_datacenter::<CachePurgeResponse>(
ctx.config(),
dc.datacenter_label,
"/cache/purge",
Expand All @@ -43,6 +43,7 @@ pub async fn cache_purge_global(ctx: &OperationCtx, input: &Input) -> Result<()>
}),
)
.await
.map(|_| ())
}
}
}))
Expand Down Expand Up @@ -76,3 +77,6 @@ pub struct CachePurgeRequest {
pub base_key: String,
pub keys: Vec<rivet_cache::RawCacheKey>,
}

#[derive(Deserialize)]
pub struct CachePurgeResponse {}
18 changes: 15 additions & 3 deletions packages/services/namespace/src/ops/runner_config/get_global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ pub async fn namespace_runner_config_get_global(
let client = client.clone();

async move {
let namespaces = ctx
.op(crate::ops::get_global::Input {
namespace_ids: runners
.iter()
.map(|(ns_id, _)| *ns_id)
.collect(),
})
.await?;

let mut runner_names_by_namespace_id =
HashMap::with_capacity(runners.len());

Expand All @@ -50,11 +59,14 @@ pub async fn namespace_runner_config_get_global(

// TODO: Parallelize
for (namespace_id, runner_names) in runner_names_by_namespace_id {
let url = leader_dc
.api_peer_url
.join(&format!("/namespaces/{namespace_id}/runner-configs"))?;
let namespace = namespaces
.iter()
.find(|n| n.namespace_id == namespace_id)
.context("namespace not found")?;
let url = leader_dc.api_peer_url.join("/runner-configs")?;
let res = client
.get(url)
.query(&[("namespace", &namespace.name)])
.query(
&runner_names
.iter()
Expand Down
2 changes: 1 addition & 1 deletion sdks/typescript/test-runner/Dockerfile

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

6 changes: 3 additions & 3 deletions sdks/typescript/test-runner/package.json

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

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

3 changes: 2 additions & 1 deletion sdks/typescript/test-runner/tsconfig.json

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

Loading