snowshu.core.docker¶
-
class
snowshu.core.docker.
SnowShuDocker
¶ Bases:
object
-
convert_container_to_replica
(replica_name: str, active_container: docker.models.containers.Container, passive_container: docker.models.containers.Container) → list[docker.models.images.Image]¶ coerces a live container into a replica image and returns the image.
replica_name: the name of the new replica
- return: [replica_image_from_active,
replica_image_from_passive(skipped if no passive), replica_image_from_local_arch]
-
create_and_init_container
(image: docker.models.images.Image, container_name: str, target_adapter: Type[BaseTargetAdapter], source_adapter: str, network: docker.models.networks.Network, replica_volume: docker.models.volumes.Volume, envars: dict) → docker.models.containers.Container¶ Method used during self.startup() execution, creates, starts and setups container
input: some stuff needed to define a container launch return: container object instance, in a running state and already set up
-
find_snowshu_images
() → List[docker.models.images.Image]¶
-
get_adapter_name
(name: str) → str¶
-
get_docker_image_attributes
(image: str) → Dict¶ Retrieve image-related attributes
-
remove_container
(container: str) → None¶
-
static
replica_image_name_to_common_name
(name: str) → str¶ reverse the replica sanitizer.
-
static
sanitize_replica_name
(name: str) → str¶ Much more strict than standard docker tag names.
ReplicaFactory names are coerced into ASCII lowercase, dash- seperated a-z0-9 strings when possible.
-
startup
(target_adapter: Type['BaseTargetAdapter'], source_adapter: str, arch_list: list[str], envars: list) -> tuple(docker.models.containers.Container)¶
-