#1503 expose builders' CPU count and total memory via API
Opened 4 years ago by ktdreyer. Modified 2 years ago

Sometimes builders have varying amounts of CPU and memory. This can lead to builds failing on some hosts but not others.

It's not easy to debug this unless you have shell access on the builders to run free or read /proc/cpuinfo.

It would be great to expose the CPU processor count and total memory of each builder, possibly through the getHost RPC.


(Jenkins does this for its slaves UI)

Related: #793 (it is about logging, but API is also the way)

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

4 years ago

Idea: Builder could report its configuration on login, so it would be recorded to host table. I wouldn't put it to host_config as we don't care about history of this. Maybe, that these values can also be used in getNextTask as some coefficient for multiplying available capacity? It interferers with capacity itself, but maybe we can find some usable optimization.

Host description field can be used to store this and other useful info (such as hypervisor type for virtualized builders).

koji-ansible modules make it very easy to do, eg:

- name: Configure Koji host
  local_action:
    module: koji_host
    name: "{{ inventory_hostname }}"
    arches: [x86_64]
    capacity: "{{ (ansible_processor_count, 2)|max() }}"
    description: "{{ ansible_product_name }} builder with {{ ansible_processor_count }} CPUs and {{ ansible_memtotal_mb }} MB of memory"
    comment: Added by Ansible
    channels: "{{ channels }}"

Metadata Update from @tkopecek:
- Issue tagged with: scheduler

2 years ago

Login to comment on this ticket.

Metadata