From 62d0129f80089d2e54ab8a7360427a0951f3a43a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 27 Sep 2020 10:32:16 +0300 Subject: [PATCH 01/26] Added new CPU arch settings to Travis CI --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 89db541ea3..9886016b68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,13 @@ language: php +arch: + - amd64 + - ppc64le + - s390x + - arm64 + +os: linux + php: - '7.4' From 7a85b1da76b2bbf91b3aed99b84b2c8e5f5c5cfb Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 27 Sep 2020 10:46:28 +0300 Subject: [PATCH 02/26] Updated Docker service setup --- .travis.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9886016b68..66fd7a82e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -language: php - arch: - amd64 - ppc64le @@ -8,9 +6,6 @@ arch: os: linux -php: - - '7.4' - addons: hosts: - appwrite.test @@ -18,15 +13,13 @@ addons: notifications: email: - team@appwrite.io - -services: -- docker before_install: - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt-get update - - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce + - curl -fsSL https://get.docker.com | sh + - echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json + - mkdir -p $HOME/.docker + - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json + - sudo service docker start # cache: # directories: From 7ff6ad69bd8d4df7fa488050ddedfb1fe0ae054b Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Thu, 8 Oct 2020 15:36:47 +0300 Subject: [PATCH 03/26] Updated ClamAV version --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 132fe9f2c2..b7bc35c260 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -320,7 +320,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.0.12 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav restart: unless-stopped networks: From 92a89b0b119cb5c85824de3822217709cb35036f Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Thu, 8 Oct 2020 16:08:43 +0300 Subject: [PATCH 04/26] Test Influxdb non-alpine --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index f2bfe0236f..d7a98c8ba5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -340,7 +340,7 @@ services: - appwrite-uploads:/storage/uploads influxdb: - image: influxdb:1.8-alpine + image: influxdb:1.8 container_name: appwrite-influxdb restart: unless-stopped networks: From ec4b060bec81f7c762a5b0b1523419f93e07b73f Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Sat, 10 Oct 2020 20:27:31 +0200 Subject: [PATCH 05/26] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d7a98c8ba5..42cf6df70c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -349,7 +349,7 @@ services: - appwrite-influxdb:/var/lib/influxdb:rw telegraf: - image: appwrite/telegraf:1.0.0 + image: appwrite/telegraf:1.1.0 container_name: appwrite-telegraf restart: unless-stopped networks: From 0097e6afa6949d1b2f4521cdad475f7ebb4f96a6 Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Sat, 10 Oct 2020 20:48:33 +0200 Subject: [PATCH 06/26] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 42cf6df70c..b9cb6ddf9b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -340,7 +340,7 @@ services: - appwrite-uploads:/storage/uploads influxdb: - image: influxdb:1.8 + image: appwrite/influxdb:1.0.0 container_name: appwrite-influxdb restart: unless-stopped networks: From 422252506fc079a479c25888bc6353dd31b3fb6a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 16 Dec 2020 13:02:31 +0200 Subject: [PATCH 07/26] Added docs --- docs/tutorials/multi-architecture-support.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/tutorials/multi-architecture-support.md diff --git a/docs/tutorials/multi-architecture-support.md b/docs/tutorials/multi-architecture-support.md new file mode 100644 index 0000000000..f76eda047f --- /dev/null +++ b/docs/tutorials/multi-architecture-support.md @@ -0,0 +1,13 @@ +# Multi Architecture Support + +A list of Appwrite CPU architecture support status. We use this list to track the status of all Appwrite related Docker images and which architecture is supported by each image. + +| | linux/amd64 | linux/arm64 | linux/arm/v6 | linux/arm/v7 | linux/arm64/v8 | linux/ppc64le | linux/s390x | +|---|---|---|---|---|---|---|---| +| appwrite/appwrite | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | +| appwrite/mariadb | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 | 🟢 | 🔴 | +| appwrite/influxdb | 🟢 | 🟢 | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 | +| appwrite/telegraf | 🟢 | 🟢 | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 | +| appwrite/clamav | 🟢 | 🟢 | 🟢 | 🟢 | 🔴 | 🟢 | 🟢 | +| traefik | 🟢 | 🔴 | 🟢 | 🔴 | 🟢 | 🔴 | 🔴 | +| redis | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | From a579c1c19fecd27f6d7dba2d823527f0e6393459 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 3 Jan 2021 00:48:50 +0200 Subject: [PATCH 08/26] Updated request & mail catchers --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 48571bdaaf..37b6d0edd3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -357,8 +357,8 @@ services: - appwrite maildev: # used mainly for dev tests - image: djfarrelly/maildev - container_name: appwrite-maildev + image: appwrite/mailcatcher:1.0.0 + container_name: appwrite-mailcatcher restart: unless-stopped ports: - '1080:80' @@ -366,8 +366,8 @@ services: - appwrite request-catcher: # used mainly for dev tests - image: smarterdm/http-request-catcher - container_name: appwrite-request-catcher + image: appwrite/requestcatcher:1.0.0 + container_name: appwrite-requestcatcher restart: unless-stopped ports: - '5000:5000' From f87d25bd2e0afa8b59269260ea4504f1340ba715 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 3 Jan 2021 19:16:44 +0200 Subject: [PATCH 09/26] Updated docker images and settings --- .env | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index f6095351de..f73cafb55c 100644 --- a/.env +++ b/.env @@ -23,7 +23,7 @@ _APP_INFLUXDB_PORT=8086 _APP_STATSD_HOST=telegraf _APP_STATSD_PORT=8125 _APP_SMTP_HOST=maildev -_APP_SMTP_PORT=25 +_APP_SMTP_PORT=1025 _APP_SMTP_SECURE= _APP_SMTP_USERNAME= _APP_SMTP_PASSWORD= diff --git a/docker-compose.yml b/docker-compose.yml index 27b1c82756..61177c1a2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -427,7 +427,7 @@ services: container_name: appwrite-mailcatcher restart: unless-stopped ports: - - '9503:80' + - '9503:1080' networks: - appwrite From 7e2920a5f8f9c86f2b1863eb0346a6888d63413a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 3 Jan 2021 20:03:27 +0200 Subject: [PATCH 10/26] Updated port types --- tests/e2e/Scopes/Scope.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index fae34a87fb..e070ca46da 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -35,7 +35,7 @@ abstract class Scope extends TestCase { sleep(10); - $emails = json_decode(file_get_contents('http://maildev/email'), true); + $emails = json_decode(file_get_contents('http://maildev:9503/email'), true); if ($emails && is_array($emails)) { return end($emails); @@ -48,7 +48,7 @@ abstract class Scope extends TestCase { sleep(5); - $resquest = json_decode(file_get_contents('http://request-catcher:5000/__last_request__'), true); + $resquest = json_decode(file_get_contents('http://request-catcher:9504/__last_request__'), true); $resquest['data'] = json_decode($resquest['data'], true); return $resquest; From 17e90e2b256f99029552c3e0194f2cdc0c3fd127 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 3 Jan 2021 21:53:46 +0200 Subject: [PATCH 11/26] Updated CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index db349d1123..1028e23373 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_install: - mkdir -p $HOME/.docker - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json - sudo service docker start + - export COMPOSE_INTERACTIVE_NO_CLI=1 install: - docker --version From 89ca10259ddf2abb93f1d5f86c497bf0b277af42 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 3 Jan 2021 23:22:41 +0200 Subject: [PATCH 12/26] Updated ports 2 --- tests/e2e/Scopes/Scope.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index e070ca46da..64332a3e61 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -35,7 +35,7 @@ abstract class Scope extends TestCase { sleep(10); - $emails = json_decode(file_get_contents('http://maildev:9503/email'), true); + $emails = json_decode(file_get_contents('http://maildev:1080/email'), true); if ($emails && is_array($emails)) { return end($emails); @@ -48,7 +48,7 @@ abstract class Scope extends TestCase { sleep(5); - $resquest = json_decode(file_get_contents('http://request-catcher:9504/__last_request__'), true); + $resquest = json_decode(file_get_contents('http://request-catcher:5000/__last_request__'), true); $resquest['data'] = json_decode($resquest['data'], true); return $resquest; From 9bc3184ee308e1bdb1713da02aeb41ade2be0593 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 4 Jan 2021 00:37:52 +0200 Subject: [PATCH 13/26] Updated CI configuration --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1028e23373..8468ac2716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ arch: - amd64 - - ppc64le - - s390x - arm64 os: linux From f3024e187342ab7b0e7233d097038a2322ded592 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 4 Jan 2021 10:55:25 +0200 Subject: [PATCH 14/26] Removed deno test --- .../Functions/FunctionsCustomServerTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 21539ace52..f572bb832e 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -520,14 +520,14 @@ class FunctionsCustomServerTest extends Scope 'command' => 'ruby app.rb', 'timeout' => 15, ], - [ - 'language' => 'Deno', - 'version' => '1.5', - 'name' => 'deno-1.5', - 'code' => $functions.'/deno.tar.gz', - 'command' => 'deno run --allow-env index.ts', - 'timeout' => 15, - ], + // [ + // 'language' => 'Deno', + // 'version' => '1.5', + // 'name' => 'deno-1.5', + // 'code' => $functions.'/deno.tar.gz', + // 'command' => 'deno run --allow-env index.ts', + // 'timeout' => 15, + // ], ]; foreach ($envs as $key => $env) { From d4519cab0b450b3e0057e3afde9b9869e3c95d22 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 1 Feb 2021 00:23:34 +0200 Subject: [PATCH 15/26] Deno test for ARM --- app/config/environments.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 9f1c5638e1..179c1e0cd5 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -77,7 +77,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.2:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.2', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'deno-1.5' => [ 'name' => 'Deno', @@ -86,7 +86,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.5:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.5', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'deno-1.6' => [ 'name' => 'Deno', @@ -95,7 +95,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.6:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.6', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'dart-2.10' => [ 'name' => 'Dart', From 8d9966bbefe40b7dbd7a8b2b85f49b21b046523e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 5 Feb 2021 17:45:37 +0100 Subject: [PATCH 16/26] feat(tests): add architecture detection --- .../Functions/FunctionsCustomServerTest.php | 129 +++++++----------- 1 file changed, 52 insertions(+), 77 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index b41fa12f1c..bb5dd65f52 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -454,110 +454,85 @@ class FunctionsCustomServerTest extends Scope public function testENVS():array { - $functions = realpath(__DIR__ . '/../../../resources/functions'); + $functionsDir = realpath(__DIR__ . '/../../../resources/functions'); + $envs = require('app/config/environments.php'); + /** * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh */ - $envs = [ - [ - 'language' => 'PHP', - 'version' => '7.4', - 'name' => 'php-7.4', - 'code' => $functions.'/php.tar.gz', + $functions = [ + 'node-14.5' => [ + 'code' => $functionsDir.'/node.tar.gz', + 'command' => 'node index.js', + 'timeout' => 15, + ], + 'node-15.5' => [ + 'code' => $functionsDir.'/node.tar.gz', + 'command' => 'node index.js', + 'timeout' => 15, + ], + 'php-7.4' => [ + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], - [ - 'language' => 'PHP', - 'version' => '8.0', - 'name' => 'php-8.0', - 'code' => $functions.'/php.tar.gz', + 'php-8.0' => [ + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], - [ - 'language' => 'Python', - 'version' => '3.8', - 'name' => 'python-3.8', - 'code' => $functions.'/python.tar.gz', + 'ruby-2.7' => [ + 'code' => $functionsDir.'/ruby.tar.gz', + 'command' => 'ruby app.rb', + 'timeout' => 15, + ], + 'ruby-3.0' => [ + 'code' => $functionsDir.'/ruby.tar.gz', + 'command' => 'ruby app.rb', + 'timeout' => 15, + ], + 'python-3.8' => [ + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], - [ - 'language' => 'Node.js', - 'version' => '14.5', - 'name' => 'node-14.5', - 'code' => $functions.'/node.tar.gz', - 'command' => 'node index.js', - 'timeout' => 15, - ], - [ - 'language' => 'Node.js', - 'version' => '15.5', - 'name' => 'node-15.5', - 'code' => $functions.'/node.tar.gz', - 'command' => 'node index.js', - 'timeout' => 15, - ], - [ - 'language' => 'Ruby', - 'version' => '2.7', - 'name' => 'ruby-2.7', - 'code' => $functions.'/ruby.tar.gz', - 'command' => 'ruby app.rb', - 'timeout' => 15, - ], - [ - 'language' => 'Ruby', - 'version' => '3.0', - 'name' => 'ruby-3.0', - 'code' => $functions.'/ruby.tar.gz', - 'command' => 'ruby app.rb', - 'timeout' => 15, - ], - [ - 'language' => 'Deno', - 'version' => '1.5', - 'name' => 'deno-1.5', - 'code' => $functions.'/deno.tar.gz', + 'deno-1.2' => [ + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], - [ - 'language' => 'Deno', - 'version' => '1.6', - 'name' => 'deno-1.6', - 'code' => $functions.'/deno.tar.gz', + 'deno-1.5' => [ + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], - [ - 'language' => 'Dart', - 'version' => '2.10', - 'name' => 'dart-2.10', - 'code' => $functions.'/dart.tar.gz', + 'deno-1.6' => [ + 'code' => $functionsDir.'/deno.tar.gz', + 'command' => 'deno run --allow-env index.ts', + 'timeout' => 15, + ], + 'dart-2.10' => [ + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], - [ - 'language' => '.NET', - 'version' => '3.1', - 'name' => 'dotnet-3.1', - 'code' => $functions.'/dotnet-3.1.tar.gz', + 'dotnet-3.1' => [ + 'code' => $functionsDir.'/dotnet-3.1.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], - [ - 'language' => '.NET', - 'version' => '5.0', - 'name' => 'dotnet-5.0', - 'code' => $functions.'/dotnet-5.0.tar.gz', + 'dotnet-5.0' => [ + 'code' => $functionsDir.'/dotnet-5.0.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, - ], + ] ]; + + foreach ($envs as $key => $env) { + $envs[$key] = array_merge($env, $functions[$key]); + } sleep(count($envs) * 15); fwrite(STDERR, "."); @@ -581,9 +556,9 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; foreach ($envs as $key => $env) { - $language = $env['language'] ?? ''; + $name = $key ?? ''; + $language = $env['name'] ?? ''; $version = $env['version'] ?? ''; - $name = $env['name'] ?? ''; $code = $env['code'] ?? ''; $command = $env['command'] ?? ''; $timeout = $env['timeout'] ?? 15; From 277ee1b18bd40a292396a04b12a4ae80f17cc71a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 5 Feb 2021 18:32:44 +0100 Subject: [PATCH 17/26] fix(env): remove arm support from dotnet 3.1 --- app/config/environments.php | 2 +- docker/environments/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 179c1e0cd5..574156d76c 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -113,7 +113,7 @@ $environments = [ 'image' => 'appwrite/env-dotnet-3.1:1.0.0', 'build' => '/usr/src/code/docker/environments/dotnet-3.1', 'logo' => 'dotnet.png', - 'supports' => [System::X86, System::ARM], + 'supports' => [System::X86], ], 'dotnet-5.0' => [ 'name' => '.NET', diff --git a/docker/environments/build.sh b/docker/environments/build.sh index 1543c5814d..db25475537 100644 --- a/docker/environments/build.sh +++ b/docker/environments/build.sh @@ -34,7 +34,7 @@ echo 'Dart 2.10...' docker buildx build --platform linux/amd64 -t appwrite/env-dart-2.10:1.0.0 ./docker/environments/dart-2.10/ --push echo '.NET 3.1...' -docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-dotnet-3.1:1.0.0 ./docker/environments/dotnet-3.1/ --push +docker buildx build --platform linux/amd64 -t appwrite/env-dotnet-3.1:1.0.0 ./docker/environments/dotnet-3.1/ --push echo '.NET 5.0...' docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-dotnet-5.0:1.0.0 ./docker/environments/dotnet-5.0/ --push From 7267e8eecace4cd4f3202d048f410326d3992ac6 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 28 Feb 2021 23:45:05 +0200 Subject: [PATCH 18/26] Deprecated deno 1.2 --- app/config/environments.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 574156d76c..f4f2e6550f 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -70,15 +70,15 @@ $environments = [ 'logo' => 'python.png', 'supports' => [System::X86, System::PPC, System::ARM], ], - 'deno-1.2' => [ - 'name' => 'Deno', - 'version' => '1.2', - 'base' => 'hayd/deno:alpine-1.2.0', - 'image' => 'appwrite/env-deno-1.2:1.0.0', - 'build' => '/usr/src/code/docker/environments/deno-1.2', - 'logo' => 'deno.png', - 'supports' => [System::X86], - ], + // 'deno-1.2' => [ + // 'name' => 'Deno', + // 'version' => '1.2', + // 'base' => 'hayd/deno:alpine-1.2.0', + // 'image' => 'appwrite/env-deno-1.2:1.0.0', + // 'build' => '/usr/src/code/docker/environments/deno-1.2', + // 'logo' => 'deno.png', + // 'supports' => [System::X86], + // ], 'deno-1.5' => [ 'name' => 'Deno', 'version' => '1.5', From 38d58a8060164fe67912a0699330d2a4c30f3794 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 25 Mar 2021 17:53:27 +0100 Subject: [PATCH 19/26] fix default code param on tag creation --- app/controllers/api/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 7a6b11bcda..92708527a3 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -435,7 +435,7 @@ App::post('/v1/functions/:functionId/tags') ->label('sdk.response.model', Response::MODEL_TAG) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('command', '', new Text('1028'), 'Code execution command.') - ->param('code', null, new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false) + ->param('code', [], new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false) ->inject('request') ->inject('response') ->inject('projectDB') From 2175302e9b593cc2351a6fe48090916bb0dc195d Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Thu, 25 Mar 2021 15:08:02 -0400 Subject: [PATCH 20/26] ClamAV was reverted to v1.2.0 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3de8f3aad5..28937b160e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -414,7 +414,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.3.0 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav networks: - appwrite From f2a54d8f0057012f99810dd74cce49cdb56274cb Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 16 Apr 2021 18:13:03 +0300 Subject: [PATCH 21/26] Fixed functions tests --- .../Functions/FunctionsCustomServerTest.php | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 01b93d1ab9..a6cc1e5bd5 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -462,12 +462,12 @@ class FunctionsCustomServerTest extends Scope * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh */ - $envs = [ + $functions = [ [ 'language' => 'PHP', 'version' => '7.4', 'name' => 'php-7.4', - 'code' => $functions.'/php.tar.gz', + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], @@ -475,7 +475,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'PHP', 'version' => '8.0', 'name' => 'php-8.0', - 'code' => $functions.'/php.tar.gz', + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], @@ -483,7 +483,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Python', 'version' => '3.8', 'name' => 'python-3.8', - 'code' => $functions.'/python.tar.gz', + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], @@ -491,7 +491,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Python', 'version' => '3.9', 'name' => 'python-3.9', - 'code' => $functions.'/python.tar.gz', + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], @@ -499,7 +499,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Node.js', 'version' => '14.5', 'name' => 'node-14.5', - 'code' => $functions.'/node.tar.gz', + 'code' => $functionsDir.'/node.tar.gz', 'command' => 'node index.js', 'timeout' => 15, ], @@ -507,7 +507,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Node.js', 'version' => '15.5', 'name' => 'node-15.5', - 'code' => $functions.'/node.tar.gz', + 'code' => $functionsDir.'/node.tar.gz', 'command' => 'node index.js', 'timeout' => 15, ], @@ -515,7 +515,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Ruby', 'version' => '2.7', 'name' => 'ruby-2.7', - 'code' => $functions.'/ruby.tar.gz', + 'code' => $functionsDir.'/ruby.tar.gz', 'command' => 'ruby app.rb', 'timeout' => 15, ], @@ -523,7 +523,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Ruby', 'version' => '3.0', 'name' => 'ruby-3.0', - 'code' => $functions.'/ruby.tar.gz', + 'code' => $functionsDir.'/ruby.tar.gz', 'command' => 'ruby app.rb', 'timeout' => 15, ], @@ -531,7 +531,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.5', 'name' => 'deno-1.5', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -539,7 +539,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.6', 'name' => 'deno-1.6', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -547,7 +547,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.8', 'name' => 'deno-1.8', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -555,7 +555,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Dart', 'version' => '2.10', 'name' => 'dart-2.10', - 'code' => $functions.'/dart.tar.gz', + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], @@ -563,7 +563,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Dart', 'version' => '2.12', 'name' => 'dart-2.12', - 'code' => $functions.'/dart.tar.gz', + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], @@ -571,7 +571,7 @@ class FunctionsCustomServerTest extends Scope 'language' => '.NET', 'version' => '3.1', 'name' => 'dotnet-3.1', - 'code' => $functions.'/dotnet-3.1.tar.gz', + 'code' => $functionsDir.'/dotnet-3.1.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], @@ -579,17 +579,20 @@ class FunctionsCustomServerTest extends Scope 'language' => '.NET', 'version' => '5.0', 'name' => 'dotnet-5.0', - 'code' => $functions.'/dotnet-5.0.tar.gz', + 'code' => $functionsDir.'/dotnet-5.0.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], ]; - foreach ($envs as $key => $env) { - $envs[$key] = array_merge($env, $functions[$key]); + foreach ($functions as $key => $env) { + $name = $env['name'] ?? ''; + if(!isset($envs[$name])) { + unset($functions[$key]); + } } - sleep(count($envs) * 20); + sleep(count($functions) * 20); fwrite(STDERR, "."); /** From 5c6d17bd873b82604412622ab5985b032c2c97a7 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 17 Apr 2021 00:25:25 +0300 Subject: [PATCH 22/26] Fixed tests --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index a6cc1e5bd5..15e35a8cfb 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -457,7 +457,6 @@ class FunctionsCustomServerTest extends Scope $functionsDir = realpath(__DIR__ . '/../../../resources/functions'); $envs = require('app/config/environments.php'); - /** * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh @@ -613,7 +612,7 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; - foreach ($envs as $key => $env) { + foreach ($functions as $key => $env) { $name = $key ?? ''; $language = $env['name'] ?? ''; $version = $env['version'] ?? ''; From 181fb05fd46bbd17dc98174f0aa4a17c8347c4b5 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 17 Apr 2021 01:10:27 +0300 Subject: [PATCH 23/26] Fixed tests --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 15e35a8cfb..4bd5d1ee5a 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -613,8 +613,8 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; foreach ($functions as $key => $env) { - $name = $key ?? ''; - $language = $env['name'] ?? ''; + $name = $env['name'] ?? ''; + $language = $env['language'] ?? ''; $version = $env['version'] ?? ''; $code = $env['code'] ?? ''; $command = $env['command'] ?? ''; From dd5d5f59e0ca04f1df5c98e088744c29e944aacd Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 19 Apr 2021 12:31:40 +0200 Subject: [PATCH 24/26] fix: cloud functions environment --- app/config/environments.php | 6 +++--- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 9fb631a51a..95b874aba4 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -95,7 +95,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.5:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.5', 'logo' => 'deno.png', - 'supports' => [System::X86], + 'supports' => [System::X86, System::PPC, System::ARM], ], 'deno-1.6' => [ 'name' => 'Deno', @@ -104,7 +104,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.6:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.6', 'logo' => 'deno.png', - 'supports' => [System::X86], + 'supports' => [System::X86, System::PPC, System::ARM], ], 'deno-1.8' => [ 'name' => 'Deno', @@ -113,7 +113,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.8:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.8', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'dart-2.10' => [ 'name' => 'Dart', diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 693304b667..1184ba7730 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -518,6 +518,11 @@ class FunctionsCustomServerTest extends Scope 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], + 'deno-1.8' => [ + 'code' => $functionsDir.'/deno.tar.gz', + 'command' => 'deno run --allow-env index.ts', + 'timeout' => 15, + ], 'dart-2.10' => [ 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', @@ -539,7 +544,7 @@ class FunctionsCustomServerTest extends Scope 'timeout' => 15, ] ]; - + foreach ($envs as $key => $env) { $envs[$key] = array_merge($env, $functions[$key]); } From 5433f5977175bb41922e32c747982ec290b353d4 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 19 Apr 2021 13:20:35 +0200 Subject: [PATCH 25/26] fix: remove arm support from deno environments --- app/config/environments.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 95b874aba4..cd3868d72c 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -86,7 +86,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.2:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.2', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'deno-1.5' => [ 'name' => 'Deno', @@ -95,7 +95,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.5:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.5', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'deno-1.6' => [ 'name' => 'Deno', @@ -104,7 +104,7 @@ $environments = [ 'image' => 'appwrite/env-deno-1.6:1.0.0', 'build' => '/usr/src/code/docker/environments/deno-1.6', 'logo' => 'deno.png', - 'supports' => [System::X86, System::PPC, System::ARM], + 'supports' => [System::X86], ], 'deno-1.8' => [ 'name' => 'Deno', From 74f06d12cd3396250bf8365b798d03aab1b11173 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 19 Apr 2021 14:44:08 +0200 Subject: [PATCH 26/26] chore: add arm to changelog --- CHANGES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 39a51d80c5..391e69dc53 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,13 +5,14 @@ - Added Anonymous Login ([RFC-010](https://github.com/appwrite/rfc/blob/main/010-anonymous-login.md), #914) - Added events for functions and executions (#971) - Added JWT support +- Added ARM support - Splited token & session models to become 2 different internal entities (#922) - Added Dart 2.12 as a new Cloud Functions runtime (#989) +- Added Python 3.9 as a new Cloud Functions runtime +- Added Deno 1.8 as a new Cloud Functions runtime (#989) - ClamAV is now disabled by default to allow lower min requirments for Appwrite (#1064) - Added a new env var named `_APP_LOCALE` that allow to change the default `en` locale value (#1056) - Updated all the console bottom control to be consistent. Dropped the `+` icon (#1062) -- Added runtime functions environment for Python 3.9 -- Added runtime functions environment for Deno 1.8 ## Bugs