diff --git a/docker/dev-full/rivet-client/config.jsonc b/docker/dev-full/rivet-client/config.jsonc index d70236be07..3b9407224f 100644 --- a/docker/dev-full/rivet-client/config.jsonc +++ b/docker/dev-full/rivet-client/config.jsonc @@ -1,7 +1,6 @@ { "client": { "runner": { - "flavor": "container", // Resource constraints are not supported in Docker // TODO: Needs further investigation in to why nested cgroups v2 resource constraints aren't working "use_resource_constraints": false, diff --git a/docker/universal/Dockerfile b/docker/universal/Dockerfile index 290fefaf45..7c0466fbb0 100644 --- a/docker/universal/Dockerfile +++ b/docker/universal/Dockerfile @@ -47,10 +47,10 @@ RUN \ --mount=type=cache,target=/root/.cache,id=universal-user-cache \ --mount=type=cache,target=/root/.npm,id=universal-user-npm \ --mount=type=cache,target=/root/.yarn,id=universal-user-yarn \ - RUSTFLAGS="--cfg tokio_unstable" RIVET_BUILD_HUB=0 cargo build --bin rivet-server --bin rivet-edge-server --bin rivet-guard --bin rivet-client --bin rivet-isolate-v8-runner --bin rivet-container-runner && \ + RUSTFLAGS="--cfg tokio_unstable" RIVET_BUILD_HUB=0 cargo build --bin rivet-server --bin rivet-edge-server --bin rivet-guard --bin rivet-client --bin rivet-container-runner && \ # cargo install --locked tokio-console && \ mkdir /app/dist/ && \ - cp target/debug/rivet-server target/debug/rivet-edge-server target/debug/rivet-guard target/debug/rivet-client target/debug/rivet-isolate-v8-runner target/debug/rivet-container-runner /app/dist/ + cp target/debug/rivet-server target/debug/rivet-edge-server target/debug/rivet-guard target/debug/rivet-client target/debug/rivet-container-runner /app/dist/ # MARK: Server (full, base) FROM debian:12.9-slim AS server-full-base @@ -205,7 +205,7 @@ COPY ./docker/monolith/rivet-client /etc/rivet-client # === Copy Build Artifacts === COPY --from=builder /app/dist/rivet-server /usr/local/bin/ -COPY --from=builder /app/dist/rivet-client /app/dist/rivet-isolate-v8-runner /app/dist/rivet-container-runner /usr/local/bin/ +COPY --from=builder /app/dist/rivet-client /app/dist/rivet-container-runner /usr/local/bin/ VOLUME ["/data"] diff --git a/examples/system-test-actor/src/container/main.ts b/examples/system-test-actor/src/container/main.ts deleted file mode 100644 index e1157a830a..0000000000 --- a/examples/system-test-actor/src/container/main.ts +++ /dev/null @@ -1,71 +0,0 @@ -import dgram from "dgram"; -import fs from "fs"; -import { serve } from "@hono/node-server"; -import { createNodeWebSocket } from "@hono/node-ws"; -import { createAndStartServer } from "../shared/server.js"; - -// Print hosts file contents before starting -try { - const hostsContent = fs.readFileSync("/etc/hosts", "utf8"); - console.log("=== /etc/hosts contents ==="); - console.log(hostsContent); - console.log("=== End of /etc/hosts ==="); -} catch (err) { - console.error("Failed to read /etc/hosts:", err); -} - -let injectWebSocket: any; -const { app, port } = createAndStartServer((app) => { - // Get Node.js WebSocket handler - const result = createNodeWebSocket({ app }); - injectWebSocket = result.injectWebSocket; - return result.upgradeWebSocket; -}); - -const server = serve({ fetch: app.fetch, port }); -injectWebSocket(server); - -// async function contactApi() { -// console.log('Contacting', process.env.RIVET_API_ENDPOINT); -// const res = await fetch(process.env.RIVET_API_ENDPOINT!); -// console.log('API response', res.ok, res.status); -// } -// -// contactApi(); - -// Get port from environment -const portEnv = - typeof Deno !== "undefined" - ? Deno.env.get("PORT_UDP") - : process.env.PORT_UDP; - -if (portEnv) { - // Create a UDP socket - const udpServer = dgram.createSocket("udp4"); - - // Listen for incoming messages - udpServer.on("message", (msg, rinfo) => { - console.log( - `UDP server received: ${msg} from ${rinfo.address}:${rinfo.port}`, - ); - - // Echo the message back to the sender - udpServer.send(msg, rinfo.port, rinfo.address, (err) => { - if (err) console.error("Failed to send UDP response:", err); - }); - }); - - // Handle errors - udpServer.on("error", (err) => { - console.error("UDP server error:", err); - udpServer.close(); - }); - - const port2 = Number.parseInt(portEnv); - - udpServer.bind(port2, () => { - console.log(`UDP echo server running on port ${port2}`); - }); -} else { - console.warn("missing PORT_UDP"); -} diff --git a/examples/system-test-actor/src/main.ts b/examples/system-test-actor/src/main.ts index b93c7945be..f384cf773e 100644 --- a/examples/system-test-actor/src/main.ts +++ b/examples/system-test-actor/src/main.ts @@ -20,3 +20,23 @@ createAndStartUdpServer(); if (process.env.MULTI) { connectToManager(); } + +// TOOD: move this cleaner plac +// async function contactApi() { +// console.log('Contacting', process.env.RIVET_API_ENDPOINT); +// const res = await fetch(process.env.RIVET_API_ENDPOINT!); +// console.log('API response', res.ok, res.status); +// } +// +// contactApi(); + +// TODO: Move this cleaner place +// Print hosts file contents before starting +// try { +// const hostsContent = fs.readFileSync('/etc/hosts', 'utf8'); +// console.log('=== /etc/hosts contents ==='); +// console.log(hostsContent); +// console.log('=== End of /etc/hosts ==='); +// } catch (err) { +// console.error('Failed to read /etc/hosts:', err); +// } diff --git a/examples/system-test-actor/tests/client.ts b/examples/system-test-actor/tests/client.ts index 220bb7e647..68773ed22e 100644 --- a/examples/system-test-actor/tests/client.ts +++ b/examples/system-test-actor/tests/client.ts @@ -44,13 +44,13 @@ async function run() { guard: {}, }, }, - // udp: { - // protocol: "udp", - // // internalPort: 80, - // routing: { - // host: {}, - // }, - // }, + udp: { + protocol: "udp", + // internalPort: 80, + routing: { + host: {}, + }, + }, }, }, runtime: { diff --git a/packages/core/services/cluster/src/workflows/server/install/install_scripts/files/pegboard_install.sh b/packages/core/services/cluster/src/workflows/server/install/install_scripts/files/pegboard_install.sh index 9f95a65350..fc3d453cb8 100644 --- a/packages/core/services/cluster/src/workflows/server/install/install_scripts/files/pegboard_install.sh +++ b/packages/core/services/cluster/src/workflows/server/install/install_scripts/files/pegboard_install.sh @@ -19,12 +19,6 @@ if [ "__FLAVOR__" = "container" ]; then chmod +x /usr/local/bin/rivet-container-runner fi -if [ "__FLAVOR__" = "isolate" ]; then - echo 'Downloading pegboard isolate runner' - curl -Lf -o /usr/local/bin/rivet-isolate-v8-runner "__ISOLATE_V8_RUNNER_BINARY_URL__" - chmod +x /usr/local/bin/rivet-isolate-v8-runner -fi - # For clarity FDB_VERSION="__FDB_VERSION__" diff --git a/packages/edge/infra/client/manager/src/runner/oci_config.rs b/packages/edge/infra/client/manager/src/runner/oci_config.rs index 698e349362..0743afe149 100644 --- a/packages/edge/infra/client/manager/src/runner/oci_config.rs +++ b/packages/edge/infra/client/manager/src/runner/oci_config.rs @@ -256,7 +256,7 @@ fn mounts(opts: &ConfigOpts) -> Result { { "destination": "/etc/hosts", "type": "bind", - "source": opts.actor_path.join("hosts").to_str().context("hosts path")?, + "source": opts.runner_path.join("hosts").to_str().context("hosts path")?, "options": ["rbind", "rprivate"] }, diff --git a/packages/toolchain/toolchain/src/util/docker/build_remote.rs b/packages/toolchain/toolchain/src/util/docker/build_remote.rs index b0812690e3..33ae5bea40 100644 --- a/packages/toolchain/toolchain/src/util/docker/build_remote.rs +++ b/packages/toolchain/toolchain/src/util/docker/build_remote.rs @@ -655,7 +655,7 @@ async fn poll_build_status( &ctx, crate::util::actor::logs::TailOpts { environment: CI_ENVIRONMENT_ID, - actor_id, + actor_id: actor_id.to_string(), stream: crate::util::actor::logs::LogStream::All, follow: true, print_type: crate::util::actor::logs::PrintType::Custom( diff --git a/scripts/release/docker.ts b/scripts/release/docker.ts index a32233b68d..2bf257747c 100644 --- a/scripts/release/docker.ts +++ b/scripts/release/docker.ts @@ -4,6 +4,7 @@ const REPOS = [ { name: "rivetgg/rivet-server", prefix: "slim", main: true }, { name: "rivetgg/rivet-server", prefix: "full" }, { name: "rivetgg/rivet-client", prefix: "full", main: true }, + { name: "rivetgg/rivet-client", prefix: "container-runner" }, //{ name: "rivetgg/rivet", prefix: "monolith", main: true }, ]