diff --git a/.env b/.env index 6491ac7..479fb7d 100644 --- a/.env +++ b/.env @@ -1,6 +1,7 @@ OPR_EXECUTOR_ENV=development +OPR_EXECUTOR_IMAGE_PULL=enabled OPR_EXECUTOR_RUNTIMES=php-8.1,dart-2.18,deno-1.24,node-18.0,python-3.10,ruby-3.1,cpp-17,dotnet-6.0 -OPR_EXECUTOR_CONNECTION_STORAGE= +OPR_EXECUTOR_CONNECTION_STORAGE=enabled OPR_EXECUTOR_INACTIVE_TRESHOLD=60 OPR_EXECUTOR_MAINTENANCE_INTERVAL=60 OPR_EXECUTOR_NETWORK=executor_runtimes diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3253e2c..3408058 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,5 +12,5 @@ jobs: - name: Run CodeQL run: | - docker run --rm -v $PWD:/app composer sh -c \ + docker run --rm -v $PWD:/app composer:2.6 sh -c \ "composer install --profile --ignore-platform-reqs && composer check" \ No newline at end of file diff --git a/README.md b/README.md index 0d7b038..bb42ef7 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ services: - OPR_EXECUTOR_RUNTIME_VERSIONS - OPR_EXECUTOR_RETRY_ATTEMPTS - OPR_EXECUTOR_RETRY_DELAY_MS + - OPR_EXECUTOR_IMAGE_PULL networks: openruntimes-runtimes: @@ -80,6 +81,7 @@ volumes: OPR_EXECUTOR_ENV=development OPR_EXECUTOR_RUNTIMES=php-8.0 OPR_EXECUTOR_CONNECTION_STORAGE=file://localhost +OPR_EXECUTOR_IMAGE_PULL=enabled OPR_EXECUTOR_INACTIVE_TRESHOLD=60 OPR_EXECUTOR_MAINTENANCE_INTERVAL=60 OPR_EXECUTOR_NETWORK=openruntimes-runtimes @@ -202,6 +204,7 @@ docker compose down | OPR_EXECUTOR_RUNTIME_VERSIONS | Version tag for runtime environments, ex: `v4` | | OPR_EXECUTOR_RETRY_ATTEMPTS | Number of retry attempts for failed executions, ex: `5` | | OPR_EXECUTOR_RETRY_DELAY_MS | Delay (in milliseconds) between retry attempts, ex: `500` | +| OPR_EXECUTOR_IMAGE_PULL | Pull open runtimes images before executor starts. Takes `disabled` and `enabled` | ## Contributing diff --git a/app/http.php b/app/http.php index 35c06fa..e30d172 100644 --- a/app/http.php +++ b/app/http.php @@ -1491,9 +1491,9 @@ function (string $runtimeId, ?string $payload, string $path, string $method, mix */ $allowList = empty(Http::getEnv('OPR_EXECUTOR_RUNTIMES')) ? [] : \explode(',', Http::getEnv('OPR_EXECUTOR_RUNTIMES')); - if (Http::isDevelopment()) { + if (Http::getEnv('OPR_EXECUTOR_IMAGE_PULL', 'enabled') === 'disabled') { // Useful to prevent auto-pulling from remote when testing local images - Console::info("Skipping image pulling in development mode."); + Console::info("Skipping image pulling"); } else { $runtimeVersions = \explode(',', Http::getEnv('OPR_EXECUTOR_RUNTIME_VERSIONS', 'v4') ?? 'v4'); foreach ($runtimeVersions as $runtimeVersion) { diff --git a/docker-compose.yml b/docker-compose.yml index 63ce22e..202a1b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,6 +46,7 @@ services: - OPR_EXECUTOR_RUNTIME_VERSIONS - OPR_EXECUTOR_RETRY_ATTEMPTS - OPR_EXECUTOR_RETRY_DELAY_MS + - OPR_EXECUTOR_IMAGE_PULL volumes: openruntimes-builds: