Skip to content
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

[ENH][chroma-load] Support delay on workloads. #3210

Merged
merged 4 commits into from
Dec 3, 2024
Merged

[ENH][chroma-load] Support delay on workloads. #3210

merged 4 commits into from
Dec 3, 2024

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented Nov 27, 2024

This supports delaying a workload. The way it's implemented, workloads
advertise being "active" and just silently NOP when they are "inactive".

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea that we define the workloads as Rust programs entirely? I guess I'm a little confused on when they are "named" versus being defined here inside a main? Also, should these just be in a test case somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are "datasets", "workloads" and composed "running workloads". A dataset + workload becomes a running workload. Names refer to workloads in workloads.rs as pre-defined patterns that can be referred to from another workload. Thus, "by name" can refer to a rust-defined workload, but any json workload can be specified and it will just work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for the clarification.

Workload::Get(_) => true,
Workload::Query(_) => true,
Workload::Hybrid(hybrid) => hybrid.iter().any(|(_, w)| w.is_active()),
Workload::Delay { after, wrap } => chrono::Utc::now() >= *after && wrap.is_active(),
Copy link
Contributor

Choose a reason for hiding this comment

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

From my understanding the delay workload will be run after a specific timestamp. This seems to imply that the same workflow config can only be used once (or some other script have to generate the config with a timestamp each time it run). May I ask why this is designed like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was largely an artifact of not thinking about my types. Will update.

Base automatically changed from rescrv/load3 to main December 3, 2024 00:54
This supports delaying a workload.  The way it's implemented, workloads
advertise being "active" and just silently NOP when they are "inactive".
chroma-load-start       start a workload
chroma-load-stop        stop a workload
chroma-load-inhibit     stop all workloads
chroma-load-uninhibit   reverse the effects of chroma-load-inhibit
@rescrv rescrv requested a review from Sicheng-Pan December 3, 2024 19:10
@rescrv rescrv merged commit 9ec6b33 into main Dec 3, 2024
71 checks passed
@rescrv rescrv deleted the rescrv/load4 branch December 3, 2024 19:15
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.

3 participants