Working with compute - Amazon CodeCatalyst

Working with compute

Compute refers to the computing engine (the CPU, memory, and operating system) managed and maintained by CodeCatalyst to run your workflows. You associate a compute type with either your workflow or your workflow actions.

Note

If compute is defined as a property of the workflow, then it can't be defined as a property of any action in that workflow. Similarly, if compute is defined as a property of any action, it can't be defined in the workflow.

About compute types

CodeCatalyst offers the following compute types:

  • Amazon EC2

  • AWS Lambda

Amazon EC2 offers optimized flexibility during action runs and Lambda offers optimized action start-up speeds. Lambda supports faster workflow action runs due to a lower start-up latency. Lambda allows you to run basic workflows that can build, test, and deploy serverless applications with common runtimes. These runtimes include Node.js, Python, Java, .NET, and Go. However, there are some use-cases which Lambda does not support, and if they impact you, use the Amazon EC2 compute type:

  • Lambda doesn't support runtime environment images from a specified registry.

  • Lambda doesn't support tools that require root permissions. For tools such as yum or rpm, use the Amazon EC2 compute type or other tools that don't require root permissions.

  • Lambda doesn't support Docker builds or runs. The following actions that use Docker images are not supported: Deploy AWS CloudFormation stack, Deploy to Amazon ECS, Amazon S3 publish, AWS CDK bootstrap, AWS CDK deploy, AWS Lambda invoke , and GitHub Actions. Docker-based GitHub Actions that are running within CodeCatalyst GitHub Actions action are also not supported with Lambda compute. You can use alternatives that don’t require root permissions, such as Podman.

  • Lambda doesn't support writing to files outside /tmp. When configuring your workflow actions, you can reconfigure your tools to install or write to /tmp. If you have a build action that installs npm, make sure you configure it to install to /tmp.

  • Lambda doesn't support runtimes longer than 15 minutes.

About compute fleets

CodeCatalyst offers the following compute fleets:

  • On-demand fleets

  • Provisioned fleets

With on-demand fleets, when a workflow action starts, the workflow provisions the resources it needs. The machines are destroyed when the action finishes. You only pay for the number of minutes that you're running your actions. On-demand fleets are fully managed, and includes automatic scaling capabilities to handle spikes in demand.

CodeCatalyst also offers provisioned fleets which contain machines powered by Amazon EC2 that are maintained by CodeCatalyst. With provisioned fleets, you configure a set of dedicated machines to run your workflow actions. These machines remain idle, ready to process actions immediately. With provisioned fleets, your machines are always running and will incur costs as long they're provisioned.

On-demand fleet properties

CodeCatalyst provides the following on-demand fleets:

Name Operating system Architecture vCPUs Memory (GiB) Disk space Supported compute types
Linux.Arm64.Large Amazon Linux 2 Arm64 2 4

64 GB

Amazon EC2

10 GB

Lambda

Linux.Arm64.XLarge Amazon Linux 2 Arm64 4 8

128 GB

Amazon EC2

10 GB

Lambda

Linux.Arm64.2XLarge Amazon Linux 2 Arm64 8 16 128 GB Amazon EC2
Linux.x86-64.Large Amazon Linux 2 x86-64 2 4

64 GB

Amazon EC2

10 GB

Lambda

Linux.x86-64.XLarge Amazon Linux 2 x86-64 4 8

128 GB

Amazon EC2

10 GB

Lambda

Linux.x86-64.2XLarge Amazon Linux 2 x86-64 8 16 128 GB Amazon EC2

If no fleet is selected, CodeCatalyst uses Linux.x86-64.Large.

Provisioned fleet properties

A provisioned fleet contains the following properties:

Operating system

The operating system. The following operating systems are available:

  • Amazon Linux 2

  • Windows Server 2022

    Note

    Windows fleets are only supported in the build action. Other actions do not currently support Windows.

Architecture

The processor architecture. The following architectures are available:

  • x86_64

  • Arm64

Machine type

The machine type for each instance. The following machine types are available:

vCPUs Memory (GiB) Disk space Operating system
2 4

64 GB

Amazon Linux 2
4 8

128 GB

Amazon Linux 2
Windows Server 2022
8 16

128 GB

Amazon Linux 2
Windows Server 2022
Capacity

The initial number of machines allocated to the fleet, which defines the number of actions that can run in parallel.

Scaling mode

Defines the behavior when the number of actions exceeds the fleet capacity.

Provision additional capacity on demand

Additional machines are set up on demand which automatically scale up in response to new actions running, and then scale down to the base capacity as actions finish. This can incur additional costs, since you pay by the minute for each machine running.

Wait until additional fleet capacity is available

Action runs are placed in a queue until a machine is available. This limits additional costs because no additional machines are allocated.

Creating, editing, and deleting a provisioned fleet

Use the following instructions to create, edit, and delete provisioned fleets.

Note

Provisioned fleets will be deactivated after 2 weeks of inactivity. If used again, they will be re-activated automatically, but this re-activation may cause a latency to occur.

To create a provisioned fleet
  1. In the navigation pane, choose CI/CD, and then choose Compute.

  2. Choose Create provisioned fleet.

  3. In the Provisioned fleet name text field, enter a name for your fleet.

  4. From the Operating system drop-down menu, choose the operating system.

  5. From the Machine type drop-down menu, choose the machine type for your machine.

  6. In the Capacity text field, enter the maximum number of machines in the fleet.

  7. From the Scaling mode drop-down menu, choose the desired overflow behavior. For more information about these fields, see Provisioned fleet properties.

  8. Choose Create.

After creating the provisioned fleet, you are ready to assign it to an action. For more information, see Assigning a provisioned fleet or on-demand compute to an action.

To edit a provisioned fleet
  1. In the navigation pane, choose CI/CD, and then choose Compute.

  2. In the Provisioned fleet list, choose the fleet you want to edit.

  3. Choose Edit.

  4. In the Capacity text field, enter the maximum number of machines in the fleet.

  5. From the Scaling mode drop-down menu, choose the desired overflow behavior. For more information about these fields, see Provisioned fleet properties.

  6. Choose Save.

To delete a provisioned fleet
Warning

Before deleting a provisioned fleet, remove it from all actions by deleting the Fleet property from the action's YAML code. Any action that continues to reference a provisioned fleet after it is deleted will fail the next time the action runs.

  1. In the navigation pane, choose CI/CD, and then choose Compute.

  2. In the Provisioned fleet list, choose the fleet you want to delete.

  3. Choose Delete.

  4. Enter delete to confirm the deletion.

  5. Choose Delete.

Assigning a provisioned fleet or on-demand compute to an action

By default, workflow actions use the Linux.x86-64.Large on-demand fleet with an Amazon EC2 compute type. To use a provisioned fleet instead, or to use a different on-demand fleet, such as Linux.x86-64.2XLarge, use the following instructions.

Visual
Before you begin
To assign a provisioned fleet or different fleet type to an action
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name.

  5. Choose Edit.

  6. Choose Visual.

  7. In the workflow diagram, choose the action that you want to assign your provisioned fleet or new fleet type to.

  8. Choose the Configuration tab.

  9. In Compute fleet, do the following:

    Specify the machine or fleet that will run your workflow or workflow actions. With on-demand fleets, when an action starts, the workflow provisions the resources it needs, and the machines are destroyed when the action finishes. Examples of on-demand fleets: Linux.x86-64.Large, Linux.x86-64.XLarge. For more information about on-demand fleets, see On-demand fleet properties.

    With provisioned fleets, you configure a set of dedicated machines to run your workflow actions. These machines remain idle, ready to process actions immediately. For more information about provisioned fleets, see Provisioned fleet properties.

    If Fleet is omitted, the default is Linux.x86-64.Large.

  10. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  11. Choose Commit, enter a commit message, and choose Commit again.

YAML
Before you begin
To assign a provisioned fleet or different fleet type to an action
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. Choose your project.

  3. In the navigation pane, choose CI/CD, and then choose Workflows.

  4. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name./

  5. Choose Edit.

  6. Choose YAML.

  7. Find the action that you want to assign your provisioned fleet or new fleet type to.

  8. In the action, add a Compute property and set Fleet to the name of your fleet or on-demand fleet type. For more information, see the description of the Fleet property in the Build and test action reference for your action.

  9. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  10. Choose Commit, enter a commit message, and choose Commit again.