def pull_remote_image_from_ecr(self, image_name: str):
        """
        Pulls a Docker image from Amazon ECR using the image_name and optionally retags it locally.

        Args:
            image_name (str): The unique identifier for a to_version image. It can be either be the fully qualified image name with the tag
                                    (ex: 424082663841.dkr.ecr.us-east-1.amazonaws.com/marqo-compatibility-tests:abcdefgh1234)
                                    or the fully qualified image name with the digest (ex: 424082663841.dkr.ecr.us-east-1.amazonaws.com/marqo-compatibility-tests@sha256:1234567890abcdef).
                                    This is constructed in build_push_image.yml workflow and will be the qualified image name with digest for an automatically triggered workflow.

        Returns:
            str: The local tag of the pulled and retagged Docker image.

        Raises:
            RuntimeError: If there is an error during the Docker image pull or retagging process.
        """
        ecr_registry = "424082663841.dkr.ecr.us-east-1.amazonaws.com"
        region = "us-east-1"

        try:
            # Get the ECR login password
            self.logger.debug("Retrieving ECR login credentials")
            ecr_client = boto3.client("ecr", region_name=region)
            auth_data = ecr_client.get_authorization_token()["authorizationData"][0]
            token = auth_data["authorizationToken"]
            decoded_token = base64.b64decode(token).decode('utf-8')

            username, password = decoded_token.split(":")
            # Get the ECR login password
            self.logger.debug(f"Logging into ECR registry: {ecr_registry}")
            resp = self.docker_client.login(username=username, password=password, registry=ecr_registry)

            # Pull the Docker image from ECR
            self.logger.debug(f"Pulling image: {image_name} from ECR registry")
            image = self.docker_client.images.pull(image_name, auth_config={'username': username, 'password': password})

            # Optionally retag the image locally to marqo-ai/marqo
            hash_part = image_name.split(":")[1] if ":" in image_name else image_name
            local_tag = f"marqo-ai/marqo:{hash_part}"  # it should now be called marqo-ai/marqo:sha-token or marqo-ai/marqo:GitHub.sha
            self.logger.info(f"Re-tagging image to: {local_tag}")
            image.tag(local_tag)

            return local_tag

        except (BotoCoreError, ClientError) as e:
            self.logger.exception(f"Failed to retrieve ECR authorization token: {str(e)}")
            raise RuntimeError("Failed to authenticate with ECR.") from e
        except docker.errors.APIError as e:
            self.logger.exception(f"Failed to pull or tag the image: {str(e)}")
            raise RuntimeError(
                f"Failed to pull or tag the Docker image '{image_name}' due to a Docker API error.") from e
        except Exception as e:
            self.logger.exception(f"An unexpected error occurred while pulling the Docker image: {image_name} from ECR")
            raise RuntimeError(
                f"Failed to pull Docker image '{image_name}' from ECR due to an unexpected error.") from e

        Pulls a Docker image from Amazon ECR using the image_name and optionally retags it locally.

        Args:
            image_name (str): The unique identifier for a to_version image. It can be either be the fully qualified image name with the tag
                                    (ex: 424082663841.dkr.ecr.us-east-1.amazonaws.com/marqo-compatibility-tests:abcdefgh1234)
                                    or the fully qualified image name with the digest (ex: 424082663841.dkr.ecr.us-east-1.amazonaws.com/marqo-compatibility-tests@sha256:1234567890abcdef).
                                    This is constructed in build_push_image.yml workflow and will be the qualified image name with digest for an automatically triggered workflow.

        Returns:
            str: The local tag of the pulled and retagged Docker image.

        Raises:
            RuntimeError: If there is an error during the Docker image pull or retagging process.
        
tests/compatibility_tests/docker_manager.py