> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Shared script runner

export const script_runner = "shared script runner";

export const m_runner = "Maia runner";

export const maia = "Maia";

The {script_runner} allows you to run Python and Bash scripts in your pipelines via the [Script Pushdown](/docs/components/script-pushdown) component.

The {script_runner} is a lightweight script interpreter that can be installed in parallel with your {m_runner} in a Hybrid SaaS deployment. You can choose to install the {script_runner} as part of any {m_runner} deployment. For details of {m_runner} deployment, read [{m_runner} overview](/docs/guides/runner-overview) and the relevant {m_runner} installation documents for your infrastructure.

Script Pushdown is a component that allows you to include Bash and Python scripts in a {maia} orchestration pipeline. Your script is stored within the pipeline, and at runtime the script is pushed to the {script_runner} via SSH to execute the script in your cloud infrastructure. The {script_runner} includes both Python3 and Bash interpreters; therefore only a single {script_runner} is needed to execute all of your scripts in a project.

A maximum of one {script_runner} can be installed with each {m_runner} instance. To scale up to use additional {script_runner}s, you must deploy additional {m_runner} instances. Read [Scaling best practices](/docs/guides/scaling-best-practices) for guidance.

***

## Deploying a shared script runner

A {script_runner} can be added to each {m_runner} you install in your cloud infrastructure. You should follow the documentation to [create a {m_runner}](/docs/guides/create-a-runner), but additionally set the following optional parameters. The specific method to set these will depend on your platform and deployment method, but the parameters remain the same in every case.

* **Enable Script Runner:** Set to `true` to deploy the {script_runner} service. No {script_runner} resources are created when set to `false`. If this parameter is set to `false` (the default), then the following three parameter settings are irrelevant and ignored.

* **Script Runner Size:** The {script_runner} size determines CPU and memory available for running scripts. This is independent of the {m_runner} size, and should be sized purely based on the volume and complexity of scripts you will push to this runner. Select from `small` (the default), `medium`, `large`, and `xlarge`, based on the following:

  | Size     | Compute | Memory | Notes                                          |
  | -------- | ------- | ------ | ---------------------------------------------- |
  | `small`  | 1 vCPU  | 4 GiB  | The current/legacy default.                    |
  | `medium` | 2 vCPU  | 8 GiB  | Recommended for moderate concurrent pipelines, |
  | `large`  | 4 vCPU  | 16 GiB | Recommended for heavy ELT workloads.           |
  | `xlarge` | 8 vCPU  | 32 GiB | Linux-only on Fargate.                         |

  <Warning>
    You must ensure that your {script_runner} is correctly sized to run the expected load imposed by your scripts. {maia} performs no checks on script performance or resource requirements.
  </Warning>

* **Script Runner Container Image URL:** The container image for the {script_runner}. Use an image that corresponds to your platform requirements:

  | Platform               | Image                                                                                    |
  | ---------------------- | ---------------------------------------------------------------------------------------- |
  | AWS                    | `public.ecr.aws/matillion/maia-script-runner:latest`                                     |
  | Azure                  | `matillion.azurecr.io/maia-script-runner:latest`                                         |
  | Google Cloud US region | `us-docker.pkg.dev/maia-492711/maia-runners/maia-script-runner:latest`                   |
  | Google Cloud EU region | `europe-docker.pkg.dev/maia-492711/maia-runners/maia-script-runner:latest`               |
  | Google Cloud AU region | `australia-southeast1-docker.pkg.dev/maia-492711/maia-runners/maia-script-runner:latest` |

* **Runner Authorized SSH Keys:** Enter the SSH public keys that the {script_runner} will trust.

***

## Managing a shared script runner

You can stop and restart the {script_runner} service from within the cloud platform. Read your appropriate platform documentation for instructions on stopping and starting services.

Matillion may issue {script_runner} updates from time to time. To update to a newer version, restart the {script_runner} service. This will automatically pull the new `maia-script-runner:latest` image from the appropriate image repository.
