Files
ubicloud/migrate/20230919_add_vm_pool.rb
Furkan Sahin 4ed3778c91 Adds Vm Pools
With this commit, we are adding the initial version of vm pools. The
idea is to reduce the provisioning time for github runners down by
eliminating the initial provisioning time.

We simply have a strand in a default project that keeps provisioning VMs
until the statically defined `size` is hit. As long as there are
available VMs, GithubRunner first picks them from the pool. If not, the
provisioning of a new VM starts. Whenever the VM size in the pool drops
below `size`, we start provisioning a new VM.

In this version of the pool, we have 1 pool per runner_label. In future
versions, we might specialize it even further for a customer and isolate
their pool, if needed.
2023-09-26 09:58:47 +02:00

18 lines
439 B
Ruby

# frozen_string_literal: true
Sequel.migration do
change do
create_table(:vm_pool) do
column :id, :uuid, primary_key: true, default: nil
column :size, :integer, null: false
column :vm_size, :text, null: false
column :boot_image, :text, null: false
column :location, :text, null: false
end
alter_table(:vm) do
add_foreign_key :pool_id, :vm_pool, type: :uuid, null: true
end
end
end