OPR v4 support
This commit is contained in:
parent
83d60612f2
commit
0edbec4f44
8 changed files with 11 additions and 6 deletions
|
@ -3029,7 +3029,7 @@ $projectCollections = array_merge([
|
||||||
'size' => 8,
|
'size' => 8,
|
||||||
'signed' => true,
|
'signed' => true,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'default' => 'v3',
|
'default' => 'v4',
|
||||||
'array' => false,
|
'array' => false,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
|
|
||||||
use Appwrite\Runtimes\Runtimes;
|
use Appwrite\Runtimes\Runtimes;
|
||||||
|
|
||||||
return (new Runtimes('v3'))->getAll();
|
return (new Runtimes('v4'))->getAll();
|
||||||
|
|
|
@ -221,7 +221,7 @@ App::post('/v1/functions')
|
||||||
'commands' => $commands,
|
'commands' => $commands,
|
||||||
'scopes' => $scopes,
|
'scopes' => $scopes,
|
||||||
'search' => implode(' ', [$functionId, $name, $runtime]),
|
'search' => implode(' ', [$functionId, $name, $runtime]),
|
||||||
'version' => 'v3',
|
'version' => 'v4',
|
||||||
'installationId' => $installation->getId(),
|
'installationId' => $installation->getId(),
|
||||||
'installationInternalId' => $installation->getInternalId(),
|
'installationInternalId' => $installation->getInternalId(),
|
||||||
'providerRepositoryId' => $providerRepositoryId,
|
'providerRepositoryId' => $providerRepositoryId,
|
||||||
|
@ -1813,6 +1813,7 @@ App::post('/v1/functions/:functionId/executions')
|
||||||
method: $method,
|
method: $method,
|
||||||
headers: $headers,
|
headers: $headers,
|
||||||
runtimeEntrypoint: $command,
|
runtimeEntrypoint: $command,
|
||||||
|
logging: $function->getAttribute('logging', true),
|
||||||
requestTimeout: 30
|
requestTimeout: 30
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -270,6 +270,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
|
||||||
method: $method,
|
method: $method,
|
||||||
headers: $headers,
|
headers: $headers,
|
||||||
runtimeEntrypoint: $command,
|
runtimeEntrypoint: $command,
|
||||||
|
logging: $function->getAttribute('logging', true),
|
||||||
requestTimeout: 30
|
requestTimeout: 30
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -803,7 +803,7 @@ services:
|
||||||
- OPR_EXECUTOR_ENV=$_APP_ENV
|
- OPR_EXECUTOR_ENV=$_APP_ENV
|
||||||
- OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES
|
- OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES
|
||||||
- OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET
|
- OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET
|
||||||
- OPR_EXECUTOR_RUNTIME_VERSIONS=v2,v3
|
- OPR_EXECUTOR_RUNTIME_VERSIONS=v2,v4
|
||||||
- OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
|
- OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
|
||||||
- OPR_EXECUTOR_STORAGE_DEVICE=$_APP_STORAGE_DEVICE
|
- OPR_EXECUTOR_STORAGE_DEVICE=$_APP_STORAGE_DEVICE
|
||||||
- OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY
|
- OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY
|
||||||
|
|
|
@ -412,7 +412,8 @@ class Functions extends Action
|
||||||
path: $path,
|
path: $path,
|
||||||
method: $method,
|
method: $method,
|
||||||
headers: $headers,
|
headers: $headers,
|
||||||
runtimeEntrypoint: $command
|
runtimeEntrypoint: $command,
|
||||||
|
logging: $function->getAttribute('logging', true),
|
||||||
);
|
);
|
||||||
|
|
||||||
$status = $executionResponse['statusCode'] >= 400 ? 'failed' : 'completed';
|
$status = $executionResponse['statusCode'] >= 400 ? 'failed' : 'completed';
|
||||||
|
|
|
@ -119,7 +119,7 @@ class Func extends Model
|
||||||
->addRule('version', [
|
->addRule('version', [
|
||||||
'type' => self::TYPE_STRING,
|
'type' => self::TYPE_STRING,
|
||||||
'description' => 'Version of Open Runtimes used for the function.',
|
'description' => 'Version of Open Runtimes used for the function.',
|
||||||
'default' => 'v3',
|
'default' => 'v4',
|
||||||
'example' => 'v2',
|
'example' => 'v2',
|
||||||
])
|
])
|
||||||
->addRule('installationId', [
|
->addRule('installationId', [
|
||||||
|
|
|
@ -177,6 +177,7 @@ class Executor
|
||||||
string $method,
|
string $method,
|
||||||
array $headers,
|
array $headers,
|
||||||
string $runtimeEntrypoint = null,
|
string $runtimeEntrypoint = null,
|
||||||
|
bool $logging,
|
||||||
int $requestTimeout = null
|
int $requestTimeout = null
|
||||||
) {
|
) {
|
||||||
if (empty($headers['host'])) {
|
if (empty($headers['host'])) {
|
||||||
|
@ -201,6 +202,7 @@ class Executor
|
||||||
'memory' => $this->memory,
|
'memory' => $this->memory,
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'runtimeEntrypoint' => $runtimeEntrypoint,
|
'runtimeEntrypoint' => $runtimeEntrypoint,
|
||||||
|
'logging' => $logging,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Safety timeout. Executor has timeout, and open runtime has soft timeout.
|
// Safety timeout. Executor has timeout, and open runtime has soft timeout.
|
||||||
|
|
Loading…
Reference in a new issue