libera_utils.aws.ecr_upload.push_image_to_ecr#

libera_utils.aws.ecr_upload.push_image_to_ecr(image_name: str, image_tag: str, processing_step_id: str | ProcessingStepIdentifier, *, ecr_image_tags: list[str] = None, region_name: str = 'us-west-2', ignore_docker_config: bool = False, max_retries: int = 1) None#

Push a Docker image to Amazon ECR with robust authentication handling.

This function handles ECR authentication by obtaining fresh credentials for each push operation, preventing authentication token expiration issues during multi-tag pushes.

Parameters:
  • image_name (str) – Local name of the Docker image

  • image_tag (str) – Local tag of the Docker image (often ‘latest’)

  • processing_step_id (Union[str, constants.ProcessingStepIdentifier]) – Processing step ID string or object used to determine ECR repository name. L0 processing step IDs are not supported as they have no associated ECR.

  • ecr_image_tags (Optional[List[str]], default None) – Tags to apply to the pushed image in ECR (e.g., [“1.3.4”, “latest”]). If None, defaults to [“latest”].

  • region_name (str, default "us-west-2") – AWS region containing the target ECR registry

  • ignore_docker_config (bool, default False) – If True, creates a temporary Docker config to prevent using stored credentials

  • max_retries (int, default 3) – Maximum number of retry attempts for failed push operations

Raises:
  • ValueError – If processing_step_id cannot be mapped to an ECR repository name, or if push operations encounter errors after all retries

  • docker.errors.APIError – If Docker API operations fail

  • boto3.exceptions.ClientError – If AWS ECR operations fail

Return type:

None