backend.daemons.vm_master¶
-
class
backend.daemons.vm_master.
VmMaster
(opts, vmm, spawner, checker)[source]¶ Spawns and terminate VM for builder process.
-
_check_total_running_vm_limit
(group)[source]¶ Checks that number of VM in any state excluding Terminating plus number of running spawn processes is less than threshold defined by BackendConfig.build_group[group][“max_vm_total”]
-
_check_elapsed_time_after_spawn
(group)[source]¶ Checks that time elapsed since latest VM spawn attempt is greater than threshold defined by BackendConfig.build_group[group][“vm_spawn_min_interval”]
-
_check_number_of_running_spawn_processes
(group)[source]¶ Check that number of running spawn processes is less than threshold defined by BackendConfig.build_group[][“max_spawn_processes”]
-
_check_total_vm_limit
(group)[source]¶ Check that number of running spawn processes is less than threshold defined by BackendConfig.build_group[][“max_spawn_processes”]
-
finalize_long_health_checks
()[source]¶ After server crash it’s possible that some VM’s will remain in check_health state Here we are looking for such records and mark them with check_health_failed state
-
terminate_again
()[source]¶ If we failed to terminate instance request termination once more. Non-terminated instance detected as vm in the terminating state with
time.time() - terminating since > ThresholdIt’s possible, that VM was terminated but termination process doesn’t receive confirmation from VM provider, but we have already got a new VM with the same IP => it’s safe to remove old vm from pool
-