-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35af765
commit 9fa2b81
Showing
19 changed files
with
1,171 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include <faabric/batch-scheduler/BatchScheduler.h> | ||
#include <faabric/batch-scheduler/SchedulingDecision.h> | ||
#include <faabric/util/batch.h> | ||
|
||
namespace faabric::batch_scheduler { | ||
|
||
// This batch scheduler behaves in the same way than BinPack for NEW and | ||
// SCALE_CHANGE requests, but for DIST_CHANGE requests it tries to compact | ||
// to the fewest number of VMs. | ||
class SpotScheduler final : public BatchScheduler | ||
{ | ||
public: | ||
std::shared_ptr<SchedulingDecision> makeSchedulingDecision( | ||
HostMap& hostMap, | ||
const InFlightReqs& inFlightReqs, | ||
std::shared_ptr<faabric::BatchExecuteRequest> req) override; | ||
|
||
private: | ||
bool isFirstDecisionBetter( | ||
std::shared_ptr<SchedulingDecision> decisionA, | ||
std::shared_ptr<SchedulingDecision> decisionB) override; | ||
|
||
bool isFirstDecisionBetter(HostMap& hostMap, | ||
std::shared_ptr<SchedulingDecision> decisionA, | ||
std::shared_ptr<SchedulingDecision> decisionB); | ||
|
||
std::vector<Host> getSortedHosts( | ||
HostMap& hostMap, | ||
const InFlightReqs& inFlightReqs, | ||
std::shared_ptr<faabric::BatchExecuteRequest> req, | ||
const DecisionType& decisionType) override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.