-
Notifications
You must be signed in to change notification settings - Fork 2
feat: prerequisites check step as Step 1 in start #51
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a dedicated prerequisites check step to validate that all required binaries and Docker images are available before starting the cluster. This improves the fail-fast behavior and provides clearer error messages to users when components are missing.
Changes:
- Adds
PrerequisitesCheckStepas the first step in the parallel execution startup sequence - Centralizes binary and image checks using new constants
REQUIRED_BINARIESandREQUIRED_DOCKER_IMAGES - Removes duplicate image and binary checking logic from the Lotus step
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/constants.rs |
Adds REQUIRED_BINARIES and REQUIRED_DOCKER_IMAGES constants to centralize the list of required components for cluster startup |
src/commands/status/build_status.rs |
Updates to use the shared REQUIRED_BINARIES constant instead of maintaining a separate list |
src/commands/start/prerequisites_check.rs |
New module implementing the prerequisites check step with binary and Docker image validation |
src/commands/start/mod.rs |
Adds PrerequisitesCheckStep as Epoch 1 in the parallel execution pipeline and updates epoch documentation |
src/commands/start/lotus/prerequisites.rs |
Removes the now-redundant check_image_and_binary() function |
src/commands/start/lotus/lotus_step.rs |
Removes the call to the deleted check_image_and_binary() function |
| if !missing_binaries.is_empty() { | ||
| let missing_list = missing_binaries.join("', '"); | ||
| return Err(format!( | ||
| "Missing required binaries: '{}'\n\nPlease run 'foc-devnet build ...' to build all binaries, \ |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message says "Please run 'foc-devnet build ...' to build all binaries" but this is incorrect syntax. Based on the rest of the message, it should either say "foc-devnet build" (without "...") to build all binaries, or provide the correct command. The ellipsis "..." is confusing as it's not a valid shell command.
| "Missing required binaries: '{}'\n\nPlease run 'foc-devnet build ...' to build all binaries, \ | |
| "Missing required binaries: '{}'\n\nPlease run 'foc-devnet build' to build all binaries, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redpanda-f why was this closed? An all would be great but I don't think we have that, and ... isn't a thing as far as I can tell. Or maybe this error msg could be rephrased? I read it as "run this to build all together, or run this to build them individually".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is I don't want this to be confused with "foc-devnet build" being a command itself.
Co-authored-by: Copilot <[email protected]>
| "Missing required binaries: '{}'\n\nPlease run 'foc-devnet build ...' to build all binaries, \ | ||
| or build specific binaries with 'foc-devnet build <name>' (e.g., 'foc-devnet build lotus' or 'foc-devnet build curio')", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "Missing required binaries: '{}'\n\nPlease run 'foc-devnet build ...' to build all binaries, \ | |
| or build specific binaries with 'foc-devnet build <name>' (e.g., 'foc-devnet build lotus' or 'foc-devnet build curio')", | |
| "Missing required binaries: '{}'\n\nPlease build them with 'foc-devnet build <name>' \ | |
| (e.g., 'foc-devnet build lotus' or 'foc-devnet build curio')", |
let's make it clearer then, I still want there to be a build all, and the lack of something like that makes this message confusing otherwise.
rvagg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving but assuming that the confusing message will be fixed before merge
BigLep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if:
- Any README_ADVANCED.md updates required?
- Can we also address #29 as part of this work
| pub const PORTAINER_DOCKER_IMAGE: &str = "foc-portainer"; | ||
|
|
||
| /// Required binaries for cluster startup | ||
| pub const REQUIRED_BINARIES: &[&str] = &[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check for Docker as part of #29 ?
| /// - Epoch 4: MockUSDFC Deploy + MultiCall3 Deploy + FOC Deploy (can be parallelized) | ||
| /// - Epoch 5: MockUSDFC Funding + Curio daemons (can be parallelized, needs FOC Deploy) | ||
| /// - Epoch 6: PDP SP Registration (needs Curio daemons started) | ||
| /// - Epoch 1: Prerequisites check (binaries & Docker images - must run first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the README_ADVANCED.md also get updated?
Created a distinct step
PrerequisitesCheckStepbeforestartactually does anything meaningful.