The scc-hypervisor-collector
is a tool that can be used to retrieve basic
details (UUID, vCPU topology, RAM) from configured hypervisor backends, and
upload them to the SUSE Customer Center using the configured credentials.
The scc-hypervisor-collector
primarily depends on:
- A supported Python 3 (>=3.6) interpreter
- uyuni/virtual-host-gatherer >= 1.0.23
- pyyaml >= 6.0
Additionally the man pages generation process depends on the following tools being available:
This project uses the following tools as part of the development process:
tox
to manage testing, including support for multiple Python interpreter versions usingpyenv
.bumpversion
to manage version updates.pandoc
to generate man pages from Markdown inputs. See man pages README- optionally
black
to manage code style/layout.
In the bin directory a number of helper scripts are provided:
create-venv
- creates a venv containing the tools (listed above) required to support development.command-wrapper
- a generic command wrapper that can be symlinked to a command name, and when invoked via that symlink will look for the named command in the venv, or failing that will try and run it from the host environment.tox
- acommand-wrapper
symlink that can be used to runtox
.bumpversion
andbump2version
-command-wrapper
symlinks that can be used to run thebumpversion
andbump2version
commands.black
- acommand-wrapper
symlink that can be used to runblack
.tox_dev-wrapper
- a generic command wrapper that can be symlinked to a command name, and when invoked via that symlink will look for the named command in thetox
created.tox/dev
venv, or failing that will try and run it from the host environment. If you haven't yet created the.tox/dev
venv it will exit with a message telling you to runbin/tox -e dev
to create the venv.scc-hypervisor-collector
andvirtual-host-gatherer
-tox_dev-wrapper
symlinks that can be used to run thescc-hypervisor-collector
andvirtual-host-gatherer
commands.
NOTE:
pandoc
is not available as a helper script and instead should be installed via your local package manager.
The [tox.ini] file is configured to run the following tests:
cli
- a simple test to runscc-hypervisor-collector --help
to verify the command can be run from an installed environment.check
- this test checks the code for compliance with recommended Python coding practices usingflake8
,pylint
andmypy
(for data typing).py<version>-cover
- runpytest
with/without coverage checking for various potential Python versions; missing Python versions will be skipped.
Additional tests are also available to be run:
py<version>-nocov
- runpytest
without coverage checking against installed versions of the code for various potential Python versions; missing Python versions will be skipped.dev
- installs the package's dependencies and then installs the package itself in developer mode, allowing you to run the code locally for adhoc testing purposes viabin/scc-hypervisor-collector
.
If you have pyenv installed you can enable testing against the various supported Python interpreter versions by running the following command:
% pyenv local 3.6.15 3.7.13 3.8.13 3.9.12 3.10.4
Note that this only enables those Python interpreter versions (the latest for
each of the supported Python 3.x streams at the time of writing) for use with
tox driven testing. You will still need to install the relevant versions of
the Python interpreter using pyenv install <version>
for them to actually be
available for use by tox
.
An RPM spec file is provided which is ready to be used by the openSUSE Build Service (OBS).
Additionally a Dockerfile (suitable for building a container image in OBS) and an accompanying entrypoint script are provided in the container directory.
See the man pages for details about running the command locally.
See Security Recommendations for further details about ensuring the configuration settings and runtime environment for the command are correctly setup.
See Container Deployment for details on how to run the command using a container image built using the Dockerfile and the Open Build Service.
The tool is broken down into a number of component APIs which are implemented as
subpackages within the main scc-hypervisor-collector
package.
The config directory and files provided as arguments for the tool has sensitive information that needs to be protected. The tool requires these to be owned by the user running the tool. The permissions on these config files need to be read/write (0600) and the config directory should be user access only (0700) for the user that will run the tool. The tool cannot be run with root privileges.
TBD
TBD
TBD
TBD
TBD
TBD