mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #3219 from appwrite/feat-runtime-versioning
Executor version environment to use proper version of Runtimes
This commit is contained in:
commit
1cbeb08d08
7 changed files with 12 additions and 12 deletions
|
|
@ -6,7 +6,7 @@ use Appwrite\Runtimes\Runtimes;
|
|||
/**
|
||||
* List of Appwrite Cloud Functions supported runtimes
|
||||
*/
|
||||
$runtimes = new Runtimes();
|
||||
$runtimes = new Runtimes('v1');
|
||||
|
||||
$allowList = empty(App::getEnv('_APP_FUNCTIONS_RUNTIMES')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_RUNTIMES'));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Utopia\Config\Config;
|
||||
|
||||
return [
|
||||
[
|
||||
'category' => 'General',
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
$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) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"ext-zlib": "*",
|
||||
"ext-sockets": "*",
|
||||
"appwrite/php-clamav": "1.1.*",
|
||||
"appwrite/php-runtimes": "0.7.*",
|
||||
"appwrite/php-runtimes": "0.9.*",
|
||||
"utopia-php/framework": "0.19.*",
|
||||
"utopia-php/logger": "0.3.*",
|
||||
"utopia-php/abuse": "0.7.*",
|
||||
|
|
|
|||
8
composer.lock
generated
8
composer.lock
generated
|
|
@ -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": "ffb0a355553045db9c4f517eec033a90",
|
||||
"content-hash": "cb8163f39b3bac09c2c547d9afb1064b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
|
@ -115,11 +115,11 @@
|
|||
},
|
||||
{
|
||||
"name": "appwrite/php-runtimes",
|
||||
"version": "0.7.4",
|
||||
"version": "0.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/runtimes.git",
|
||||
"reference": "8e0972ecce6ad96f3701edab8d2c9a8af7074093"
|
||||
"reference": "e8aa94aa42f45711e11cb1da401b442ecc2c32a4"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
"php",
|
||||
"runtimes"
|
||||
],
|
||||
"time": "2022-02-26T11:38:09+00:00"
|
||||
"time": "2022-05-16T10:54:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "chillerlan/php-qrcode",
|
||||
|
|
|
|||
|
|
@ -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'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue