Class: BeakerHostGenerator::Hypervisor::ABS

Inherits:
Interface
  • Object
show all
Includes:
Data
Defined in:
lib/beaker-hostgenerator/hypervisor/abs.rb

Overview

AlwaysBeScheduling implementation to support CI.next.

The ABS services requires the vmpooler template values as input to determine the type of platform that’s being requested.

Therefore, this hypervisor just reuses the vmpooler hypervisor template values, in addition to ABS-only values for hardware platforms.

Constant Summary

Constants included from Data

Data::BASE_CONFIG, Data::MAIN_PE_VERSION, Data::PE_TARBALL_SERVER, Data::PE_USE_WIN32

Instance Method Summary collapse

Methods included from Data

base_host_config, generate_osinfo, get_osinfo, get_platform_info, get_platforms, osinfo, osinfo_bhgv1, pe_dir, pe_upgrade_version, pe_version

Methods inherited from Interface

#global_config, #initialize

Constructor Details

This class inherits a constructor from BeakerHostGenerator::Hypervisor::Interface

Instance Method Details

#generate_node(node_info, base_config, bhg_version) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/beaker-hostgenerator/hypervisor/abs.rb', line 17

def generate_node(node_info, base_config, bhg_version)
  # Grab vmpooler data for this platform and any hardware (ABS) data.
  # The assumption here is that these are mutually exclusive; that is,
  # any given platform will have *either* :vmpooler data or :abs data
  # so we're not worried about one overriding the other when we merge
  # the hashes together.
  base_config = base_generate_node(node_info, base_config, bhg_version, :vmpooler, :abs)

  case node_info['ostype']
  when /^(almalinux|centos|oracle|redhat|rocky|scientific)/
    base_config['template'] ||= base_config['platform']&.gsub(/^el/, ::Regexp.last_match(1))
  when /^aix/, /^fedora/, /^opensuse/, /^panos/
    base_config['template'] ||= base_config['platform']
  when /^(debian|ubuntu|amazon)/
    os = Regexp.last_match(1)
    base_template = node_info['ostype'].sub(os, "#{os}-")
    arch = case node_info['bits']
           when '64'
             'x86_64'
           when '32'
             'i386'
           when 'AARCH64'
             'arm64'
           when 'POWER'
             base_template.sub!(/#{os}-(\d\d)/, "#{os}-\1.")
             'power8'
           else
             raise "Unknown bits '#{node_info['bits']}' for '#{node_info['ostype']}'"
           end
    base_config['template'] ||= "#{base_template}-#{arch}"
  when /^osx/
    base_config['template'] ||= base_config['platform']&.gsub(/^osx/, 'macos')
  end

  base_config
end