Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
fix config generate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Oct 14, 2020
1 parent 1167180 commit 4af3269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/kubespray/script/openpai-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ def hived_config_prepare(worker_dict, node_resource_dict, pai_daemon_resource_di
logger.error("Allocatable GPU number in {0} is 0, current quick start script does not allow.".format(key))
logger.error("Please remove {0} from your workerlist, or check if the device plugin is running healthy on the node.".format(key))
sys.exit(1)
reserved_cpu = min(node_resource_allocatable[key]["cpu-resource"] * Decimal(PAI_RESERVE_RESOURCE_PERCENTAGE), PAI_MAX_RESERVE_CPU_PER_NODE)
reserved_mem = min(node_resource_allocatable[key]["mem-resource"] * Decimal(PAI_RESERVE_RESOURCE_PERCENTAGE), PAI_MAX_RESERVE_MEMORY_PER_NODE)
reserved_cpu = min(node_resource_allocatable[key]["cpu-resource"] * Decimal(PAI_RESERVE_RESOURCE_PERCENTAGE), Decimal(PAI_MAX_RESERVE_CPU_PER_NODE))
reserved_mem = min(node_resource_allocatable[key]["mem-resource"] * Decimal(PAI_RESERVE_RESOURCE_PERCENTAGE), Decimal(PAI_MAX_RESERVE_MEMORY_PER_NODE))
min_cpu = min(min_cpu, node_resource_free[key]["cpu-resource"] - pai_daemon_resource_dict["cpu-resource"] - reserved_cpu)
min_mem = min(min_mem, node_resource_free[key]["mem-resource"] - pai_daemon_resource_dict["mem-resource"] - reserved_mem)
min_gpu = min(min_gpu, node_resource_free[key]["gpu-resource"])
Expand Down

0 comments on commit 4af3269

Please sign in to comment.