pyHDLC Reference

Functions

pyHDLC.BuildImage(image: Union[str, List[str]], registry: str = 'ghcr.io/hdl', collection: str = 'debian/trixie', architecture: str = 'amd64', dockerfile: str = None, target: str = None, argimg: str = None, pkg: bool = False, dry: bool = False, default: bool = False, test: bool = False) None

Build and optionally test container image(s).

Parameters:
  • image – Bare image name(s), without registry, collection or architecture. The supported syntax for each image name is name[#location], where the optional location is ignored during the build if provided (it’s used for testing only, see TestImage()).

  • registry – Optionally, set the prefix of the registry.

  • collection – Optionally, set the collection to build the image from.

  • architecture – Optionally, set the architecture to build the image for.

  • dockerfile – Optionally, set the Dockerfile to build the image with.

  • target – Optionally, set the target stage in the dockerfile.

  • argimg – Optionally, set the build argument IMAGE.

  • pkg – Optionally, specify explicitly whether the image to be built is a package image.

  • dry – Do not build the image, just print the command(s) that would be executed.

  • default – Instead of providing all of the parameters, get them from the YAML configuration file.

  • test – Test the image(s) after building.

class pyHDLC.ConfigImages(HDLCI: int = None, _anchors: ~typing.Dict = <factory>, images: ~typing.Dict[str, ~pyHDLC.ConfigDefaultImageItem] = None)

Image building argument overrides. See Development:configuration:images.

class pyHDLC.Defaults

Default global parameters. See Defaults.

pyHDLC.GenerateJobList(name: str, fmt: str = 'gha', dry: bool = False) None

Generate list of jobs for a named task.

Parameters:
  • name – Identifier to extract jobs from the YAML configuration file.

  • fmt – Output format (by default, print to GITHUB_OUTPUT).

  • dry – Do not set the output, just print the list of jobs.

pyHDLC.PullImage(image: Union[str, List[str]], registry: str = 'ghcr.io/hdl', collection: str = 'debian/trixie', architecture: str = 'amd64', dry: bool = False) None

Pull container image(s) from registry.

Parameters:
  • image – Bare image name(s), without registry, collection or architecture. The supported syntax for each image name is name[#location], where the optional location is ignored if provided (it’s used in TestImage() only).

  • registry – Optionally, set the prefix of the registry.

  • collection – Optionally, set the collection to pull the image for.

  • architecture – Optionally, set the architecture to pull the image for.

  • dry – Do not pull the image, just print the command that would be executed.

pyHDLC.PushImage(image: Union[str, List[str]], registry: str = 'ghcr.io/hdl', collection: str = 'debian/trixie', architecture: str = 'amd64', dry: bool = False, mirror: Union[str, List[str]] = None) None

Push container image(s) to registry/registries.

Parameters:
  • image – Bare image name(s), without registry, collection or architecture. The supported syntax for each image name is name[#location], where the optional location is ignored if provided (it’s used in TestImage() only).

  • registry – Optionally, set the prefix of the registry.

  • collection – Optionally, set the collection to push the image from.

  • architecture – Optionally, set the architecture to push the image for.

  • dry – Do not push the image, just print the command(s) that would be executed.

  • mirror

    List of additional registry/registries to push to. Supported placeholders:

    • #A: architecture

    • #C: collection

pyHDLC.TestImage(image: Union[str, List[str]], registry: str = 'ghcr.io/hdl', collection: str = 'debian/trixie', architecture: str = 'amd64', dry: bool = False) None

Test container image(s).

Parameters:
  • image – Bare image name(s), without registry, collection or architecture. The supported syntax for each image name is name[#<DirName>], where the optional <DirName> is used as the location in package images to copy the content from.

  • registry – Optionally, set the prefix of the registry.

  • collection – Optionally, set the collection to test the image from.

  • architecture – Optionally, set the architecture to test the image for.

  • dry – Do not test the image, just print the command(s) that would be executed.

Dataclasses

class pyHDLC.ConfigDefaultImageItem(dockerfile: str = None, target: str = None, argimg: str = None)

Optionally overridable fields for image build argument defaults.

class pyHDLC.ConfigImages(HDLCI: int = None, _anchors: ~typing.Dict = <factory>, images: ~typing.Dict[str, ~pyHDLC.ConfigDefaultImageItem] = None)

Image building argument overrides. See Development:configuration:images.

class pyHDLC.ConfigJobs(HDLCJ: int = None, _anchors: ~typing.Dict = <factory>, default: ~typing.Dict[str, ~typing.Dict[str, ~typing.List[str]]] = <factory>, pkgonly: ~typing.Dict[str, ~typing.Dict[str, ~typing.List[str]]] = <factory>, runonly: ~typing.Dict[str, ~typing.Dict[str, ~typing.List[str]]] = <factory>, custom: ~typing.Dict[str, ~pyHDLC.ConfigJobsCustomItem] = <factory>)

List of jobs/tasks to be used in CI to dynamically spawn jobs. See Jobs.

class pyHDLC.ConfigJobsCustomExcludeItem(sys: Dict[str, List[str]], params: Dict[str, str])

An exclusion rule for a list of taks generated through a cross-product.

class pyHDLC.ConfigJobsCustomItem(images: ~typing.List[~typing.Any], sys: ~typing.Dict[str, ~typing.List[str]], exclude: ~typing.List[~pyHDLC.ConfigJobsCustomExcludeItem] = <factory>)

A custom list of jobs/tasks defined by combining lists of images and system, optionally applying exclusion rules.

class pyHDLC.Defaults

Default global parameters. See Defaults.