-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(gadget-sdk): improve MultiJobRunner
builder
#382
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.
Looks good.
/// This provides a [`Default`] impl for a zeroed-out [`PriceTargets`]. | ||
/// | ||
/// [`PriceTargets`]: tangle_subxt::tangle_testnet_runtime::api::runtime_types::tangle_primitives::services::PriceTargets | ||
pub struct PriceTargets(TangleSubxtPriceTargets); |
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.
We can provide a default implementation in subxt and remove this wrapper. But it is good for now.
Just my How about a compromise: let price_targets = PriceTargets {
cpu: 5,
mem: 10,
storage_hdd: 15,
storage_ssd: 20,
storage_nvme: 25
};
MultiJobRunner::new(env)
.job(x_square)
.with_price_targets(price_targets)
.job(x_square2)
.job(x_square3)
.with_default_price_targets()
.job(s_square4)
[...]
.run()
.await? |
@tbraun96 the tuples are just for convenience, they actually get converted to let price_targets = PriceTargets {
cpu: 5,
mem: 10,
storage_hdd: 15,
storage_ssd: 20,
storage_nvme: 25
};
// These two are equivalent
MultiJobRunner::new(env)
.job((x_square2, price_targets))
MultiJobRunner::new(env)
.job(JobBuilder::new(x_square2).price_targets(price_targets))
// As are these
MultiJobRunner::new(env)
.job(x_square)
MultiJobRunner::new(env)
.job(JobBuilder::new(x_square)) |
Oh cool |
@tbraun96 I'm still surprised how you think this makes sense
What are the price targets for the jobs? Is it the price target after it's specified? What about |
@Serial-ATA @Tjemmmic we should meet or you two should to discuss ensuring the Eigenlayer runner is also made compatible with this system. |
Jobs can be built using tuples now. Some comparisons:
Default price targets
Old
New
Custom price targets
Old
New
closes #371