Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api-status): add check for actor isolates #1642

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
1 change: 1 addition & 0 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions docker/dev-full/rivet-server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ server:
max_ingress_port_tcp: 7599
min_ingress_port_udp: 7500
max_ingress_port_udp: 7599

# Enable status checks if testing status check project
status:
token: local
system_test_isolate_project: default
system_test_isolate_environment: default
cockroachdb:
url: postgresql://cockroachdb:26257/defaultdb?sslmode=disable
username: root
Expand Down
2 changes: 1 addition & 1 deletion docker/dev-full/server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ RUN \
--mount=type=cache,target=/usr/local/cargo/registry,id=dev-full-server-cargo-registry \
--mount=type=cache,target=/app/target,id=dev-full-server-target \
RUSTFLAGS="--cfg tokio_unstable" cargo build --bin rivet-server && \
mv target/debug/rivet-server /usr/bin/rivet-server && \
cp target/debug/rivet-server /usr/bin/rivet-server && \
mkdir /etc/rivet-server
77 changes: 37 additions & 40 deletions docs/src/content/docs/self-hosting/server-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
"default": {
"api_edge": {
"host": null,
"port": null
"port": null,
"traefik_provider_token": null
},
"api_public": {
"host": null,
Expand Down Expand Up @@ -176,14 +177,11 @@
"port": null
},
"provision": null,
"status": null,
"telemetry": {
"enable": true
},
"test_builds": {},
"token": {
"status": null,
"traefik_provider": null
},
"tunnel": {
"public_host": "127.0.0.1:8003"
},
Expand Down Expand Up @@ -294,6 +292,14 @@
"type": "integer",
"format": "uint16",
"minimum": 0.0
},
"traefik_provider_token": {
"description": "Token for the API Traefik provider.",
"allOf": [
{
"$ref": "#/definitions/Secret<String>"
}
]
}
},
"additionalProperties": false
Expand Down Expand Up @@ -1250,7 +1256,8 @@
"api_edge": {
"default": {
"host": null,
"port": null
"port": null,
"traefik_provider_token": null
},
"allOf": [
{
Expand Down Expand Up @@ -1398,6 +1405,14 @@
}
]
},
"status": {
"default": null,
"allOf": [
{
"$ref": "#/definitions/Status"
}
]
},
"telemetry": {
"default": {
"enable": true
Expand All @@ -1416,17 +1431,6 @@
"$ref": "#/definitions/TestBuild"
}
},
"token": {
"default": {
"status": null,
"traefik_provider": null
},
"allOf": [
{
"$ref": "#/definitions/Tokens"
}
]
},
"tunnel": {
"default": {
"public_host": "127.0.0.1:8003"
Expand Down Expand Up @@ -1526,6 +1530,22 @@
},
"additionalProperties": false
},
"Status": {
"description": "Configure the status check API.\n\nThese are different than the health check API since they check the internals of the Rivet system.",
"type": "object",
"required": [
"token"
],
"properties": {
"system_test_isolate_project": {
"type": "string"
},
"token": {
"$ref": "#/definitions/Secret<String>"
}
},
"additionalProperties": false
},
"Stripe": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1631,29 +1651,6 @@
"lets_encrypt_staging"
]
},
"Tokens": {
"description": "Configuration for various tokens used in the system.",
"type": "object",
"properties": {
"status": {
"description": "Token for API status checks.",
"allOf": [
{
"$ref": "#/definitions/Secret<String>"
}
]
},
"traefik_provider": {
"description": "Token for the API Traefik provider.",
"allOf": [
{
"$ref": "#/definitions/Secret<String>"
}
]
}
},
"additionalProperties": false
},
"Tunnel": {
"description": "Configuration for the tunnel service.",
"type": "object",
Expand Down
25 changes: 25 additions & 0 deletions docs/src/content/docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,28 @@ To look up the location `file:///index.js:3754:17`, you can:
^
```

## `Bad Gateway` when making request to actor

This indicates that your actor's HTTP server is:

- Not responding to requests
- Is respondign with invalid data
- Your actor is crashing when receing the request or on startup

Validate that:

- Your server is listening on the correct port (e.g. for port `http`, read the port from `PORT_HTTP`)
- Your server starts immediately when the actor starts (i.e. don't run async code before starting the HTTP server)
- You're not using HTTPS for your server (Rivet Guard handles this for you)

If using the actor SDK, this likely an issue with the underlying Rivet library and should be reported on GitHub [here](https://github.com/rivet-gg/rivet/issues/new/choose).

## `404 page not found` when making request to actor

This indicates that there is no actor running for the given address. This often indicates that your actor has crashed and no longer exists.

Validate that:

- Your actor is not crashing by checking the logs
- The address is exactly what's returned from the Rivet API

2 changes: 1 addition & 1 deletion examples/counter/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Counter
# Sandbox (Isolate)

A bare bones example of RPC & events using a counter as an example.

Expand Down
51 changes: 0 additions & 51 deletions examples/counter/counter.ts

This file was deleted.

61 changes: 0 additions & 61 deletions examples/counter/counter_test.ts

This file was deleted.

21 changes: 21 additions & 0 deletions examples/system-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# System Test

Actors for simple tests of E2E system functionality.

## Prerequisites

- [Rivet CLI](https://rivet.gg/docs/setup)

## Deploying

```sh
rivet login
rivet deploy
```

## Testing

```sh
rivet deno --populate-env run -A ws_test.ts
```

17 changes: 17 additions & 0 deletions examples/system-test/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"imports": {
"@core/asyncutil": "jsr:@core/asyncutil@^1.2.0",
"@cross/env": "jsr:@cross/env@^1.0.2",
"@rivet-gg/api": "npm:@rivet-gg/api@0.0.1-rc.5",
"@std/assert": "jsr:@std/assert@^1.0.8",
"@std/async": "jsr:@std/async@^1.0.9",
"@std/cbor": "jsr:@std/cbor@^0.1.3",
"@std/log": "jsr:@std/log@^0.224.11",
"hono": "jsr:@hono/hono@^4.6.12",
"@rivet-gg/actors-core": "../../sdks/actors/core/src/mod.ts",
"@rivet-gg/actors": "../../sdks/actors/runtime/src/mod.ts",
"on-change": "npm:on-change@^5.0.1",
"zod": "npm:zod@^3.24.1"

}
}
Loading
Loading