Skip to content

rofl-scheduler: Add initial ROFL scheduler #2179

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

Merged
merged 2 commits into from
May 6, 2025

Conversation

kostko
Copy link
Member

@kostko kostko commented Mar 19, 2025

Fixes #2173

Copy link

netlify bot commented Mar 19, 2025

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit f89a887
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-sdk/deploys/6819f47c074c220008277559

@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 4 times, most recently from f214f75 to 11c28a4 Compare March 26, 2025 17:40
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 2 times, most recently from fe07946 to 1068e66 Compare March 29, 2025 18:21
Copy link

codecov bot commented Mar 29, 2025

Codecov Report

Attention: Patch coverage is 3.44828% with 784 lines in your changes missing coverage. Please review.

Project coverage is 54.10%. Comparing base (56fda77) to head (6647350).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rofl-scheduler/src/manager.rs 0.00% 550 Missing ⚠️
rofl-scheduler/src/manifest.rs 30.10% 65 Missing ⚠️
rofl-scheduler/src/client.rs 0.00% 63 Missing ⚠️
rofl-scheduler/src/config.rs 0.00% 46 Missing ⚠️
runtime-sdk/src/modules/rofl/app/client.rs 0.00% 26 Missing ⚠️
runtime-sdk/src/storage/host.rs 0.00% 15 Missing ⚠️
rofl-scheduler/src/main.rs 0.00% 11 Missing ⚠️
runtime-sdk/src/modules/rofl/app/env.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2179      +/-   ##
==========================================
- Coverage   58.90%   54.10%   -4.81%     
==========================================
  Files         151      156       +5     
  Lines       11333    12123     +790     
==========================================
- Hits         6676     6559     -117     
- Misses       4657     5564     +907     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 6 times, most recently from 203ea1a to d7d878f Compare April 10, 2025 09:49
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 5 times, most recently from 496f7b8 to ce6d4df Compare April 14, 2025 14:27
@kostko kostko marked this pull request as ready for review April 14, 2025 14:27
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch from ce6d4df to e806c6d Compare April 14, 2025 16:49
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 5 times, most recently from 64000d2 to 47e618e Compare April 17, 2025 14:47
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 3 times, most recently from f329364 to ebd4a1c Compare April 17, 2025 15:37
Copy link
Contributor

@peternose peternose left a comment

Choose a reason for hiding this comment

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

Left few comments, will have another look once we merge the other PR.

[package]
name = "rofl-scheduler"
version = "0.1.0"
edition = "2021"
Copy link
Contributor

Choose a reason for hiding this comment

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

2021?

#[default]
#[serde(skip)]
#[cbor(skip)]
Invalid,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary?

@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 2 times, most recently from b9e5264 to ced75bb Compare April 18, 2025 08:26
Copy link
Member

@ptrus ptrus left a comment

Choose a reason for hiding this comment

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

First pass, the main scheduler loop looks sound!

"id" => ?instance.id,
"creator" => instance.creator,
);
local_state
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this step needed? Same below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, otherwise the unaccepted instances will never be removed. The idea is that scheduler instances will fuzzily remove instances they reject. So if no scheduler instance accepts an instance it will eventually be removed.

})
.collect();

for instance in instances {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also check if the instance is paid?

Copy link
Member Author

Choose a reason for hiding this comment

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

When you create the instance you must also pay the initial term (this is enforced by the marketplace). Otherwise the instance will not even be created. The scheduler has some time to accept an instance, otherwise it can be cancelled and refunded.

@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 6 times, most recently from d2b69ac to 99163cc Compare April 28, 2025 09:37
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch from 99163cc to b4f876c Compare May 5, 2025 11:43
slog::error!(self.logger, "task failed"; "err" => ?err);
}
Ok(Ok(_)) => {
// Ok.
Copy link
Member

Choose a reason for hiding this comment

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

Should we add some debug logging here for each finished task? Might be helpful for debugging in case there would be issues with specific tasks executing/blocking for long time?

@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch 2 times, most recently from c0b4f24 to 80b66b6 Compare May 6, 2025 11:28
@kostko kostko force-pushed the kostko/feature/rofl-scheduler branch from 80b66b6 to f89a887 Compare May 6, 2025 11:37
@kostko kostko merged commit 28069c3 into main May 6, 2025
26 checks passed
@kostko kostko deleted the kostko/feature/rofl-scheduler branch May 6, 2025 12:04
github-actions bot added a commit that referenced this pull request May 6, 2025
…ostko/feature/rofl-scheduler

rofl-scheduler: Add initial ROFL scheduler 28069c3
github-actions bot added a commit that referenced this pull request May 6, 2025
…/kostko/feature/rofl-scheduler

rofl-scheduler: Add initial ROFL scheduler 28069c3
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request May 6, 2025
…sisprotocol/kostko/feature/rofl-scheduler

rofl-scheduler: Add initial ROFL scheduler 28069c3
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request May 6, 2025
…oasisprotocol/kostko/feature/rofl-scheduler

rofl-scheduler: Add initial ROFL scheduler 28069c3
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.

Implement a ROFL app scheduler
3 participants