Open johny-b opened 2 years ago
market ...
plus, I guess the rescoring should be somehow bound to the job - since we might be scoring offers differently depending on the demand ...
so, it seems to me that the interface should be Golem.rescore_offers(provider_id, job_id)
... but also -> what happens them? are those offers just again sent to the strategy's score_offer
?
anyway, I just sent you @johny-b my thoughts on strategy in Golem on priv... I think we should make the strategy more explicitly bound to the task at hand rather than allowing it to be changed randomly...
<3 market <3
@shadeofblue
Yes, I think offers should be just resent to score_offer
About the rest - hmm, I'm not sure, but the current implementation is a little confusing for me:
golem.strategy
job
we're scoring offer for (job_id
is not available in score_offer
)I understand that the sets are different, because with different payloads we have different offers (and we might e.g. want to negotiate in a different way). But still, I don't see a reason why a raw offer on the market has two scores for two different jobs, when there is no logic that would let us score them differently.
As discussed today with @stranger80 and @shadeofblue:
AgreementPool
will listen on some events emitted directly from the MarketStrategy
(this might have nothing to do with the current yapapi
events).
B) Extended MarketStrategy
interface: MarketStrategy
would have a queue/generator/whatever that always returns the current best offer.
Our current take is that B seems better, mostly because it is much more flexible (i.e. this interface will let us implement much more complex strategies in the future).B
seems to be not-very-hard to implement without any backward incompatible changes (MarketStrategy
would internally consume raw offers, call self.score_offer
, keep stored offers and return those that have highest scores). B
is quite similar to the offer_generator
concept from the "mid-level API concept" (aka "yapapi dream interface"), so maybe they should be somehow considered together.
AgreementsPool.offer_recycler
.engine.recycle_offer
exactly for this purpose.The only problem is to decide the interface, few ad-hoc ideas:
Golem.rescore_offer(offer: OfferProposal)
<- that's probably not very good, since currently there's no direct access to the past proposalsGolem.rescore_offers(provider_id: str)
<- probably a pretty good oneALSO:
yapapi
yapapi.contrib.strategy.ProviderFilter
)