def pull_marqo_image(self, image_name: str, source: str):
        """
        Pull the specified Marqo Docker image.

        Args:
            image_name (str): The identifier with which to pull the Docker image.
                              It can simply be the image name if pulling from DockerHub,
                              or it can be the image digest if pulling from ECR.
            source (str): The source from which to pull the image.
                          It can be either 'docker' for DockerHub or 'ECR' for Amazon ECR.

        Returns:
            str: The name of the pulled Docker image.

        Raises:
            Exception: If there is an error during the Docker image pull process.
        """
        try:
            if source == "docker":
                self.logger.info(f"Pulling image: {image_name} from DockerHub")
                self.pull_image_from_dockerhub(image_name)
                return image_name
            elif source == "ECR":
                return self.pull_remote_image_from_ecr(image_name)
            else:
                raise ValueError(f"Invalid source specified: {source}. Must be 'docker' or 'ECR'.")
        except docker.errors.APIError as e:
            self.logger.exception(f"Failed to pull image: {image_name} from source: {source}")
            raise Exception(f"Failed to pull Docker image: {image_name} from source: {source}. Error: {str(e)}") from e

        Pull the specified Marqo Docker image.

        Args:
            image_name (str): The identifier with which to pull the Docker image.
                              It can simply be the image name if pulling from DockerHub,
                              or it can be the image digest if pulling from ECR.
            source (str): The source from which to pull the image.
                          It can be either 'docker' for DockerHub or 'ECR' for Amazon ECR.

        Returns:
            str: The name of the pulled Docker image.

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