Skip to main content

Bitrise on AWS: Cloud Controller

Abstract

The Cloud Controller enables you to enjoy the benefits of a Bitrise-managed infrastructure on your AWS environment. With the Cloud Controller, you can manage your build infrastructure even without deep knowledge about AWS.

AWS offering types

There are two basic types of Bitrise on AWS AMIs:

  • Bare metal: Your builds run directly on an AWS machine. This means that the build environment is persistent, the same way it would be on your own computer. Artifacts or cache items from a build can have an effect on subsequent builds, unless you clean up the environment.

  • Virtualized/VM-based: Just like on Bitrise, every build runs in its own virtual machine that is destroyed once the build is finished. It is powered by Bitrise’s virtualization solution that has run millions of builds on the Bitrise-managed machines built on top of Apple’s virtualization framework. Our macOS offerings, including the virtualized solution, are only available on Apple silicon machines.

Updating the AMIs

The Bitrise AMIs are constantly updated with the latest versions of the pre-installed tools. However, providing the latest Xcode and Android Studio versions in the form of AMIs are slower than on the Bitrise-managed machines, because of the AWS AMI review process. You can check out the currently available versions on the AWS stack reports.

AWS pricing for Mac dedicated hosts

For macOS instances, a dedicated host must be allocated. On-Demand EC2 Mac Dedicated Hosts have a minimum host allocation and billing duration of 24 hours. For more details, check out the official AWS documentation: Amazon EC2 Dedicated Hosts Pricing.

Bare metal Linux

The bare metal Linux AMI is available on the following AWS instance types:

  • t2.2xlarge

  • t2.xlarge

  • c5n.metal

  • c5.xlarge

  • c5.metal

  • c5.4xlarge

  • c5.2xlarge

Different instance types suit different computing needs. To find out more about the functions and capabilities of the different instance types, check out the official AWS documentation.

You can run Android emulators on the metal instance types only. The other instance types don't support the use of emulators.

Bare metal macOS

The bare metal macOS AMI is only available on Apple silicon machines, on the following instance types:

  • mac2.metal

  • mac2-m2.metal

  • mac2-m2pro.metal

Android emulators are supported on all the instance types above.

Virtualized macOS

The virtualized macOS AMI is only available on Apple silicon machines, on the following instance types:

  • mac2.metal

  • mac2-m2.metal

  • mac2-m2pro.metal

Virtualization offers an ephemeral build environment: the virtual machine is destroyed at the end of every build. This means that all builds run in a completely clean environment, and previous builds have no effect on them.

You have the option of running either one or two VMs per build. Depending on how resource intensive a build is, running two VMs can mean significant savings in hardware costs.

No Android emulation

Android emulation is not available as the Apple silicon architecture doesn't support nested virtualization.

When to choose the AWS option

If you need to run Bitrise builds on infrastructure that you control, we offer two options: using AWS EC2 instances or our on-premise option.

We recommend using AWS instances to run Bitrise builds if you or your company already has an AWS account to operate important infrastructure. Using an AWS instance comes with several advantages:

  • Plug and play: we provide the Amazon Machine Image (AMI) as a mobile-specific build environment, with all required tools preinstalled. No specific setup needed: you only need to configure the EC2 instance.

  • Control your environment: you can configure network and storage settings during the launch of the instance (for example, you can configure a separate subnet for your Bitrise builds) to make sure all build machines run in their own AWS environment and operate according to company security policies.

  • Security: your code base will remain entirely in your control.

    Information leaving the AWS environment

    Using certain features means leaving the AWS environment: for example, using the build cache, generating build artifacts or test results.

If you don't have an AWS account, use some other cloud provider, or already manage your own machines, we recommend checking out our on-premise runner offering.

Cloud controller overview

The Cloud Controller enables you to enjoy the benefits of a Bitrise-managed infrastructure on your AWS environment. With the Cloud Controller, you can manage your build infrastructure even without deep knowledge about AWS.

The Cloud Controller enables Bitrise on AWS users to operate EC2 infrastructure at scale:

  • The automation supports both the bare metal and the VM-based macOS offerings, providing complete automation on reserving macOS dedicated hosts, starting the instances with the chosen AMI, and connecting to the Bitrise pool.

  • Controller's automation saves your mobile DevOps team time and removes an error-prone manual process that doesn't scale above a certain number of instances.

  • Changing the number of instances in the Agent Pool definition enables EC2 cost savings. Scaling down even a bigger macOS machine pool for the weekend will be as easy as changing a single number in the configuration.

  • Updating the machines to a newer build environment - provided in the form of an AMI by Bitrise - will be seamless and won't disturb the mobile developers. The configuration can define the percentage of machines affected by the update at any given time.

  • You can monitor the instances in each Bitrise pool, see their state, and the builds they are currently running.

No inbound traffic required

We’ve created the Bitrise on AWS offering with the highest security standards in mind, to match even the most strict company policy requirements. In all cases the Controller and the build machines will initiate network calls toward the Bitrise control plane, so no external inbound traffic is required.

controller-diagram.png

Manual setup

We recommend using the Cloud Controller to run Bitrise builds on AWS. However, if you want full control and customization options, you can choose the manual setup.

Air-gapped mode for the controller

In order to provide the core functionalities of Bitrise in AWS environment both the controller and the build machines need to access the Bitrise Control Plane on three addresses:

  • https://cloud-controller-aws-internal.services.bitrise.io

  • https://exec.bitrise.io

  • https://build-log.services.bitrise.io

Some additional quality-of-life features (like the build machine self-update or the external IP collection) require further communication with additional resources on different addresses. To achieve the maximum security in AWS, you can disable these extra functionalities by enabling the Air-gapped network mode during controller creation.

Please note that this setting doesn't affect your AWS configuration. You need to ensure that the network you use is configured securely.