This commit simply skips the pool_id set nil step in pick_vm. This way, the VM will be seen as part of the pool until it is destroyed. This will result in much softer pool provisioning characteristics. We will make sure that we will only provision a new VM only when the one in the pool is destroyed. This change decreases the capacity need to use pool to 2x at the worst case scenario, while it was 3x in the previous implementation. To make sure the VM is not allocated twice to different GithubRunners, we check the entities in the pick_vm function. We have also added a new unique constraint to the github_runner table just to avoid any bug.
10 lines
151 B
Ruby
10 lines
151 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
change do
|
|
alter_table(:github_runner) do
|
|
add_unique_constraint :vm_id
|
|
end
|
|
end
|
|
end
|