Deploying Android Automotive on AWS Graviton with AWS CloudFormation: A Comprehensive Guide

Deploying Android Automotive on AWS Graviton with AWS CloudFormation: A Comprehensive GuideMore Info

AWS for the Automotive sector delivers Software-Defined Vehicle (SDV) solutions, addressing the automotive industry’s growing software complexity, cost management, and quality enhancement needs. AWS is continuously innovating in SDV solutions, enabling the deployment of virtualized automotive hardware and software stacks on its platform. This includes the implementation of Google’s open-source Android Automotive Operating System (AAOS), utilized for automotive cockpit software, on AWS.

This article marks the beginning of a multi-part series focused on establishing Continuous Integration/Continuous Deployment (CI/CD) pipelines for AAOS and in-vehicle infotainment (IVI) applications on AWS. Our aim is to foster collaborative workflow opportunities while reducing OEMs’ and suppliers’ reliance on local physical hardware.

In this initial segment, we will explore the use of AWS CloudFormation to automate, test, and deploy infrastructures for AAOS stacks operating on AWS Graviton instances. This is particularly beneficial for OEMs and their partners involved in developing vehicle user experiences and IVI applications.

Upcoming posts in this series will cover additional topics, such as:

  1. Deploying AAOS on AWS using AWS Cloud Development Kit (AWS CDK) integrated with AWS CodeBuild.
  2. Setting up CI/CD pipelines for building and deploying IVI applications onto the IVI stack, utilizing widely known development tools.

Modern vehicles can contain over 100 million lines of code, managed by numerous independent Electronic Control Units (ECUs). An ECU is a specialized embedded system incorporating one or more system-on-a-chip (SoC) components and microcontroller units (MCU). Automotive software development teams face increasing pressure to reduce costs while enhancing quality, all amid stricter safety and security regulations. Consequently, testing has become an essential aspect of the software development life cycle (SDLC). As software continues to play a critical role in functionality, cost, safety, and quality, software updates are becoming more frequent than physical hardware replacements. The optimal strategy for tackling these contemporary challenges in automotive software development and maintenance is to adopt agile methodologies, continuous testing, and automation—streamlined through the development of ECUs on the AWS cloud.

Running AAOS on Graviton with AWS CloudFormation

When utilizing AWS services, it’s common to find multiple solutions to a single problem, and deploying AAOS on AWS is no exception. To ease your build process, you can leverage the capabilities of AWS CloudFormation.

AWS CloudFormation automates the infrastructure deployment process in your AWS account, simplifying both resource provisioning and deprovisioning. Below is an architecture diagram illustrating how to completely automate the build and deployment of AAOS on a Graviton-based instance using CloudFormation.

The provided CloudFormation template will initiate resources, including an Amazon S3 Bucket and two EC2 instances, along with the necessary components to finalize the build. We have created two versions of the CloudFormation template, allowing you to select based on your cost and convenience preferences:

  1. The first version employs AWS EC2 Spot Instances (for cost efficiency). While Spot instances require more oversight, they are more economical.
  2. The second version utilizes AWS EC2 On-Demand Instances (refer to pricing details on AWS) for reliable access to the environment, although it’s important to check pricing details.

By using either of these CloudFormation templates (do not use both; choose one based on your requirements), the initial EC2 instance will download AAOS and execute the build steps, subsequently transferring the completed build images to the Amazon S3 Bucket. The second instance will monitor for the files in Amazon S3 and, once they are available, configure AAOS to commence operation, revealing the HTTP Interface.

Prerequisites

  • An AWS account with the default Amazon Virtual Private Cloud (VPC).
  • Android Studio installed on your preferred development machine, including the necessary Android API versions. This solution builds Android Automotive 12, as virtualization using Android Cuttlefish Virtual Device (CVD) necessitates a minimum of Android Version 12. Ensure you also include the corresponding API level in your Android build/studio environment, matched to the Android version: API level 32 for Android 12L or API level 31 for Android 12. For maximum compatibility, we recommend both.

This solution can be deployed in the following regions:

  • eu-west-1: Europe (Ireland)
  • eu-west-2: Europe (London)
  • ap-southeast-1: Asia Pacific (Singapore)
  • eu-central-1: Europe (Frankfurt)
  • us-west-2: US West (Oregon)
  • us-east-1: US East (N. Virginia)
  • us-east-2: US East (Ohio)
  • ap-northeast-1: Asia Pacific (Tokyo)

Note: This solution will incur costs. For more information on estimating costs, please visit this resource.

Solution Steps

Build, Deploy, and Access AAOS Stack on AWS Graviton

  1. Download the CloudFormation stack YAML file and log in to the AWS Management Console. Navigate to the CloudFormation landing page, or click on the following link to be directed to the CloudFormation page.
  2. In the top right corner, select “Create Stack,” then “With new resources (Standard).” On the subsequent screen, choose “Template is ready,” followed by “Upload a template file.” Click “Choose file,” select the “aaos-cf-template.yaml” file you downloaded, and then click “Next.”
  3. On the next screen, provide a unique stack name that adheres to the naming convention for Amazon S3 buckets, and click “Next.” I have chosen the name “cicdstack.”
  4. On the following window, leave all options at their defaults and click “Next.”
  5. In the final window, review your CloudFormation stack details, acknowledge the IAM resources creation message, then click “Submit.”
  6. CloudFormation will now create all the necessary resources to build and run the AAOS stack. This process may take around 2 hours. Once completed, you can check the status of the stack creation in the CloudFormation console.
  7. Under the Resources tab, you will see a list of all Resources deployed for the Stack along with their creation statuses.

In conclusion, you can find further valuable insights about the deployment process in another blog post, which you can read here. For authoritative guidance on this topic, visit this resource, and if you’re curious about what it’s like to work at an Amazon warehouse, this is an excellent resource.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *