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
4 changes: 2 additions & 2 deletions docker/dev-full/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
networks:
- rivet-network
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8090/health/liveness"]
test: ["CMD", "curl", "-f", "http://127.0.0.1:6430/health/liveness"]
interval: 2s
timeout: 10s
retries: 10
Expand Down Expand Up @@ -86,7 +86,7 @@ services:
networks:
- rivet-network
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8090/health/liveness"]
test: ["CMD", "curl", "-f", "http://127.0.0.1:6430/health/liveness"]
interval: 2s
timeout: 10s
retries: 10
Expand Down
2 changes: 1 addition & 1 deletion docker/dev-full/rivet-edge-server/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cluster_id": "11ca8960-acab-4963-909c-99d72af3e1cb",
"datacenter_id": "f288913c-735d-4188-bf9b-2fcf6eac7b9c",
"server_id": "174aca2a-98b7-462c-9ad9-3835094a9a10",
"intercom_endpoint": "http://rivet-server:8081"
"intercom_endpoint": "http://rivet-server:6421"
},
"guard": {
// TLS not configured for local development
Expand Down
2 changes: 1 addition & 1 deletion docker/dev-full/rivet-guard/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"cluster_id": "11ca8960-acab-4963-909c-99d72af3e1cb",
"datacenter_id": "f288913c-735d-4188-bf9b-2fcf6eac7b9c",
"server_id": "174aca2a-98b7-462c-9ad9-3835094a9a10",
"intercom_endpoint": "http://rivet-server:8081"
"intercom_endpoint": "http://rivet-server:6421"
},
"guard": {
// TLS not configured for local development
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/hub/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_APP_API_URL=http://127.0.0.1:8080
VITE_APP_API_URL=http://127.0.0.1:6420
VITE_APP_ASSETS_URL=https://assets2.rivet.gg
VITE_APP_SENTRY_DSN="https://66a566505cfb4341732a3d350f2b87e2@o4504307129188352.ingest.sentry.io/4506435887366144"
VITE_APP_SENTRY_PROJECT_ID="4506435887366144"
Expand Down
2 changes: 1 addition & 1 deletion packages/toolchain/cli/src/util/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn inquire_self_hosting() -> Result<Option<String>> {

let api_endpoint = if !using_cloud {
let e = inquire::Text::new("What is the API endpoint?")
.with_default("http://localhost:8080")
.with_default("http://localhost:6420")
.with_validator(|input: &str| match url::Url::parse(input) {
Result::Ok(_) => StdResult::Ok(Validation::Valid),
Err(err) => StdResult::Ok(Validation::Invalid(format!("{err}").into())),
Expand Down
41 changes: 25 additions & 16 deletions packages/toolchain/toolchain/src/util/actor/logs.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use crate::{
rivet_api::{apis, models},
ToolchainCtx,
};
use crate::{rivet_api::apis, ToolchainCtx};
use anyhow::*;
use base64::{engine::general_purpose::STANDARD, Engine};
use chrono::{DateTime, Utc};
use clap::ValueEnum;
use serde_json::json;
use std::time::Duration;
use tokio::signal;
use tokio::sync::watch;
Expand Down Expand Up @@ -63,18 +61,17 @@ async fn tail_streams(
stdout_fetched_tx: watch::Sender<bool>,
stderr_fetched_tx: watch::Sender<bool>,
) -> Result<()> {
// TODO: Update ot use ActorsQueryLogStream::All
tokio::try_join!(
tail_stream(
ctx,
&opts,
models::ActorsQueryLogStream::StdOut,
0, // stdout
stdout_fetched_tx
),
tail_stream(
ctx,
&opts,
models::ActorsQueryLogStream::StdErr,
1, // stderr
stderr_fetched_tx
),
)
Expand All @@ -85,7 +82,7 @@ async fn tail_streams(
async fn tail_stream(
ctx: &ToolchainCtx,
opts: &TailOpts<'_>,
stream: models::ActorsQueryLogStream,
stream: i32, // 0 = stdout, 1 = stderr
log_fetched_tx: watch::Sender<bool>,
) -> Result<()> {
let mut watch_index: Option<String> = None;
Expand All @@ -95,8 +92,8 @@ async fn tail_stream(
// future doesn't exit.
match (&opts.stream, stream) {
(LogStream::All, _) => {}
(LogStream::StdOut, models::ActorsQueryLogStream::StdOut) => {}
(LogStream::StdErr, models::ActorsQueryLogStream::StdErr) => {}
(LogStream::StdOut, 0) => {}
(LogStream::StdErr, 1) => {}
_ => {
// Notify poll_actor_state
log_fetched_tx.send(true).ok();
Expand All @@ -107,15 +104,19 @@ async fn tail_stream(
}

loop {
// Build query expression for a single actor
let query_expr = json!({
"property": "actor_id",
"value": opts.actor_id.to_string(),
"case_sensitive": true
});
let query_json = serde_json::to_string(&query_expr)?;

let res = apis::actors_logs_api::actors_logs_get(
&ctx.openapi_config_cloud,
stream,
&serde_json::to_string(&vec![opts.actor_id])?,
&query_json,
Some(&ctx.project.name_id),
Some(opts.environment),
None,
None,
None,
watch_index.as_deref(),
)
.await
Expand All @@ -127,7 +128,15 @@ async fn tail_stream(
first_batch_fetched = true;
}

for (ts, line) in res.timestamps.iter().zip(res.lines.iter()) {
// Filter logs by stream type
for (i, (ts, line)) in res.timestamps.iter().zip(res.lines.iter()).enumerate() {
// Check if this log entry is from the stream we're interested in
if let Some(&log_stream) = res.streams.get(i) {
if log_stream != stream {
continue;
}
}

let Result::Ok(ts) = ts.parse::<DateTime<Utc>>() else {
eprintln!("Failed to parse timestamp: {ts} for line {line}");
continue;
Expand Down
2 changes: 1 addition & 1 deletion tests/load/actor-lifecycle/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "./types.ts";

export const CONFIG: Config = {
rivetEndpoint: __ENV.RIVET_ENDPOINT || "http://localhost:8080",
rivetEndpoint: __ENV.RIVET_ENDPOINT || "http://localhost:6420",
rivetServiceToken: __ENV.RIVET_SERVICE_TOKEN || undefined,
rivetProject: __ENV.RIVET_PROJECT || "default",
rivetEnvironment: __ENV.RIVET_ENVIRONMENT || "default",
Expand Down
Loading