threefoldtecharchive / farmerbot

ability to manage a farm
Apache License 2.0
4 stars 0 forks source link

Allow farmers to prioritize the utilization of certain nodes #50

Closed Mik-TF closed 1 month ago

Mik-TF commented 1 year ago

This is a feature proposition for the farmerbot.

As of now, when users deploy on the playground on a given farm, the farmerbot will most likely deploy on the "never_shutdown" 3node. In this regard, the farmer can wisely choose this 3Node to be of low energy consumption.

Once this 3Node is fulled, which other 3Node would be chosen to have workloads? As of now, I don't think there are "priority" on the farmerbot's side.

Thus we could either have an automatic process, the farmerbot chooses the smaller 3node to deploy on, or a more "configurable" process, the farmer can set a configuration parameter in the farmerbot config.md file where they give priority to the 3nodes.

For example, with the second process proposed, say the farmers has 4 nodes, they have 1 never_shutdown node, and they give priority 1, 2, 3 to the 3 remaining 3nodes. Thus, the node with priority 1 would have workload first, etc.

This would give the possibility for farmers to prioritize smaller nodes, or even their most "profitable" nodes.

I hope this is clear. I can give more details if needed.


This idea was discussed/elaborated with @scottyeager and @weynandkuijpers

brandonpille commented 1 year ago

Makes sense. It's also a very small change: it's just a matter of reordering the nodes at startup of the farmerbot. But to be clear, this should be the priority of choosing a node, right?

  1. Nodes that are already up should get priority
  2. After that we check on the priority that the farmer provided
Mik-TF commented 1 year ago

@brandonpille I think your 2 points above are exactly what we're looking for. Great!

So in this situation the never_shutdown node would be option (1), it would get workloads first, then once this never_shutdown node is full of workloads, the option (2) would kick in and the 3Node decided by the farmer would get the additional deployments of the farm.

brandonpille commented 1 year ago

Yes exactly that! I'll implement it soon. I also renamed the title of the issue, I hope that's ok.

Mik-TF commented 1 year ago

Once this is implemented and tested, I could add the necessary codes in the file creator to take into account this new feature.

Let me know what you think and if there is a best way forward for this.