Skip to content

Commit

Permalink
Rename env var and document it
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldiron committed Nov 30, 2024
1 parent 03e9f42 commit 0d820c8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0d820c8

Please sign in to comment.