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.27.0(3w ago)3529.1k↑73.8%6[1 issues](https://github.com/open-runtimes/executor/issues)[10 PRs](https://github.com/open-runtimes/executor/pulls)MITPHPPHP &gt;=8.5.0CI passing

Since Nov 5Pushed 1w ago5 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 2w ago

READMEChangelog (10)Dependencies (87)Versions (304)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_CONNECTION_BUILD_CACHE_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_CONNECTION_BUILD_CACHE_STORAGE=
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. Every scheme but `file` and `local` requires a host. For example:
>
> StorageDSNLocal filesystem`file://localhost`AWS S3`s3://access_key:access_secret@bucket_name.s3.us-east-1.amazonaws.com?region=us-east-1`S3-compatible (MinIO, Garage, etc.)`s3://access_key:access_secret@minio:9000/bucket_name?region=us-east-1&insecure=true`S3-compatible, endpoint given outright`s3://access_key:access_secret@localhost/bucket_name?region=us-east-1&url=http%3A%2F%2Fminio%3A9000`The DSN resolves to an endpoint of `scheme://host[:port][/bucket]`, and every object key hangs off it. `insecure=true` makes that scheme `http`, and the port is used as given. The bucket is the path of the DSN, and it reaches the endpoint exactly once: it is appended for path-style addressing, and left alone where the endpoint already names it, either as the leading label of the host (AWS S3, DigitalOcean Spaces, Backblaze, Linode and Wasabi all address their buckets that way) or as the path of a `url`. `url` replaces the scheme, host and port, so the last two rows above address the same object.
>
> A DSN that cannot be parsed, or whose scheme has no device, is rejected rather than quietly falling back to the local filesystem. Ask for local storage with `file://` or `local://`, or leave the variable empty.

> 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 "
