openshift / assisted-installer-agent

Apache License 2.0
24 stars 77 forks source link

Assisted Installer Agent

Contents

This project contains several executables that are intended to work with the OpenShift Assisted Installer Service:

The project uses the ghw library to collect the inventory and generate a unique identifier (UUID) of the host that the agent is running on.

Agent Flags

Inventory Flags

[!WARNING] The inventory process is typically executed during the agent provisioning workflow. Therefore, the inventory configuration must be set before reaching the step of calling the inventory binary.

The GPU configuration file is in YAML format with 3 elements:

The idea for filtering devices is to go from the most generic (PCI Class) to the most specific (Hardware model). If any hardware matches a generic filter it will be added to the list of GPUs. We discard the use of a single element, for example the vendor-id, because it can cause false positives. For example, Intel hardware (0x8086) can be a VGA display controller but also a sound controller. For this reason, for a vendor-id we should add a PCI class to be more precise.

Example:

---
# Include all Display controllers, VGA compatible (0x0300)
classes:
  - '0300'
# Include Nvidia (0x10de) 3D controllers (0x302)
vendors:
  - '0302 10de'
# Include Habana labs (0x1da3) Gaudi2 (0x1020) AI accelerator (0x1200)
models:
  - '1200 1da3 1020'

Example filtering only Nvidia (0x10de) display controllers:

---
# Include Nvidia (0x10de) 3D controllers (0x302)
vendors:
  - '0300 10de'
  - '0302 10de'

By default, the PCI classes discovered will be:

Packaging

By default, the executables are packaged in a container image quay.io/ocpmetal/assisted-installer-agent:latest. The executables inside the image reside under /usr/bin/.

Running

Since the agent is a statically linked go executable, it can be copied and run outside a container. If running outside a container, the agent must run as root. If running in a Podman container, the podman run command should be invoked with --net=host and --privileged.

The other tools can be invoked using podman run <flags> quay.io/ocpmetal/assisted-installer-agent:latest <executable>.

Dependencies

Building

To build the executables run: skipper make To build the container image run: skipper make build-image

Testing

For unit tests, run skipper make unit-test.

The subsystem tests use Docker Compose to run the agent and Wiremock stubs that simulate the assisted installer service. To perform the subsystem tests run skipper make subsystem.

WARNING: The subsystem tests can only run with the default image name and tag. You can build it locally just for this purpose.

To run selected system tests use a regular expression: skipper make subsystem FOCUS=register.

Publishing

To publish the container image run skipper make push. You can override the image name and tag via the ASSISTED_INSTALLER_AGENT variable.