Skip to content

Commit

Permalink
doc: new env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Oct 30, 2024
1 parent b87e9d2 commit 41f03ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ OPR_EXECUTOR_LOGGING_CONFIG=
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
OPR_EXECUTOR_RUNTIME_VERSIONS=v4
OPR_EXECUTOR_RETRY_ATTEMPTS=4
OPR_EXECUTOR_RETRY_ATTEMPTS=5
OPR_EXECUTOR_RETRY_DELAY_MS=500
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ services:
- OPR_EXECUTOR_DOCKER_HUB_USERNAME
- OPR_EXECUTOR_DOCKER_HUB_PASSWORD
- OPR_EXECUTOR_RUNTIME_VERSIONS
- OPR_EXECUTOR_RETRY_ATTEMPTS
- OPR_EXECUTOR_RETRY_DELAY_MS

networks:
openruntimes-runtimes:
Expand Down Expand Up @@ -87,6 +89,8 @@ OPR_EXECUTOR_LOGGING_CONFIG=
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
OPR_EXECUTOR_RUNTIME_VERSIONS=v4
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`
Expand Down Expand Up @@ -196,6 +200,8 @@ docker compose down
| OPR_EXECUTOR_DOCKER_HUB_USERNAME | Username for Docker Hub authentication (if applicable) |
| OPR_EXECUTOR_DOCKER_HUB_PASSWORD | Password for Docker Hub authentication (if applicable) |
| 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` |

## Contributing

Expand Down
6 changes: 3 additions & 3 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,8 @@ function (string $runtimeId, ?string $payload, string $path, string $method, mix
// Execute function
$executionRequest = $version === 'v4' ? $executeV4 : $executeV2;

$retryDelayMs = Http::getEnv('OPR_EXECUTOR_RETRY_DELAY_MS', 500);
$retryAttempts = Http::getEnv('OPR_EXECUTOR_RETRY_ATTEMPTS', 4);
$retryDelayMs = \intval(Http::getEnv('OPR_EXECUTOR_RETRY_DELAY_MS', '500'));
$retryAttempts = \intval(Http::getEnv('OPR_EXECUTOR_RETRY_ATTEMPTS', '5'));

$attempts = 0;
do {
Expand All @@ -1293,7 +1293,7 @@ function (string $runtimeId, ?string $payload, string $path, string $method, mix
}

usleep($retryDelayMs * 1000);
} while (++$attempts < $retryAttempts);
} while ((++$attempts < $retryAttempts) || (\microtime(true) - $startTime < $timeout));

// Error occurred
if ($executionResponse['errNo'] !== CURLE_OK) {
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ services:
- OPR_EXECUTOR_DOCKER_HUB_USERNAME
- OPR_EXECUTOR_DOCKER_HUB_PASSWORD
- OPR_EXECUTOR_RUNTIME_VERSIONS
- OPR_EXECUTOR_RETRY_ATTEMPTS
- OPR_EXECUTOR_RETRY_DELAY_MS

volumes:
openruntimes-builds:
Expand Down

0 comments on commit 41f03ab

Please sign in to comment.