diff --git a/Dockerfile b/Dockerfile index d1d95506a2..7f5df76148 100755 --- a/Dockerfile +++ b/Dockerfile @@ -187,7 +187,6 @@ ENV _APP_SERVER=swoole \ _APP_EXECUTOR_SECRET=a-random-secret \ _APP_EXECUTOR_HOST=http://appwrite-executor/v1 \ _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes \ - _APP_EXECUTOR_VERSION=v1 \ _APP_SETUP=self-hosted \ _APP_VERSION=$VERSION \ _APP_USAGE_STATS=enabled \ diff --git a/app/config/runtimes.php b/app/config/runtimes.php index 83eea55e4b..9002016aa0 100644 --- a/app/config/runtimes.php +++ b/app/config/runtimes.php @@ -6,7 +6,7 @@ use Appwrite\Runtimes\Runtimes; /** * List of Appwrite Cloud Functions supported runtimes */ -$runtimes = new Runtimes(App::getEnv('_APP_EXECUTOR_VERSION', 'v1')); +$runtimes = new Runtimes('v1'); $allowList = empty(App::getEnv('_APP_FUNCTIONS_RUNTIMES')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_RUNTIMES')); diff --git a/app/config/variables.php b/app/config/variables.php index 5f79ad5399..49f2d7cfee 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -614,15 +614,6 @@ return [ 'question' => '', 'filter' => '' ], - [ - 'name' => '_APP_EXECUTOR_VERSION', - 'description' => 'Executor version', - 'introduction' => '0.14.0', - 'default' => 'v1', - 'required' => false, - 'question' => '', - 'filter' => '' - ], [ 'name' => '_APP_FUNCTIONS_ENVS', 'description' => 'Deprecated with 0.8.0, use \'_APP_FUNCTIONS_RUNTIMES\' instead!', diff --git a/app/executor.php b/app/executor.php index a594732f01..2e957c624c 100644 --- a/app/executor.php +++ b/app/executor.php @@ -580,11 +580,11 @@ App::init(function ($request, $response) { $http->on('start', function ($http) { global $orchestrationPool; global $activeRuntimes; - + /** * Warmup: make sure images are ready to run fast 🚀 */ - $runtimes = new Runtimes(App::getEnv('_APP_EXECUTOR_VERSION', 'v1')); + $runtimes = new Runtimes('v1'); $allowList = empty(App::getEnv('_APP_FUNCTIONS_RUNTIMES')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_RUNTIMES')); $runtimes = $runtimes->getAll(true, $allowList); foreach ($runtimes as $runtime) { diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index 6ba744fde0..6bc06584e6 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -28,7 +28,7 @@ function getConsoleDB(): Database $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace('_console'); // Main DB - if (!$database->exists($database->getDefaultDatabase(), '_metadata')) { + if (!$database->exists($database->getDefaultDatabase(), 'certificates')) { throw new \Exception('Console project not ready'); } diff --git a/composer.json b/composer.json index f576925303..320cfdcfda 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "ext-zlib": "*", "ext-sockets": "*", "appwrite/php-clamav": "1.1.*", - "appwrite/php-runtimes": "dev-feat-runtime-versioning", + "appwrite/php-runtimes": "0.9.*", "utopia-php/framework": "0.19.*", "utopia-php/logger": "0.3.*", "utopia-php/abuse": "0.7.*", diff --git a/composer.lock b/composer.lock index 7c3e9a27a9..6094604345 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b4d24566e38e481c9b5612033101324f", + "content-hash": "9aecfa40a8ee2573bcbcac04edc46b88", "packages": [ { "name": "adhocore/jwt", @@ -115,11 +115,11 @@ }, { "name": "appwrite/php-runtimes", - "version": "dev-feat-runtime-versioning", + "version": "0.9.0", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "3c47c09c0781434f5aba726f726c695f144917b1" + "reference": "e8aa94aa42f45711e11cb1da401b442ecc2c32a4" }, "require": { "php": ">=8.0", @@ -154,7 +154,7 @@ "php", "runtimes" ], - "time": "2022-05-15T03:00:16+00:00" + "time": "2022-05-16T10:54:14+00:00" }, { "name": "chillerlan/php-qrcode", @@ -6320,16 +6320,16 @@ }, { "name": "twig/twig", - "version": "v3.3.10", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "8442df056c51b706793adf80a9fd363406dd3674" + "reference": "ed19f4bf9d19c4ef920b5d8243910bd32e85b9ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", - "reference": "8442df056c51b706793adf80a9fd363406dd3674", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/ed19f4bf9d19c4ef920b5d8243910bd32e85b9ba", + "reference": "ed19f4bf9d19c4ef920b5d8243910bd32e85b9ba", "shasum": "" }, "require": { @@ -6344,7 +6344,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -6380,7 +6380,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.10" + "source": "https://github.com/twigphp/Twig/tree/v3.4.0" }, "funding": [ { @@ -6392,7 +6392,7 @@ "type": "tidelift" } ], - "time": "2022-04-06T06:47:41+00:00" + "time": "2022-05-15T06:25:28+00:00" }, { "name": "vimeo/psalm", @@ -6554,9 +6554,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "appwrite/php-runtimes": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -6578,5 +6576,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.1.0" } diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6ca06fa120..307a634393 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -764,11 +764,12 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals($executions['body']['executions'][0]['status'], 'failed'); $this->assertEquals($executions['body']['executions'][0]['statusCode'], 500); $this->assertGreaterThan(2, $executions['body']['executions'][0]['time']); - $this->assertLessThan(6, $executions['body']['executions'][0]['time']); + $this->assertLessThan(7, $executions['body']['executions'][0]['time']); + $this->assertGreaterThan(5, $executions['body']['executions'][0]['time']); $this->assertEquals($executions['body']['executions'][0]['response'], ''); $this->assertEquals($executions['body']['executions'][0]['stderr'], 'An internal curl error has occurred within the executor! Error Msg: Operation timed out'); - // Cleanup : Delete function + // Cleanup : Delete function $response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],