From e019d3ae7dc8f01b6a2196e5e65364440d4ba4de Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 12:34:24 +0100 Subject: [PATCH 01/17] fix: php runtimes --- runtimes/build.sh | 4 ++-- runtimes/buildLocalOnly.sh | 5 ++++- runtimes/php-8.0/Dockerfile | 11 +++-------- runtimes/php-8.1/Dockerfile | 16 ++++------------ 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/runtimes/build.sh b/runtimes/build.sh index d4da7495..9bd5d623 100755 --- a/runtimes/build.sh +++ b/runtimes/build.sh @@ -36,8 +36,8 @@ docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 echo 'PHP 7.4...' docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/runtime-for-php:7.4 ./runtimes/php-7.4/ --push -echo 'PHP 8...' -docker buildx build --platform linux/amd64,linux/arm64 -t php-runtime:8.0 ./runtimes/php-8.0/ --push +echo 'PHP 8.0...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t php-runtime:8.0 ./runtimes/php-8.0/ --push echo 'PHP 8.1...' docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/runtime-for-php:8.1 ./runtimes/php-8.1/ --push diff --git a/runtimes/buildLocalOnly.sh b/runtimes/buildLocalOnly.sh index 38ecbcae..45e8d091 100755 --- a/runtimes/buildLocalOnly.sh +++ b/runtimes/buildLocalOnly.sh @@ -33,7 +33,10 @@ docker build -t node-runtime:16.0 ./runtimes/node-16.0 echo 'Node 17...' docker build -t node-runtime:17.0 ./runtimes/node-17.0 -echo 'PHP 8...' +echo 'PHP 8.0...' +docker build -t php-runtime:8.0 ./runtimes/php-8.0 + +echo 'PHP 8.1...' docker build -t php-runtime:8.0 ./runtimes/php-8.0 echo 'Python 3.8...' diff --git a/runtimes/php-8.0/Dockerfile b/runtimes/php-8.0/Dockerfile index cca98c7e..04c08dba 100644 --- a/runtimes/php-8.0/Dockerfile +++ b/runtimes/php-8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-cli-alpine as step0 +FROM php:8.0.14-cli-alpine as step0 ENV PHP_SWOOLE_VERSION=v4.7.0 @@ -26,7 +26,7 @@ RUN \ make && make install && \ cd .. -FROM php:8.0-cli-alpine as final +FROM php:8.0.14-cli-alpine as final LABEL maintainer="team@appwrite.io" @@ -41,11 +41,6 @@ RUN \ curl-dev \ && apk add --no-cache \ libstdc++ \ - certbot \ - brotli-dev \ - yaml-dev \ - libmaxminddb-dev \ - libgomp \ && docker-php-ext-install opcache \ && apk del .deps \ && rm -rf /var/cache/apk/* @@ -61,7 +56,7 @@ WORKDIR /usr/local/src/ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -COPY --from=step0 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ +COPY --from=step0 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ COPY composer* /usr/local/src/ diff --git a/runtimes/php-8.1/Dockerfile b/runtimes/php-8.1/Dockerfile index 89483220..23549218 100644 --- a/runtimes/php-8.1/Dockerfile +++ b/runtimes/php-8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-cli-alpine as step0 +FROM php:8.1.0-cli-alpine as step0 ENV PHP_SWOOLE_VERSION=v4.7.0 @@ -10,10 +10,7 @@ RUN \ gcc \ g++ \ git \ - zlib-dev \ - brotli-dev \ - yaml-dev \ - libmaxminddb-dev + zlib-dev RUN docker-php-ext-install sockets @@ -26,7 +23,7 @@ RUN \ make && make install && \ cd .. -FROM php:8.1-cli-alpine as final +FROM php:8.1.0-cli-alpine as final LABEL maintainer="team@appwrite.io" @@ -41,11 +38,6 @@ RUN \ curl-dev \ && apk add --no-cache \ libstdc++ \ - certbot \ - brotli-dev \ - yaml-dev \ - libmaxminddb-dev \ - libgomp \ && docker-php-ext-install opcache \ && apk del .deps \ && rm -rf /var/cache/apk/* @@ -61,7 +53,7 @@ WORKDIR /usr/local/src/ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -COPY --from=step0 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/ +COPY --from=step0 /usr/local/lib/php/extensions/no-debug-non-zts-20210902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ COPY composer* /usr/local/src/ From 5a0434bd4dc04b6de0659581d74e1c0268fcda35 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 12:45:50 +0100 Subject: [PATCH 02/17] fix: ci tests execution --- .travis.yml | 5 +++-- Dockerfile | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc2be2af..cdfed034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,6 @@ before_script: - composer install --ignore-platform-reqs script: - - docker-compose up - - vendor/bin/psalm --show-info=true + - docker-compose up -d + - docker-compose exec tests vendor/bin/phpunit --debug + - docker-compose exec tests vendor/bin/psalm --show-info=true diff --git a/Dockerfile b/Dockerfile index 6f319c0e..6b9b2046 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,4 +35,4 @@ COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor # Add Source Code COPY . /usr/src/code -CMD [ "/usr/src/code/vendor/bin/phpunit", "--debug" ] \ No newline at end of file +CMD [ "tail", "-f", "/dev/null" ] From 7e9bd6522b46384e7401b9f70282940a36365c1a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:02:42 +0100 Subject: [PATCH 03/17] fix: ci on architecture --- .travis.yml | 1 + Dockerfile | 16 +++-------- tests/Runtimes/RuntimesTest.php | 48 +++++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index cdfed034..4c11984b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ before_script: fi - docker --version - composer install --ignore-platform-reqs + - runtimes/buildLocalOnly.sh script: - docker-compose up -d diff --git a/Dockerfile b/Dockerfile index 6b9b2046..874f800c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,26 +8,16 @@ WORKDIR /usr/local/src/ COPY composer.lock /usr/local/src/ COPY composer.json /usr/local/src/ -RUN composer update --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist - -FROM php:8.0-cli-alpine as final +RUN composer install --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist + +FROM php:8.0.14-cli-alpine as final LABEL maintainer="team@appwrite.io" - -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN \ - apk update \ - && apk add --no-cache make automake autoconf gcc g++ git brotli-dev \ - && docker-php-ext-install opcache WORKDIR /usr/src/code RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" - -RUN echo "opcache.enable_cli=1" >> $PHP_INI_DIR/php.ini - RUN echo "memory_limit=1024M" >> $PHP_INI_DIR/php.ini COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index c73b5500..01482327 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -3,26 +3,27 @@ namespace Appwrite\Tests; use Appwrite\Runtimes\Runtimes; +use phpDocumentor\Reflection\DocBlock\Tags\Var_; use PHPUnit\Framework\TestCase; use Utopia\Orchestration\Orchestration; use Utopia\Orchestration\Adapter\DockerAPI; +use Utopia\System\System; class RuntimesTest extends TestCase { - public $tests; - /** @var Runtimes $instance */ - public $instance; - public $functionsDir; - public $tempDir; - public $orchestration; - public $hostDirectory; + public array $tests; + public Runtimes $instance; + public string $functionsDir; + public string $tempDir; + public Orchestration $orchestration; + public string $hostDirectory; public function setUp(): void { $this->hostDirectory = getenv('CURRENT_DIR'); $this->functionsDir = $functionsDir = $this->hostDirectory . '/tests/resources'; - $this->tempDir = $tempDir = realpath('/tmp/builtCode'); + $this->tempDir = realpath('/tmp/builtCode'); $this->tests = [ // 'java-16.0' => [ @@ -38,7 +39,8 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'dart-2.12', 'tarname' => 'dart-2-12.tar.gz', - 'filename' => 'index.dart' + 'filename' => 'index.dart', + 'arch' => [System::X86] ], 'dart-2.13' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -46,7 +48,8 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'dart-2.13', 'tarname' => 'dart-2-13.tar.gz', - 'filename' => 'index.dart' + 'filename' => 'index.dart', + 'arch' => [System::X86] ], 'dart-2.14' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -54,7 +57,8 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'dart-2.14', 'tarname' => 'dart-2-14.tar.gz', - 'filename' => 'index.dart' + 'filename' => 'index.dart', + 'arch' => [System::X86] ], 'dart-2.15' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -62,7 +66,8 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'dart-2.15', 'tarname' => 'dart-2-15.tar.gz', - 'filename' => 'index.dart' + 'filename' => 'index.dart', + 'arch' => [System::X86] ], 'node-14.5' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -70,6 +75,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-14.5', 'tarname' => 'node-14-5.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-15.5' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -77,6 +83,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-15.5', 'tarname' => 'node-15-5.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-16' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -84,6 +91,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-16.0', 'tarname' => 'node-16.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-17' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -91,6 +99,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-17.0', 'tarname' => 'node-17.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'php-8.0' => [ 'code' => $functionsDir . '/php.tar.gz', @@ -98,6 +107,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'php-8.0', 'tarname' => 'php-8-0.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'php-8.1' => [ 'code' => $functionsDir . '/php.tar.gz', @@ -105,6 +115,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'php-8.1', 'tarname' => 'php-8-1.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.8' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -112,6 +123,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.8', 'tarname' => 'python-3-8.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.9' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -119,6 +131,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.9', 'tarname' => 'python-3-9.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.10' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -126,6 +139,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.10', 'tarname' => 'python-3-10.tar.gz', + 'arch' => [System::X86, System::ARM, System::PPC] ], 'deno-1.12' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -133,6 +147,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.12', 'tarname' => 'deno-1-12.tar.gz', + 'arch' => [System::X86, System::ARM] ], 'deno-1.13' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -140,6 +155,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.13', 'tarname' => 'deno-1-13.tar.gz', + 'arch' => [System::X86, System::ARM] ], 'deno-1.14' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -147,6 +163,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.14', 'tarname' => 'deno-1-14.tar.gz', + 'arch' => [System::X86, System::ARM] ], 'rust-1.55' => [ 'code' => $functionsDir . '/rust.tar.gz', @@ -154,6 +171,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'rust-1.55', 'tarname' => 'rust-1-55.tar.gz', + 'arch' => [System::X86, System::ARM] ], 'ruby-3.0' => [ 'code' => $functionsDir . '/ruby.tar.gz', @@ -161,6 +179,7 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'ruby-3.0', 'tarname' => 'ruby-3-0.tar.gz', + 'arch' => [System::X86, System::ARM] ], 'swift-5.5' => [ 'code' => $functionsDir . '/swift.tar.gz', @@ -168,12 +187,13 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'swift-5.5', 'tarname' => 'swift-5-5.tar.gz', + 'arch' => [System::X86] ] ]; $this->orchestration = new Orchestration(new DockerAPI()); $this->instance = new Runtimes(); $this->tests = array_filter($this->tests, function ($test) { - return array_key_exists($test['runtime'], $this->instance->getAll()); + return array_key_exists($test['runtime'], $this->instance->getAll()) && in_array(System::getArchEnum(), $test['arch']); }); } @@ -222,7 +242,7 @@ public function testGetRuntimes() public function testRunBuildCommand(): void { - foreach ($this->tests as $key => $test) { + foreach ($this->tests as $test) { // Get runtime $runtime = $this->instance->getAll()[$test['runtime']]; From 6fd598377c4f3ae48402cb60e139815d6d1e2695 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:07:40 +0100 Subject: [PATCH 04/17] fix: give more verbose errors on tests --- tests/Runtimes/RuntimesTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index 01482327..77a4ee2c 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -281,8 +281,8 @@ public function testRunBuildCommand(): void timeout: 600 ); - $this->assertEquals(true, $untarSuccess); - $this->assertEmpty($untarStderr); + $this->assertEquals(true, $untarSuccess, $untarStderr); + $this->assertEmpty($untarStderr, $untarStderr); // Build Code / Install Dependencies $buildStdout = ''; @@ -299,7 +299,7 @@ public function testRunBuildCommand(): void timeout: 600 ); - $this->assertEquals(true, $buildSuccess); + $this->assertEquals(true, $buildSuccess, $buildStderr); // Repackage Code and Save. $compressStdout = ''; @@ -317,10 +317,10 @@ public function testRunBuildCommand(): void timeout: 60 ); - $this->assertEquals(true, $compressSuccess); + $this->assertEquals(true, $compressSuccess, $compressStderr); // $this->assertEquals(true, file_exists($builtCodePath)); // Check needs to be reimplemented. // It attempts to check the container's file system, but the compiled code is on the host's filesystem. - $this->assertEmpty($compressStderr); + $this->assertEmpty($compressStderr, $compressStderr); // Remove container $this->orchestration->remove($id, true); From 97191552d9dc323d864141fe0ccbe38fafd9d089 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:28:40 +0100 Subject: [PATCH 05/17] fix: allow ci builds to fail --- runtimes/buildLocalOnly.sh | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/runtimes/buildLocalOnly.sh b/runtimes/buildLocalOnly.sh index 45e8d091..fd9fbb75 100755 --- a/runtimes/buildLocalOnly.sh +++ b/runtimes/buildLocalOnly.sh @@ -1,67 +1,67 @@ echo 'Starting build...' echo 'Dart 2.12...' -docker build -t dart-runtime:2.12 ./runtimes/dart-2.12 +docker build -t dart-runtime:2.12 ./runtimes/dart-2.12 || true echo 'Dart 2.13...' -docker build -t dart-runtime:2.13 ./runtimes/dart-2.13 +docker build -t dart-runtime:2.13 ./runtimes/dart-2.13 || true echo 'Dart 2.14...' -docker build -t dart-runtime:2.14 ./runtimes/dart-2.14 +docker build -t dart-runtime:2.14 ./runtimes/dart-2.14 || true echo 'Dart 2.15...' -docker build -t dart-runtime:2.15 ./runtimes/dart-2.15 +docker build -t dart-runtime:2.15 ./runtimes/dart-2.15 || true echo 'Deno 1.12...' -docker build -t deno-runtime:1.12 ./runtimes/deno-1.12 +docker build -t deno-runtime:1.12 ./runtimes/deno-1.12 || true echo 'Deno 1.13...' -docker build -t deno-runtime:1.13 ./runtimes/deno-1.13 +docker build -t deno-runtime:1.13 ./runtimes/deno-1.13 || true echo 'Deno 1.14...' -docker build -t deno-runtime:1.14 ./runtimes/deno-1.14 +docker build -t deno-runtime:1.14 ./runtimes/deno-1.14 || true echo 'Node 14.5...' -docker build -t node-runtime:14.5 ./runtimes/node-14.5 +docker build -t node-runtime:14.5 ./runtimes/node-14.5 || true echo 'Node 15.5...' -docker build -t node-runtime:15.5 ./runtimes/node-15.5 +docker build -t node-runtime:15.5 ./runtimes/node-15.5 || true echo 'Node 16...' -docker build -t node-runtime:16.0 ./runtimes/node-16.0 +docker build -t node-runtime:16.0 ./runtimes/node-16.0 || true echo 'Node 17...' -docker build -t node-runtime:17.0 ./runtimes/node-17.0 +docker build -t node-runtime:17.0 ./runtimes/node-17.0 || true echo 'PHP 8.0...' -docker build -t php-runtime:8.0 ./runtimes/php-8.0 +docker build -t php-runtime:8.0 ./runtimes/php-8.0 || true echo 'PHP 8.1...' -docker build -t php-runtime:8.0 ./runtimes/php-8.0 +docker build -t php-runtime:8.0 ./runtimes/php-8.0 || true echo 'Python 3.8...' -docker build -t python-runtime:3.8 ./runtimes/python-3.8 +docker build -t python-runtime:3.8 ./runtimes/python-3.8 || true echo 'Python 3.9...' -docker build -t python-runtime:3.9 ./runtimes/python-3.9 +docker build -t python-runtime:3.9 ./runtimes/python-3.9 || true echo 'Python 3.10...' -docker build -t python-runtime:3.10 ./runtimes/python-3.10 +docker build -t python-runtime:3.10 ./runtimes/python-3.10 || true echo 'Rust 1.55' -docker build -t rust-runtime:1.55 ./runtimes/rust-1.55 +docker build -t rust-runtime:1.55 ./runtimes/rust-1.55 || true echo 'Ruby 3.0' -docker build -t ruby-runtime:3.0 ./runtimes/ruby-3.0 +docker build -t ruby-runtime:3.0 ./runtimes/ruby-3.0 || true echo 'Alpine 3.13.6...' -docker build -t appwrite-alpine:3.13.6 ./runtimes/alpine-3.13.6 +docker build -t appwrite-alpine:3.13.6 ./runtimes/alpine-3.13.6 || true echo 'Ubuntu 20.04' -docker build -t appwrite-ubuntu:20.04 ./runtimes/ubuntu-20.04 +docker build -t appwrite-ubuntu:20.04 ./runtimes/ubuntu-20.04 || true echo 'Java 16.0...' -docker build -t java-runtime:16.0 ./runtimes/java-16.0 +docker build -t java-runtime:16.0 ./runtimes/java-16.0 || true echo 'Swift 5.5...' -docker build -t swift-runtime:5.5 ./runtimes/swift-5.5 +docker build -t swift-runtime:5.5 ./runtimes/swift-5.5 || true From 0b08e76d3a362d3e957a502835be6632ea9345f6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:33:08 +0100 Subject: [PATCH 06/17] tests: remove arch from array --- tests/Runtimes/RuntimesTest.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index 77a4ee2c..e7138528 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -40,7 +40,6 @@ public function setUp(): void 'runtime' => 'dart-2.12', 'tarname' => 'dart-2-12.tar.gz', 'filename' => 'index.dart', - 'arch' => [System::X86] ], 'dart-2.13' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -49,7 +48,6 @@ public function setUp(): void 'runtime' => 'dart-2.13', 'tarname' => 'dart-2-13.tar.gz', 'filename' => 'index.dart', - 'arch' => [System::X86] ], 'dart-2.14' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -58,7 +56,6 @@ public function setUp(): void 'runtime' => 'dart-2.14', 'tarname' => 'dart-2-14.tar.gz', 'filename' => 'index.dart', - 'arch' => [System::X86] ], 'dart-2.15' => [ 'code' => $functionsDir . '/dart.tar.gz', @@ -67,7 +64,6 @@ public function setUp(): void 'runtime' => 'dart-2.15', 'tarname' => 'dart-2-15.tar.gz', 'filename' => 'index.dart', - 'arch' => [System::X86] ], 'node-14.5' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -75,7 +71,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-14.5', 'tarname' => 'node-14-5.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-15.5' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -83,7 +78,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-15.5', 'tarname' => 'node-15-5.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-16' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -91,7 +85,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-16.0', 'tarname' => 'node-16.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'node-17' => [ 'code' => $functionsDir . '/node.tar.gz', @@ -99,7 +92,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'node-17.0', 'tarname' => 'node-17.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'php-8.0' => [ 'code' => $functionsDir . '/php.tar.gz', @@ -107,7 +99,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'php-8.0', 'tarname' => 'php-8-0.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'php-8.1' => [ 'code' => $functionsDir . '/php.tar.gz', @@ -115,7 +106,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'php-8.1', 'tarname' => 'php-8-1.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.8' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -123,7 +113,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.8', 'tarname' => 'python-3-8.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.9' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -131,7 +120,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.9', 'tarname' => 'python-3-9.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'python-3.10' => [ 'code' => $functionsDir . '/python.tar.gz', @@ -139,7 +127,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'python-3.10', 'tarname' => 'python-3-10.tar.gz', - 'arch' => [System::X86, System::ARM, System::PPC] ], 'deno-1.12' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -147,7 +134,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.12', 'tarname' => 'deno-1-12.tar.gz', - 'arch' => [System::X86, System::ARM] ], 'deno-1.13' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -155,7 +141,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.13', 'tarname' => 'deno-1-13.tar.gz', - 'arch' => [System::X86, System::ARM] ], 'deno-1.14' => [ 'code' => $functionsDir . '/deno.tar.gz', @@ -163,7 +148,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'deno-1.14', 'tarname' => 'deno-1-14.tar.gz', - 'arch' => [System::X86, System::ARM] ], 'rust-1.55' => [ 'code' => $functionsDir . '/rust.tar.gz', @@ -171,7 +155,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'rust-1.55', 'tarname' => 'rust-1-55.tar.gz', - 'arch' => [System::X86, System::ARM] ], 'ruby-3.0' => [ 'code' => $functionsDir . '/ruby.tar.gz', @@ -179,7 +162,6 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'ruby-3.0', 'tarname' => 'ruby-3-0.tar.gz', - 'arch' => [System::X86, System::ARM] ], 'swift-5.5' => [ 'code' => $functionsDir . '/swift.tar.gz', @@ -187,13 +169,12 @@ public function setUp(): void 'timeout' => 15, 'runtime' => 'swift-5.5', 'tarname' => 'swift-5-5.tar.gz', - 'arch' => [System::X86] ] ]; $this->orchestration = new Orchestration(new DockerAPI()); $this->instance = new Runtimes(); $this->tests = array_filter($this->tests, function ($test) { - return array_key_exists($test['runtime'], $this->instance->getAll()) && in_array(System::getArchEnum(), $test['arch']); + return array_key_exists($test['runtime'], $this->instance->getAll()); }); } From 22f22cd1a7d90d9dae362d829d5c70846bf01060 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:34:28 +0100 Subject: [PATCH 07/17] tests: fix style --- tests/Runtimes/RuntimesTest.php | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index e7138528..dbc74453 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -182,7 +182,7 @@ public function tearDown(): void { } - public function testSupportedRuntimes() + public function testSupportedRuntimes(): void { $this->assertNotEmpty($this->instance->get('node')); $this->assertNotEmpty($this->instance->getAll()); @@ -192,7 +192,7 @@ public function testSupportedRuntimes() $this->assertCount(2, $this->instance->getAll(filter: ['node-14.5', 'node-15.5'])); } - public function testGetRuntimes() + public function testGetRuntimes(): void { foreach ($this->instance->getAll() as $runtime) { $this->assertArrayHasKey('name', $runtime, $runtime['name']); @@ -274,7 +274,7 @@ public function testRunBuildCommand(): void command: ['sh', '-c', 'cd /usr/local/src && ./build.sh'], vars: [ 'ENTRYPOINT_NAME' => $test['entrypoint'], - ], + ], stdout: $buildStdout, stderr: $buildStderr, timeout: 600 @@ -286,12 +286,12 @@ public function testRunBuildCommand(): void $compressStdout = ''; $compressStderr = ''; - $builtCodePath = $this->tempDir.'/'.$test['tarname']; + $builtCodePath = $this->tempDir . '/' . $test['tarname']; $compressSuccess = $this->orchestration->execute( name: 'build-container', command: [ - 'tar', '-C', '/usr/code', '-czvf', '/usr/builtCode/'.$test['tarname'], './' + 'tar', '-C', '/usr/code', '-czvf', '/usr/builtCode/' . $test['tarname'], './' ], stdout: $compressStdout, stderr: $compressStderr, @@ -311,7 +311,7 @@ public function testRunBuildCommand(): void /** * @depends testRunBuildCommand */ - public function testRunRuntimes() + public function testRunRuntimes(): void { $stdout = $stderr = ''; $secret = \bin2hex(\random_bytes(16)); @@ -326,7 +326,7 @@ public function testRunRuntimes() 'INTERNAL_RUNTIME_KEY' => $secret, ], volumes: [ - $this->tempDir.'/'.$test['tarname'].":/tmp/code.tar.gz" + $this->tempDir . '/' . $test['tarname'] . ":/tmp/code.tar.gz" ] ); @@ -355,7 +355,7 @@ public function testRunRuntimes() \curl_setopt($ch, CURLOPT_URL, "http://" . $key . ":3000/"); \curl_setopt($ch, CURLOPT_POST, true); \curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - + \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \curl_setopt($ch, CURLOPT_TIMEOUT, 60); \curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); @@ -364,11 +364,11 @@ public function testRunRuntimes() 'Content-Length: ' . \strlen($body), 'x-internal-challenge: ' . $secret ]); - + $executorResponse = \curl_exec($ch); - + $error = \curl_error($ch); - + $errNo = \curl_errno($ch); $response = json_decode($executorResponse, true); @@ -385,7 +385,7 @@ public function testRunRuntimes() /** * @depends testRunRuntimes */ - public function testRuntimeSecurityFail() + public function testRuntimeSecurityFail(): void { $stdout = $stderr = ''; $secret = 'secret'; @@ -400,7 +400,7 @@ public function testRuntimeSecurityFail() 'INTERNAL_RUNTIME_KEY' => $secret, ], volumes: [ - $this->tempDir.'/'.$test['tarname'].":/tmp/code.tar.gz" + $this->tempDir . '/' . $test['tarname'] . ":/tmp/code.tar.gz" ] ); @@ -426,7 +426,7 @@ public function testRuntimeSecurityFail() \curl_setopt($ch, CURLOPT_URL, "http://" . $key . ":3000/"); \curl_setopt($ch, CURLOPT_POST, true); \curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - + \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \curl_setopt($ch, CURLOPT_TIMEOUT, 60); \curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); @@ -435,11 +435,11 @@ public function testRuntimeSecurityFail() 'Content-Length: ' . \strlen($body), 'x-internal-challenge: ' . 'notthesecretexpected' ]); - + $executorResponse = \curl_exec($ch); - + $error = \curl_error($ch); - + $errNo = \curl_errno($ch); // Remove container From b9797d488ce6d964a42505f2ab31f88e512c2b6c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:35:53 +0100 Subject: [PATCH 08/17] tests: remove ppc support --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c11984b..3db48a2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ php: arch: - amd64 - - ppc64le - arm64 services: From c020650c3cf02d553139f62218ea8cae1e558d5e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 13:50:01 +0100 Subject: [PATCH 09/17] ci: use latest docker compose --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3db48a2b..2f0d382e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,11 @@ before_script: echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin fi - docker --version + # Install latest Compose + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin - composer install --ignore-platform-reqs - runtimes/buildLocalOnly.sh From 045a5971348cac45c70f8385e15b88761212cb98 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:01:33 +0100 Subject: [PATCH 10/17] ci: use buildkit and compose v2 --- .travis.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f0d382e..2e95e1b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,28 +7,38 @@ arch: - amd64 - arm64 -services: - - docker - notifications: email: - team@appwrite.io before_script: + # Install latest Docker + - curl -fsSL https://get.docker.com | sh + # Enable Buildkit in Docker config + - 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 - > if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin fi - docker --version # Install latest Compose - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin + - mkdir -p ~/.docker/cli-plugins/ + - curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose + - chmod +x ~/.docker/cli-plugins/docker-compose + - docker compose version + # Enable Buildkit + - docker buildx create --name travis_builder --use + - export COMPOSE_INTERACTIVE_NO_CLI + - export DOCKER_BUILDKIT=1 + - export COMPOSE_DOCKER_CLI_BUILD=1 + - export BUILDKIT_PROGRESS=plain - composer install --ignore-platform-reqs - runtimes/buildLocalOnly.sh script: - - docker-compose up -d - - docker-compose exec tests vendor/bin/phpunit --debug - - docker-compose exec tests vendor/bin/psalm --show-info=true + - docker compose up -d + - docker compose exec tests vendor/bin/phpunit --debug + - docker compose exec tests vendor/bin/psalm --show-info=true From 74ea8d583caee5e7a393257d62d7a05258f4b98b Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:06:01 +0100 Subject: [PATCH 11/17] revert: compose2 change --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e95e1b6..6834022a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,11 @@ before_script: fi - docker --version # Install latest Compose - - mkdir -p ~/.docker/cli-plugins/ - - curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose - - chmod +x ~/.docker/cli-plugins/docker-compose - - docker compose version + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + # Enable Buildkit - docker buildx create --name travis_builder --use - export COMPOSE_INTERACTIVE_NO_CLI @@ -39,6 +40,6 @@ before_script: - runtimes/buildLocalOnly.sh script: - - docker compose up -d - - docker compose exec tests vendor/bin/phpunit --debug - - docker compose exec tests vendor/bin/psalm --show-info=true + - docker-compose up -d + - docker-compose exec tests vendor/bin/phpunit --debug + - docker-compose exec tests vendor/bin/psalm --show-info=true From 11eb0edf08c214cca57ca7741aa7851f049886c4 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:26:18 +0100 Subject: [PATCH 12/17] ci: fix compose --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6834022a..530a400b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,8 @@ before_script: fi - docker --version # Install latest Compose - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin + - sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + - sudo chmod +x /usr/local/bin/docker-compose # Enable Buildkit - docker buildx create --name travis_builder --use From 7ebe913fe5486576ccecb7a82d1507439cf44e04 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:32:20 +0100 Subject: [PATCH 13/17] ci: fix arm compose --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 530a400b..05475f99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,9 +25,8 @@ before_script: fi - docker --version # Install latest Compose - - sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - - sudo chmod +x /usr/local/bin/docker-compose - + - curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + - chmod +x /usr/local/bin/docker-compose # Enable Buildkit - docker buildx create --name travis_builder --use - export COMPOSE_INTERACTIVE_NO_CLI From 22cfce07a81ec14613661650c9029dc76533a8e0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:35:43 +0100 Subject: [PATCH 14/17] fix: docker --- .travis.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05475f99..5fcdb917 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,18 +7,14 @@ arch: - amd64 - arm64 +services: + - docker + notifications: email: - team@appwrite.io -before_script: - # Install latest Docker - - curl -fsSL https://get.docker.com | sh - # Enable Buildkit in Docker config - - 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 +before_script: - > if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin From 68724a2ca533e524cee5b7f3e649f88e7001b8b5 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:37:20 +0100 Subject: [PATCH 15/17] ci: fix docker compose --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5fcdb917..c504c73e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,15 +20,6 @@ before_script: echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin fi - docker --version - # Install latest Compose - - curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - - chmod +x /usr/local/bin/docker-compose - # Enable Buildkit - - docker buildx create --name travis_builder --use - - export COMPOSE_INTERACTIVE_NO_CLI - - export DOCKER_BUILDKIT=1 - - export COMPOSE_DOCKER_CLI_BUILD=1 - - export BUILDKIT_PROGRESS=plain - composer install --ignore-platform-reqs - runtimes/buildLocalOnly.sh From 4e470104c4cd9e7f373abe2870425ea14157fa9f Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 14:54:07 +0100 Subject: [PATCH 16/17] ci: fix permissions --- tests/Runtimes/RuntimesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index dbc74453..5e4310b5 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -291,7 +291,7 @@ public function testRunBuildCommand(): void $compressSuccess = $this->orchestration->execute( name: 'build-container', command: [ - 'tar', '-C', '/usr/code', '-czvf', '/usr/builtCode/' . $test['tarname'], './' + 'sudo', 'tar', '-C', '/usr/code', '-czvf', $builtCodePath, './' ], stdout: $compressStdout, stderr: $compressStderr, From 7d0f923b81e9b9d6c64cc73bc9b5bc8ef470874a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 25 Jan 2022 17:08:16 +0100 Subject: [PATCH 17/17] ci: fix --- .travis.yml | 1 + tests/Runtimes/RuntimesTest.php | 42 ++++++++++++++++----------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index c504c73e..83bc2102 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ before_script: - docker --version - composer install --ignore-platform-reqs - runtimes/buildLocalOnly.sh + - mkdir /tmp/builtCode script: - docker-compose up -d diff --git a/tests/Runtimes/RuntimesTest.php b/tests/Runtimes/RuntimesTest.php index 5e4310b5..d350c099 100644 --- a/tests/Runtimes/RuntimesTest.php +++ b/tests/Runtimes/RuntimesTest.php @@ -3,11 +3,9 @@ namespace Appwrite\Tests; use Appwrite\Runtimes\Runtimes; -use phpDocumentor\Reflection\DocBlock\Tags\Var_; use PHPUnit\Framework\TestCase; use Utopia\Orchestration\Orchestration; use Utopia\Orchestration\Adapter\DockerAPI; -use Utopia\System\System; class RuntimesTest extends TestCase { @@ -21,7 +19,7 @@ class RuntimesTest extends TestCase public function setUp(): void { $this->hostDirectory = getenv('CURRENT_DIR'); - $this->functionsDir = $functionsDir = $this->hostDirectory . '/tests/resources'; + $this->functionsDir = $this->hostDirectory . '/tests/resources'; $this->tempDir = realpath('/tmp/builtCode'); @@ -34,7 +32,7 @@ public function setUp(): void // 'tarname' => 'java-16-0.tar.gz', // ], 'dart-2.12' => [ - 'code' => $functionsDir . '/dart.tar.gz', + 'code' => $this->functionsDir . '/dart.tar.gz', 'entrypoint' => 'index.dart', 'timeout' => 15, 'runtime' => 'dart-2.12', @@ -42,7 +40,7 @@ public function setUp(): void 'filename' => 'index.dart', ], 'dart-2.13' => [ - 'code' => $functionsDir . '/dart.tar.gz', + 'code' => $this->functionsDir . '/dart.tar.gz', 'entrypoint' => 'index.dart', 'timeout' => 15, 'runtime' => 'dart-2.13', @@ -50,7 +48,7 @@ public function setUp(): void 'filename' => 'index.dart', ], 'dart-2.14' => [ - 'code' => $functionsDir . '/dart.tar.gz', + 'code' => $this->functionsDir . '/dart.tar.gz', 'entrypoint' => 'index.dart', 'timeout' => 15, 'runtime' => 'dart-2.14', @@ -58,7 +56,7 @@ public function setUp(): void 'filename' => 'index.dart', ], 'dart-2.15' => [ - 'code' => $functionsDir . '/dart.tar.gz', + 'code' => $this->functionsDir . '/dart.tar.gz', 'entrypoint' => 'index.dart', 'timeout' => 15, 'runtime' => 'dart-2.15', @@ -66,105 +64,105 @@ public function setUp(): void 'filename' => 'index.dart', ], 'node-14.5' => [ - 'code' => $functionsDir . '/node.tar.gz', + 'code' => $this->functionsDir . '/node.tar.gz', 'entrypoint' => 'index.js', 'timeout' => 15, 'runtime' => 'node-14.5', 'tarname' => 'node-14-5.tar.gz', ], 'node-15.5' => [ - 'code' => $functionsDir . '/node.tar.gz', + 'code' => $this->functionsDir . '/node.tar.gz', 'entrypoint' => 'index.js', 'timeout' => 15, 'runtime' => 'node-15.5', 'tarname' => 'node-15-5.tar.gz', ], 'node-16' => [ - 'code' => $functionsDir . '/node.tar.gz', + 'code' => $this->functionsDir . '/node.tar.gz', 'entrypoint' => 'index.js', 'timeout' => 15, 'runtime' => 'node-16.0', 'tarname' => 'node-16.tar.gz', ], 'node-17' => [ - 'code' => $functionsDir . '/node.tar.gz', + 'code' => $this->functionsDir . '/node.tar.gz', 'entrypoint' => 'index.js', 'timeout' => 15, 'runtime' => 'node-17.0', 'tarname' => 'node-17.tar.gz', ], 'php-8.0' => [ - 'code' => $functionsDir . '/php.tar.gz', + 'code' => $this->functionsDir . '/php.tar.gz', 'entrypoint' => 'index.php', 'timeout' => 15, 'runtime' => 'php-8.0', 'tarname' => 'php-8-0.tar.gz', ], 'php-8.1' => [ - 'code' => $functionsDir . '/php.tar.gz', + 'code' => $this->functionsDir . '/php.tar.gz', 'entrypoint' => 'index.php', 'timeout' => 15, 'runtime' => 'php-8.1', 'tarname' => 'php-8-1.tar.gz', ], 'python-3.8' => [ - 'code' => $functionsDir . '/python.tar.gz', + 'code' => $this->functionsDir . '/python.tar.gz', 'entrypoint' => 'index.py', 'timeout' => 15, 'runtime' => 'python-3.8', 'tarname' => 'python-3-8.tar.gz', ], 'python-3.9' => [ - 'code' => $functionsDir . '/python.tar.gz', + 'code' => $this->functionsDir . '/python.tar.gz', 'entrypoint' => 'index.py', 'timeout' => 15, 'runtime' => 'python-3.9', 'tarname' => 'python-3-9.tar.gz', ], 'python-3.10' => [ - 'code' => $functionsDir . '/python.tar.gz', + 'code' => $this->functionsDir . '/python.tar.gz', 'entrypoint' => 'index.py', 'timeout' => 15, 'runtime' => 'python-3.10', 'tarname' => 'python-3-10.tar.gz', ], 'deno-1.12' => [ - 'code' => $functionsDir . '/deno.tar.gz', + 'code' => $this->functionsDir . '/deno.tar.gz', 'entrypoint' => 'index.ts', 'timeout' => 15, 'runtime' => 'deno-1.12', 'tarname' => 'deno-1-12.tar.gz', ], 'deno-1.13' => [ - 'code' => $functionsDir . '/deno.tar.gz', + 'code' => $this->functionsDir . '/deno.tar.gz', 'entrypoint' => 'index.ts', 'timeout' => 15, 'runtime' => 'deno-1.13', 'tarname' => 'deno-1-13.tar.gz', ], 'deno-1.14' => [ - 'code' => $functionsDir . '/deno.tar.gz', + 'code' => $this->functionsDir . '/deno.tar.gz', 'entrypoint' => 'index.ts', 'timeout' => 15, 'runtime' => 'deno-1.14', 'tarname' => 'deno-1-14.tar.gz', ], 'rust-1.55' => [ - 'code' => $functionsDir . '/rust.tar.gz', + 'code' => $this->functionsDir . '/rust.tar.gz', 'entrypoint' => 'index.rs', 'timeout' => 15, 'runtime' => 'rust-1.55', 'tarname' => 'rust-1-55.tar.gz', ], 'ruby-3.0' => [ - 'code' => $functionsDir . '/ruby.tar.gz', + 'code' => $this->functionsDir . '/ruby.tar.gz', 'entrypoint' => 'index.rb', 'timeout' => 15, 'runtime' => 'ruby-3.0', 'tarname' => 'ruby-3-0.tar.gz', ], 'swift-5.5' => [ - 'code' => $functionsDir . '/swift.tar.gz', + 'code' => $this->functionsDir . '/swift.tar.gz', 'entrypoint' => 'index.swift', 'timeout' => 15, 'runtime' => 'swift-5.5',