Skip to content
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
30 changes: 22 additions & 8 deletions rivetkit-rust/packages/rivetkit/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ where

fn actor_config<A: Actor>(mut config: ActorConfig) -> ActorConfig {
config.has_database |= A::HAS_DATABASE;
if A::HAS_DATABASE && !cfg!(feature = "sqlite-local") {
// Internal storage (state, KV, queue) always uses SQLite, so without local
// SQLite compiled in every actor must route it through the engine.
if !cfg!(feature = "sqlite-local") {
config.remote_sqlite = true;
}
config
Expand Down Expand Up @@ -297,12 +299,24 @@ mod tests {

#[test]
fn actor_database_declaration_enables_core_database_config() {
let config = actor_config::<DatabaseActor>(ActorConfig::default());
assert!(config.has_database);
assert!(config.remote_sqlite);

let config = actor_config::<EmptyActor>(ActorConfig::default());
assert!(!config.has_database);
assert!(!config.remote_sqlite);
let db = actor_config::<DatabaseActor>(ActorConfig::default());
assert!(db.has_database);

let empty = actor_config::<EmptyActor>(ActorConfig::default());
assert!(!empty.has_database);

// Internal storage always uses SQLite, so without local SQLite compiled
// in every actor routes SQLite through the engine regardless of whether
// it declares a user database.
#[cfg(not(feature = "sqlite-local"))]
{
assert!(db.remote_sqlite);
assert!(empty.remote_sqlite);
}
#[cfg(feature = "sqlite-local")]
{
assert!(!db.remote_sqlite);
assert!(!empty.remote_sqlite);
}
}
}
3 changes: 2 additions & 1 deletion website/src/content/docs/deploy/container-runner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ Artifacts are published for `x86_64-unknown-linux-musl` and `aarch64-unknown-lin
</Step>
<Step title="Deploy">

Deploy the image to [Rivet Compute](/docs/deploy/rivet-compute) with the CLI. For game servers, configure the pool with one actor per instance:
Deploy the image to [Rivet Compute](/docs/deploy/rivet-compute) with the CLI. For game servers, configure the pool with one actor per instance and keep running instances alive across version upgrades:

```bash
npx @rivetkit/cli deploy \
--token "$RIVET_CLOUD_TOKEN" \
--instance-request-concurrency 1 \
--drain-on-version-upgrade false \
--dockerfile Dockerfile
```

Expand Down
Loading