diff --git a/app/config/collections.php b/app/config/collections.php index 3e0dd9b7a7..46a2d2554b 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3029,7 +3029,7 @@ $projectCollections = array_merge([ 'size' => 8, 'signed' => true, 'required' => false, - 'default' => 'v3', + 'default' => 'v4', 'array' => false, 'filters' => [], ], diff --git a/app/config/runtimes.php b/app/config/runtimes.php index a55e0b3fb4..980613ebec 100644 --- a/app/config/runtimes.php +++ b/app/config/runtimes.php @@ -6,4 +6,4 @@ use Appwrite\Runtimes\Runtimes; -return (new Runtimes('v3'))->getAll(); +return (new Runtimes('v4'))->getAll(); diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 068fc1c836..69086b4fca 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -221,7 +221,7 @@ App::post('/v1/functions') 'commands' => $commands, 'scopes' => $scopes, 'search' => implode(' ', [$functionId, $name, $runtime]), - 'version' => 'v3', + 'version' => 'v4', 'installationId' => $installation->getId(), 'installationInternalId' => $installation->getInternalId(), 'providerRepositoryId' => $providerRepositoryId, @@ -1813,6 +1813,7 @@ App::post('/v1/functions/:functionId/executions') method: $method, headers: $headers, runtimeEntrypoint: $command, + logging: $function->getAttribute('logging', true), requestTimeout: 30 ); diff --git a/app/controllers/general.php b/app/controllers/general.php index 71ecc80d54..d4217477fb 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -270,6 +270,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo method: $method, headers: $headers, runtimeEntrypoint: $command, + logging: $function->getAttribute('logging', true), requestTimeout: 30 ); diff --git a/docker-compose.yml b/docker-compose.yml index 250eb8b7aa..7535555817 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -803,7 +803,7 @@ services: - OPR_EXECUTOR_ENV=$_APP_ENV - OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES - 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_STORAGE_DEVICE=$_APP_STORAGE_DEVICE - OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index cbba9657ad..acef40382a 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -412,7 +412,8 @@ class Functions extends Action path: $path, method: $method, headers: $headers, - runtimeEntrypoint: $command + runtimeEntrypoint: $command, + logging: $function->getAttribute('logging', true), ); $status = $executionResponse['statusCode'] >= 400 ? 'failed' : 'completed'; diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index 66c356e2b1..46c45d06c5 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -119,7 +119,7 @@ class Func extends Model ->addRule('version', [ 'type' => self::TYPE_STRING, 'description' => 'Version of Open Runtimes used for the function.', - 'default' => 'v3', + 'default' => 'v4', 'example' => 'v2', ]) ->addRule('installationId', [ diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 76c66de231..d80b0037af 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -177,6 +177,7 @@ class Executor string $method, array $headers, string $runtimeEntrypoint = null, + bool $logging, int $requestTimeout = null ) { if (empty($headers['host'])) { @@ -201,6 +202,7 @@ class Executor 'memory' => $this->memory, 'version' => $version, 'runtimeEntrypoint' => $runtimeEntrypoint, + 'logging' => $logging, ]; // Safety timeout. Executor has timeout, and open runtime has soft timeout.