Skip to content

feat(pb): get multi-actors working e2e, add resources for builds #2465

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

Open
wants to merge 1 commit into
base: 05-16-feat_pb_add_runner_logs
Choose a base branch
from

Conversation

MasterPtato
Copy link
Contributor

Changes

Copy link
Contributor Author

MasterPtato commented May 21, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

cloudflare-workers-and-pages bot commented May 21, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a56a42
Status:🚫  Build failed.

View logs

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR implements multi-actor support and resource management for builds, with significant changes across the codebase to support allocation types and optional resource specifications.

  • Added new BuildsAllocation types in SDKs to support both single and multi-slot allocations, with proper serialization and validation
  • Made actor resources optional by changing resources field from required to optional in ActorsActor type, affecting database schema and API endpoints
  • Renamed build-related types for better consistency (e.g., BuildsBuildKind -> BuildsKind, BuildsBuildCompression -> BuildsCompression)
  • Fixed critical bug in managerClient.ts where signal_actor handler incorrectly references packet.start_actor instead of packet.signal_actor
  • Added proper resource validation in pegboard service based on build allocation type (None, Single, Multi) with CPU millicores and memory MiB specifications

139 file(s) reviewed, 44 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -41,8 +37,7 @@ export function createAndStartServer(
const query = c.req.query("code");
const exitCode = query ? Number(query) : 0;

if (typeof Deno != "undefined") Deno.exit(exitCode);
else process.exit(exitCode);
process.exit(exitCode);

return c.text("unreachable");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: unreachable code after process.exit() should be removed

import { createAndStartUdpServer } from "./udpServer.js";
import { connectToManager } from "./managerClient.js";

let injectWebSocket: any;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: avoid using 'any' type - should define proper type from @hono/node-ws

Comment on lines +15 to +16
const server = serve({ fetch: app.fetch, port });
injectWebSocket(server);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: server instance should be handled for graceful shutdown (e.g., process.on('SIGTERM'))


createAndStartUdpServer();

if (process.env.MULTI) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: use explicit boolean check for environment variable

Suggested change
if (process.env.MULTI) {
if (process.env.MULTI === 'true') {

});


const port2 = Number.parseInt(portEnv);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: port validation should happen before socket creation to avoid creating resources that may need cleanup

Comment on lines 24 to 25
#[serde(rename = "content_length")]
pub content_length: i64,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: content_length is typed as i64 but documented as 'Unsigned 64 bit integer' - this could allow negative values when it shouldn't

Suggested change
#[serde(rename = "content_length")]
pub content_length: i64,
#[serde(rename = "content_length")]
pub content_length: u64,




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Missing explicit serde crate import. While it may work due to prelude, explicit imports improve code clarity

Comment on lines +7 to +10
export interface Allocation {
single?: Rivet.builds.AllocationSingle;
multi?: Rivet.builds.AllocationMulti;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Both fields being optional (marked with ?) means an Allocation could potentially have neither single nor multi set. Consider if this is the intended behavior or if at least one should be required.

);

export declare namespace Kind {
export type Raw = "docker_image" | "oci_bundle" | "javascript";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Raw type should be marked as readonly to prevent accidental modification of valid enum values

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Removing this file will break build compression type serialization unless this functionality has been moved elsewhere. Need to verify that equivalent functionality exists in another location before proceeding with deletion.

@MasterPtato MasterPtato force-pushed the 05-16-feat_pb_add_runner_logs branch from 9b820e0 to ed03e29 Compare May 27, 2025 02:02
@MasterPtato MasterPtato force-pushed the 05-21-feat_pb_get_multi-actors_working_e2e_add_resources_for_builds branch from d94da15 to 14ec025 Compare May 27, 2025 02:02
Copy link

cloudflare-workers-and-pages bot commented May 27, 2025

Deploying rivet-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a56a42
Status:🚫  Build failed.

View logs

Copy link

cloudflare-workers-and-pages bot commented May 27, 2025

Deploying rivet-hub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a56a42
Status:🚫  Build failed.

View logs

@MasterPtato MasterPtato force-pushed the 05-21-feat_pb_get_multi-actors_working_e2e_add_resources_for_builds branch from 6a71c38 to 8eb564a Compare June 20, 2025 19:09
@MasterPtato MasterPtato force-pushed the 05-16-feat_pb_add_runner_logs branch from 869e278 to 3d46e7d Compare June 20, 2025 19:09
@MasterPtato MasterPtato force-pushed the 05-21-feat_pb_get_multi-actors_working_e2e_add_resources_for_builds branch from 8eb564a to f1efbe3 Compare June 20, 2025 19:52
@MasterPtato MasterPtato force-pushed the 05-16-feat_pb_add_runner_logs branch from 3d46e7d to 3917cbb Compare June 20, 2025 19:52
@MasterPtato MasterPtato force-pushed the 05-21-feat_pb_get_multi-actors_working_e2e_add_resources_for_builds branch from f1efbe3 to bad492a Compare June 20, 2025 19:54
@MasterPtato MasterPtato force-pushed the 05-16-feat_pb_add_runner_logs branch from 3917cbb to 55980f3 Compare June 20, 2025 19:54
@NathanFlurry NathanFlurry force-pushed the 05-21-feat_pb_get_multi-actors_working_e2e_add_resources_for_builds branch from bad492a to 952db69 Compare June 20, 2025 19:57
@NathanFlurry NathanFlurry force-pushed the 05-16-feat_pb_add_runner_logs branch from 55980f3 to 5677a5b Compare June 20, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant