input: Write a python function to build and push a docker image to Amazon ECR.
  assert build_and_push_docker_image('prediction-model', '<your-aws-account-id>') == 'Success'
  assert build_and_push_docker_image('test-model', '<your-aws-account-id>') == 'Success'
  assert build_and_push_docker_image('invalid-model', '<your-aws-account-id>') == 'Failure'
output: import subprocess
  
  def build_and_push_docker_image(image_name, aws_account_id):
      ecr_repo = f"{aws_account_id}.dkr.ecr.us-west-2.amazonaws.com/{image_name}"
      
      try:
          # Authenticate Docker to the Amazon ECR registry
          subprocess.check_call(
              f"aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin {aws_account_id}.dkr.ecr.us-west-2.amazonaws.com",
              shell=True
          )
          
          # Build the Docker image
          subprocess.check_call(
              f"docker build -t {image_name} .",
              shell=True
          )
          
          # Tag the Docker image with the ECR repository URI
          subprocess.check_call(
              f"docker tag {image_name}:latest {ecr_repo}:latest",
              shell=True
          )
          
          # Push the Docker image to Amazon ECR
          subprocess.check_call(
              f"docker push {ecr_repo}:latest",
              shell=True
          )
          
          return 'Success'
      except subprocess.CalledProcessError:
          return 'Failure'