Skip to content
Open
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
54 changes: 52 additions & 2 deletions Cargo.lock

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

19 changes: 11 additions & 8 deletions engine/proto/engine.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";
package engine;
service Engine {
rpc AquireTask(TaskRequest) returns (Task);
rpc AquireTaskBlock(TaskBlockRequest) returns (TaskBlock);
rpc AquireTaskReg(empty) returns (TaskRegistry);
rpc PublishTask(Task) returns (empty);
rpc PublishTaskBlock(TaskBlock) returns (empty);
rpc cgrpc(cgrpcmsg) returns (cgrpcmsg);
rpc CreateTask(Task) returns (Task);
rpc DeleteTask(TaskSelector) returns (empty);
rpc CreateTaskBlock(TaskBlock) returns (TaskBlock);
rpc DeleteTaskBlock(TaskSelector) returns (empty);
rpc GetTasks(TaskPageRequest) returns (TaskPage);
rpc CheckAuth(empty) returns (empty);
rpc GetMetadata(empty) returns (ServerMetadata);
Expand All @@ -30,8 +30,8 @@ message TaskSelector {
message empty {}
enum TaskState {
QUEUED = 0;
PROCESSING = 1;
SOLVED = 2;
SOLVED = 1;
LEASED = 2;
}
message TaskPageRequest {
string namespace = 1;
Expand Down Expand Up @@ -59,13 +59,16 @@ message TaskRegistry {
repeated string tasks = 1; // namespace:task
}

message TaskRequest {
message TaskBlockRequest {
string task_id = 1; // namespace:task
// bytes payload = 2;
uint32 block_size = 2;
}
message Task {
string id = 4; // the task unique identifier
bytes task_payload = 1;
string task_id = 2; // namespace:task
bytes payload = 3;
}
message TaskBlock {
repeated Task tasks = 1;
}
15 changes: 7 additions & 8 deletions engine/src/bin/client.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
use enginelib::{
Registry,
api::EngineAPI,
events::Events,
event::info,
plugin::LibraryInstance,
prelude::debug,
Registry, api::EngineAPI, event::info, events::Events, plugin::LibraryInstance, prelude::debug,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Update the client to the current API type.

This binary still imports and threads EngineAPI, but that symbol no longer exists in enginelib::api, so the client target does not compile. The client needs to be migrated to the refactored API surface before this can merge.

Also applies to: 18-22, 26-28, 48-53, 173-173

🧰 Tools
🪛 GitHub Actions: Rust / 0_Rust project - latest (stable).txt

[error] 2-2: E0432: unresolved import enginelib::api::EngineAPI — no EngineAPI in api

🪛 GitHub Actions: Rust / 1_Rust project - latest (nightly).txt

[error] 2-2: rustc --crate-name client failed: unresolved import enginelib::api::EngineAPI (no EngineAPI in api). Error[E0432].

🪛 GitHub Actions: Rust / 2_Rust project - latest (beta).txt

[error] 2-2: Rustc E0432: unresolved import enginelib::api::EngineAPI (no EngineAPI in api).

🪛 GitHub Actions: Rust / Rust project - latest (beta)

[error] 2-2: E0432 unresolved import: enginelib::api::EngineAPI (no EngineAPI in api)

🪛 GitHub Actions: Rust / Rust project - latest (nightly)

[error] 2-2: rustc error[E0432]: unresolved import enginelib::api::EngineAPI (no EngineAPI in api). Command: /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name client ... --crate-type bin ...

🪛 GitHub Actions: Rust / Rust project - latest (stable)

[error] 2-2: error[E0432]: unresolved import enginelib::api::EngineAPI (no EngineAPI in api).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@engine/src/bin/client.rs` at line 2, The client imports and references the
removed symbol `api::EngineAPI` (and threads it through code using `Registry`,
`events::Events`, `plugin::LibraryInstance`, etc.), so update all imports and
signatures to the refactored API surface: remove `api::EngineAPI` from the use
list, import the new API type(s) exported from `enginelib::api` (replace
`EngineAPI` usages with the current type name(s)), update function signatures
and variables that accept or return `EngineAPI` to the new type, and adapt any
method calls to the new API methods; ensure `Registry`, `Events`, and
`LibraryInstance` usages call the new API surface where they previously relied
on `EngineAPI`.

};
use proto::engine_client;
use std::{collections::HashMap, error::Error, sync::Arc};
Expand Down Expand Up @@ -88,14 +83,18 @@ async fn worker_loop(
continue;
}
Err(status) => {
debug!("worker {}: acquire failed for {}: {:?}", worker_id, task_id, status);
debug!(
"worker {}: acquire failed for {}: {:?}",
worker_id, task_id, status
);
continue;
}
};

let task_payload = task_req.get_mut();

let acquired_payload = Arc::new(std::sync::RwLock::new(task_payload.task_payload.clone()));
let acquired_payload =
Arc::new(std::sync::RwLock::new(task_payload.task_payload.clone()));
Events::TaskAcquired(
api.as_ref(),
task_id.clone(),
Expand Down
Loading
Loading