Image Module

class carthage.image.ContainerVolume(name, *, clone_from=None, implementation=None, **kwargs)
async async_ready()

This may need to be overridden, but is provided as a default

property stamp_subdir

The part of stamp_path() after config.stamp_dir. For example for a podman container called example.com this might be podman/containers/example.com

class carthage.image.ImageVolume(name=None, directory=None, *, size=None, populate=None, base_image=None, preallocate=None, readonly=None, **kwargs)

Represents a file-based disk image. Can be initially blank (eros) or can be a copy of another image. Supports a populate callback to populate an image before first use.

Parameters:

directory – The directory where unqualified images are

searched for and where any new files are created (when an image is uncompressed for example). Defaults to {vm_image_dir}.

Parameters:
  • name – The name of the image. It can be either an unqualified image name like base_vm or a full path name including extension.

  • base_image – Rather than creating a zero-filled image, create an image as a copy of this file or ImageVolume.

  • size – If the image is not at least this large (MiB), resize it to be that large.

async async_ready()

This may need to be overridden, but is provided as a default

property stamp_subdir

The part of stamp_path() after config.stamp_dir. For example for a podman container called example.com this might be podman/containers/example.com

carthage.image.wrap_container_customization(task: TaskWrapper, **kwargs)

Takes a setup_task() and wraps it in a ContainerCustomization so that it can be used in a ContainerVolume. Consider the following:

    @setup_task("frob the filesystem")
    async def frob_filesystem(self):
        async with self.filesystem_access() as path: # ...

Such a setup task cannot be directly applied to a :class:`ContainerVolume` because ContainerVolume does not have *filesystem_access* or any of the other customization methods.  *wrap_container_customization* wraps such a setup_task in a :class:`ContainerCustomization` so that it can be applied to a volume.