PHPackages                             open-runtimes/executor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. open-runtimes/executor

ActiveProject[DevOps &amp; Deployment](/categories/devops)

open-runtimes/executor
======================

Serverless runtimes executor for container based environments ⚡️

0.22.1(2mo ago)346.5k↓17.9%4[8 PRs](https://github.com/open-runtimes/executor/pulls)MITPHPPHP &gt;=8.3.0CI passing

Since Nov 5Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/open-runtimes/executor)[ Packagist](https://packagist.org/packages/open-runtimes/executor)[ RSS](/packages/open-runtimes-executor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (31)Versions (274)Used By (0)

Open Runtimes Executor 🤖
========================

[](#open-runtimes-executor-)

[![open-runtimes-box-bg-cover](https://user-images.githubusercontent.com/1297371/151676246-0e18f694-dfd7-4bab-b64b-f590fec76ef1.png)](https://user-images.githubusercontent.com/1297371/151676246-0e18f694-dfd7-4bab-b64b-f590fec76ef1.png)

---

[![Discord](https://camo.githubusercontent.com/0631a3d1ce1ab6dfd23250b173cd48b996de97b25545be40c32bd29e7204331d/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3933373039323934353731333137323438303f6c6162656c3d646973636f7264267374796c653d666c61742d737175617265)](https://discord.gg/mkZcevnxuf)[![Build Status](https://github.com/open-runtimes/executor/actions/workflows/tests.yml/badge.svg)](https://github.com/open-runtimes/executor/actions/workflows/tests.yml)[![Twitter Account](https://camo.githubusercontent.com/95a35a6a7b26a4a26b1e365e36ac3ddf1794b2796d2b91de2f37ccb81274ae9d/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f61707077726974653f636f6c6f723d303061636565266c6162656c3d74776974746572267374796c653d666c61742d737175617265)](https://twitter.com/appwrite)[![Docker Pulls](https://camo.githubusercontent.com/9efb36b1d0d3e3b40c7998a0bc19767390c9f16a25adb1644bc647595c2d4495/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6f70656e72756e74696d65732f6578656375746f723f636f6c6f723d663032653635267374796c653d666c61742d737175617265)](https://hub.docker.com/r/openruntimes/executor)

Executor for [Open Runtimes](https://github.com/open-runtimes/open-runtimes), a runtime environments for serverless cloud computing for multiple coding languages.

Executor is responsible for providing HTTP API for creating and executing Open Runtimes. Executor is stateless and can be scaled horizontally when a load balancer is introduced in front of it. You could use any load balancer but we highly recommend using [Open Runtimes Proxy](https://github.com/open-runtimes/proxy) for it's ease of setup with Open Runtimes Executor.

Features
--------

[](#features)

- **Flexibility** - Configuring custom image lets you use **any** runtime for your functions.
- **Performance** - Coroutine-style HTTP servers allows asynchronous operations without blocking. We. Run. Fast! ⚡
- **Open Source** - Released under the MIT license, free to use and extend.

Getting Started
---------------

[](#getting-started)

1. Pull Open Runtimes Executor image:

```
docker pull openruntimes/executor
```

2. Create `docker-compose.yml` file:

```
version: '3'
services:
  openruntimes-executor:
    container_name: openruntimes-executor
    hostname: executor
    stop_signal: SIGINT
    image: openruntimes/executor
    networks:
      openruntimes-runtimes:
    ports:
      - 9900:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - openruntimes-builds:/storage/builds:rw
      - openruntimes-functions:/storage/functions:rw
      - /tmp:/tmp:rw
      - ./functions:/storage/functions:rw
    environment:
      - OPR_EXECUTOR_ENV
      - OPR_EXECUTOR_IMAGES
      - OPR_EXECUTOR_CONNECTION_STORAGE
      - OPR_EXECUTOR_INACTIVE_THRESHOLD
      - OPR_EXECUTOR_MAINTENANCE_INTERVAL
      - OPR_EXECUTOR_NETWORK
      - OPR_EXECUTOR_SECRET
      - OPR_EXECUTOR_DOCKER_HUB_USERNAME
      - OPR_EXECUTOR_DOCKER_HUB_PASSWORD
      - OPR_EXECUTOR_RUNTIME_VERSIONS
      - OPR_EXECUTOR_RETRY_ATTEMPTS
      - OPR_EXECUTOR_RETRY_DELAY_MS
      - OPR_EXECUTOR_IMAGE_PULL

networks:
  openruntimes-runtimes:
    name: openruntimes-runtimes

volumes:
  openruntimes-builds:
  openruntimes-functions:
```

> Notice we added bind to local `./functions` directory. That is only nessessary for this getting started, since we will be executing our custom function.

3. Create `.env` file:

```
OPR_EXECUTOR_ENV=development
OPR_EXECUTOR_IMAGES=openruntimes/php:v5-8.3
OPR_EXECUTOR_CONNECTION_STORAGE=file://localhost
OPR_EXECUTOR_INACTIVE_THRESHOLD=60
OPR_EXECUTOR_MAINTENANCE_INTERVAL=60
OPR_EXECUTOR_NETWORK=openruntimes-runtimes
OPR_EXECUTOR_SECRET=executor-secret-key
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
OPR_EXECUTOR_RUNTIME_VERSIONS=v5
OPR_EXECUTOR_RETRY_ATTEMPTS=5
OPR_EXECUTOR_RETRY_DELAY_MS=500

```

> `OPR_EXECUTOR_CONNECTION_STORAGE` takes a DSN string that represents a connection to your storage device. If you would like to use your local filesystem, you can use `file://localhost`. If using S3 or any other provider for storage, use a DSN of the following format `s3://access_key:access_secret@host:port/bucket_name?region=us-east-1`

> For backwards compatibility, executor also supports `OPR_EXECUTOR_STORAGE_*` variables as replacement for `OPR_EXECUTOR_CONNECTION_STORAGE`, as seen in [Appwrite repository](https://github.com/appwrite/appwrite/blob/1.3.8/.env#L26-L46).

4. Start Docker container:

```
docker compose up -d
```

5. Prepare a function we will ask executor to run:

```
mkdir -p functions && cd functions && mkdir -p php-function && cd php-function
printf "
