Skip to content

[cleanup] Refactor Eldritch Runtime#577

Merged
Cictrone merged 1 commit intomainfrom
eldritch-runtime
Feb 11, 2024
Merged

[cleanup] Refactor Eldritch Runtime#577
Cictrone merged 1 commit intomainfrom
eldritch-runtime

Conversation

@KCarretto
Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Updates eldritch::Runtime to manage it's own thread, since callers were being forced to call it in a separate thread anyways. Now we support an eldritch::start API for running tomes in a separate thread, which returns a Runtime. The Broker has been removed, and now Runtime is the callers interface to interact with the running eldritch thread. We have also renamed the eldritch::Client to eldritch::Environment, which is still intended to be used by eldritch functions to interface with the caller (request files, report processes, etc.)

Example Usage
let mut runtime = eldritch::start(eldritch::pb::Tome{...});

// The tome is now executing, we can begin checking for output
let _output = runtime.collect_text();

// ...

// Wait for the tome to finish
runtime.finish().await;

@KCarretto KCarretto requested review from Cictrone and hulto February 11, 2024 21:41
Copy link
Copy Markdown
Collaborator

@Cictrone Cictrone left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 11, 2024

Codecov Report

Attention: 53 lines in your changes are missing coverage. Please review.

Comparison is base (05a2be7) 70.88% compared to head (b6d1577) 70.78%.

Files Patch % Lines
implants/lib/eldritch/src/runtime/exec.rs 77.31% 22 Missing ⚠️
implants/imix/src/task.rs 0.00% 9 Missing ⚠️
implants/imix/src/install.rs 0.00% 7 Missing ⚠️
implants/lib/eldritch/src/runtime/drain.rs 66.66% 7 Missing ⚠️
implants/imix/src/agent.rs 0.00% 2 Missing ⚠️
implants/lib/eldritch/src/assets/copy_impl.rs 88.88% 2 Missing ⚠️
implants/lib/eldritch/src/runtime/environment.rs 84.61% 2 Missing ⚠️
implants/golem/src/main.rs 91.66% 1 Missing ⚠️
implants/lib/eldritch/src/runtime/mod.rs 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
- Coverage   70.88%   70.78%   -0.10%     
==========================================
  Files         141      141              
  Lines       10225    10184      -41     
==========================================
- Hits         7248     7209      -39     
+ Misses       2811     2809       -2     
  Partials      166      166              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cictrone Cictrone merged commit 580f5cd into main Feb 11, 2024
@Cictrone Cictrone deleted the eldritch-runtime branch February 11, 2024 21:59
nullmonk pushed a commit that referenced this pull request Feb 14, 2024
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.

2 participants