Attini Runner

The Attini Runner is a fast, flexible, and cost-efficient way to execute code from a container as a part of your deployment plan

Find detailed implementation details and API information here.

Quick info

  • The Attini Runner is executed as an Amazon ECS Fargate task.

  • The same task can be reused between different steps and executions without restarting the container.

  • It can run within a private network so that it can integrate with private services and databases.

Architecture

When an AttiniRunnerJob step is started (see AttiniRunnerJob deployment plan type) the following will occur:

  1. The Attini Framework will check if there is a warm Runner with the correct configuration. If not, the Attini Framework will start one.

  2. The Attini deployment plan will add a message to the Runner’s SQS queue with the AttiniRunnerJob commands, the deployment plan payload, and some other required information.

  3. If it is the first job in the deployment plan execution, the Attini Runner will download your attini distribution from the Attini artifact store. It will use the distribution located at S3 attini-artifact-store-${region}-${accountId}/${environment}/${distribution-name}/${distribution-id}/${distribution-name}.zip.

  4. The Attini Runner will then:

    • Receive the message from the SQS queue.

    • Create a working directory for the job.

    • Extract the distribution into the working directory.

    • Remove the message from the SQS queue.

    • Run the commands.

    • Report the result to the deployment plan. See runner output for more information.

AttiniRunner

Warm and cold starts

Starting the ECS Task can take some time and is associated with some risks (hitting service limits, failure to allocate ENIs etc).

To increase development speed, decrease rollback time, and enable parallel jobs, the Attini Runner is kept “warm”, much like a Lambda function but with some differences. A Lambda will start a new instance if a new request is received while another is being processed. An Attini Runner will instead handle multiple parallel requests by executing them simultaneously on the same instance. How many jobs the Attini Runner will execute simultaneously is configured in the Runner configuration. If the number of parallel jobs exceeds the configured maximum the requests (jobs) will remain on the SQS queue until a job has finished executing.

An Attini Runner can be reused between executions. How long a Runner will stay alive without a job request can be configured in the Runner configuration. If the configuration for the Runner changes however then Attini will restart the task with the new configuration.

The same Attini Runner can not be used for different distributions. However, the same ECS task definition can be used for different runners.

Default Runner

Attini Setup will create resources for a default Runner.

The default will be used for some “out-of-box” automation like the AttiniSam step.

Default runner configuration

The default runner uses the default values from Attini::Deploy::Runner resource.

The following AWS Resources are created by Attini Setup and they are used for the default runner.

  1. Default ECS cluster called attini-default.

  2. Default IAM Role for the Runner.

  3. CloudWatch log group called /attini/runner/default.

  4. ECS task definition called attini-default-runner, and it uses the following configuration: