ecs_composex.compose.compose_volumes package

Submodules

ecs_composex.compose.compose_volumes.ecs_family_helpers module

ecs_composex.compose.compose_volumes.ecs_family_helpers. define_host_volumes ( family ) [source]

Goes over all volumes of all services and if the volume is None, source starts with / then this is a host volume :return: list of volumes :rtype: list[dict]

ecs_composex.compose.compose_volumes.ecs_family_helpers. define_shared_volumes ( family ) [source]

Method to create a list of shared volumes within the task family and set the volume to shared = True if not.

Returns :

list of shared volumes within the task definition

Return type :

list

ecs_composex.compose.compose_volumes.ecs_family_helpers. mount_point_exists ( mount_points , new_mount , family , service ) [source]

Function to list out all unique mount points defined.

Parameters :
  • mount_points ( list [ MountPoint ] ) – Existing mount points

  • new_mount ( MountPoint ) –

  • family ( ComposeFamily ) – Family the mount point is for

  • service ( ComposeService ) – Service the mount point is added to

Returns :

Unique list of mount points

Return type :

list

ecs_composex.compose.compose_volumes.ecs_family_helpers. set_services_mount_points ( family ) [source]

Method to set the mount points to the Container Definition of the defined service

if the volume[“volume”] is none, this is not a shared volume, which then works only when not using Fargate (i.e. EC2 host/ ECS Anywhere)

ecs_composex.compose.compose_volumes.ecs_family_helpers. set_volumes ( family ) [source]

Method to create the volumes definition to the Task Definition

Returns :

ecs_composex.compose.compose_volumes.helpers module

ecs_composex.compose.compose_volumes.helpers. evaluate_plugin_efs_properties ( definition , driver_opts_key ) [source]

Function to parse the definition in case user uses the docker cli definition for EFS

Returns :

ecs_composex.compose.compose_volumes.services_helpers module

ecs_composex.compose.compose_volumes.services_helpers. handle_tmpfs ( service , volume ) [source]

Detect whether the volume is tmpfs and therefore validates further input

Parameters :
Return type :

None

ecs_composex.compose.compose_volumes.services_helpers. handle_volume_dict_config ( service , config , volumes ) [source]
Parameters :
ecs_composex.compose.compose_volumes.services_helpers. handle_volume_str_config ( service , config , volumes ) [source]

Function to return the volume configuration (long) :param ComposeService service: :param str config: :param list volumes:

ecs_composex.compose.compose_volumes.services_helpers. is_tmpfs ( config ) [source]

Function to identify whether the volume defined is tmpfs

Parameters :

config ( dict ) –

Returns :

whether the volume defined is tmpfs

Return type :

bool

ecs_composex.compose.compose_volumes.services_helpers. map_volumes ( service , volumes = None ) [source]

Method to apply mapping of volumes to the service and define the mapping configuration

Parameters :
Return type :

None

ecs_composex.compose.compose_volumes.services_helpers. match_volumes_services_config ( service , vol_config , volumes ) [source]

Function to map volume config in services and top-level volumes

Parameters :
Raises :

LookupError

Module contents

Class and functions to interact with the volumes: defined in compose files.

class ecs_composex.compose.compose_volumes. ComposeVolume ( name , definition ) [source]

Bases: object

Class to keep track of the Docker-compose Volumes

When properties are defined, the priority in evaluation goes * x-efs * driver * driver_opts

Assumed local when none else defined.

driver_key = 'driver'
driver_opts_key = 'driver_opts'
efs_defaults = {'Encrypted': True, 'LifecyclePolicies': [{'TransitionToIA': 'AFTER_14_DAYS'}], 'PerformanceMode': 'generalPurpose'}
import_from_x_efs_settings ( ) [source]
import_local_volume ( ) [source]
import_volume_from_definition ( ) [source]
main_key = 'volumes'