From fe27670e1f255587b32c3cceb47d5feb50e91b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:39:43 +0100 Subject: [PATCH 01/14] New attribute + migration --- app/config/collections.php | 11 ++++ src/Appwrite/Migration/Migration.php | 1 + src/Appwrite/Migration/Version/V17.php | 76 ++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/Appwrite/Migration/Version/V17.php diff --git a/app/config/collections.php b/app/config/collections.php index d23f452b08..a4ccc6eeb4 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2627,6 +2627,17 @@ $collections = [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('outputSize'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('stderr'), 'type' => Database::VAR_STRING, diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index d98746520a..a0c237fd5f 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -48,6 +48,7 @@ abstract class Migration '1.1.0' => 'V16', '1.1.1' => 'V16', '1.1.2' => 'V16', + '1.2.0' => 'V17', ]; /** diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php new file mode 100644 index 0000000000..c7e73fa1b5 --- /dev/null +++ b/src/Appwrite/Migration/Version/V17.php @@ -0,0 +1,76 @@ + null, + fn () => [] + ); + } + + Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); + + Console::info('Migrating Collections'); + $this->migrateCollections(); + + // Console::info('Migrating Documents'); + // $this->forEachDocument([$this, 'fixDocument']); + } + + /** + * Migrate all Collections. + * + * @return void + */ + protected function migrateCollections(): void + { + foreach ($this->collections as $collection) { + $id = $collection['$id']; + + Console::log("Migrating Collection \"{$id}\""); + + $this->projectDB->setNamespace("_{$this->project->getInternalId()}"); + + switch ($id) { + case 'builds': + try { + /** + * Create 'region' attribute + */ + $this->createAttributeFromCollection($this->projectDB, $id, 'outputSize'); + } catch (\Throwable $th) { + Console::warning("'region' from {$id}: {$th->getMessage()}"); + } + default: + break; + } + + usleep(50000); + } + } + + /** + * Fix run on each document + * + * @param \Utopia\Database\Document $document + * @return \Utopia\Database\Document + */ + protected function fixDocument(Document $document) + { + return $document; + } +} \ No newline at end of file From b513c2fbad7f388ea280db298477e8a0a0942dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:40:04 +0100 Subject: [PATCH 02/14] Store build output size to DB --- app/workers/builds.php | 1 + docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index d26f07ab75..eb9d2e6762 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -194,6 +194,7 @@ class BuildsV1 extends Worker $build->setAttribute('duration', \intval($response['duration'])); $build->setAttribute('status', $response['status']); $build->setAttribute('outputPath', $response['outputPath']); + $build->setAttribute('outputSize', $response['outputSize']); $build->setAttribute('stderr', $response['stderr']); $build->setAttribute('stdout', $response['stdout']); diff --git a/docker-compose.yml b/docker-compose.yml index 6c040df4cc..8ccb90c656 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -666,7 +666,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.1.6 + image: myexc networks: - appwrite - runtimes From d79eea0f4bbe05d4520af2e1faaa811def8e0dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:42:35 +0100 Subject: [PATCH 03/14] Send build size to stats --- src/Appwrite/Usage/Stats.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Appwrite/Usage/Stats.php b/src/Appwrite/Usage/Stats.php index e6e0056664..38fdc123cf 100644 --- a/src/Appwrite/Usage/Stats.php +++ b/src/Appwrite/Usage/Stats.php @@ -184,6 +184,7 @@ class Stats $functionBuild = $this->params['builds.{scope}.compute'] ?? 0; $functionBuildTime = ($this->params['buildTime'] ?? 0) * 1000; // ms + $functionBuildSize = ($this->params['buildSize'] ?? 0); // bytes $functionBuildStatus = $this->params['buildStatus'] ?? ''; $functionCompute = $functionExecutionTime + $functionBuildTime; $functionTags = $tags . ',functionId=' . $functionId; @@ -207,6 +208,7 @@ class Stats if ($functionBuild >= 1) { $this->statsd->increment('builds.{scope}.compute' . $functionTags . ',functionBuildStatus=' . $functionBuildStatus); $this->statsd->count('builds.{scope}.compute.time' . $functionTags, $functionBuildTime); + $this->statsd->count('builds.{scope}.storage.size' . $functionTags, $functionBuildSize); } if ($functionBuild + $functionExecution >= 1) { $this->statsd->count('project.{scope}.compute.time' . $functionTags, $functionCompute); From 2f53260197bb4a69fd13ac9db944d5c48e6c68b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:45:07 +0100 Subject: [PATCH 04/14] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index ea67861809..800aaa7014 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ - Increase Traefik TCP + file limits [#4673](https://github.com/appwrite/appwrite/pull/4673) - Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776) - Get default region from environment on project create [#4780](https://github.com/appwrite/appwrite/pull/4780) +- Store build output file size [#4844](https://github.com/appwrite/appwrite/pull/4844) # Version 1.1.2 ## Changes From de0de5f2254c8cfd961113c9e933fceab03bad84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:45:21 +0100 Subject: [PATCH 05/14] Linter fix --- src/Appwrite/Migration/Version/V17.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index c7e73fa1b5..2897826117 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -73,4 +73,4 @@ class V17 extends Migration { return $document; } -} \ No newline at end of file +} From d702f3581fb9bdb75bae43269c6f8bc860e6fffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 13:52:22 +0100 Subject: [PATCH 06/14] Fix bug --- src/Appwrite/Migration/Version/V17.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index 2897826117..d00df0a61e 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -55,6 +55,7 @@ class V17 extends Migration } catch (\Throwable $th) { Console::warning("'region' from {$id}: {$th->getMessage()}"); } + break; default: break; } From 746390e30acc3780276d5608aa1c07c4fcbd2156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 13 Dec 2022 08:10:51 +0100 Subject: [PATCH 07/14] Fix missing param --- app/workers/builds.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/workers/builds.php b/app/workers/builds.php index eb9d2e6762..c173b99fe5 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -261,6 +261,7 @@ class BuildsV1 extends Worker ->setParam('builds.{scope}.compute', 1) ->setParam('buildStatus', $build->getAttribute('status', '')) ->setParam('buildTime', $build->getAttribute('duration')) + ->setParam('buildSize', $build->getAttribute('outputSize')) ->setParam('networkRequestSize', 0) ->setParam('networkResponseSize', 0) ->submit(); From c5da386d6721c639c73f87918a98b67a121c3e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 18 Dec 2022 08:20:50 +0100 Subject: [PATCH 08/14] PR review changes --- app/config/collections.php | 4 ++-- app/workers/builds.php | 6 +++--- docker-compose.yml | 2 +- src/Appwrite/Migration/Version/V17.php | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index a4ccc6eeb4..7d4e224ec6 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2617,7 +2617,7 @@ $collections = [ 'filters' => [], ], [ - '$id' => ID::custom('outputPath'), + '$id' => ID::custom('path'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => 2048, @@ -2628,7 +2628,7 @@ $collections = [ 'filters' => [], ], [ - '$id' => ID::custom('outputSize'), + '$id' => ID::custom('size'), 'type' => Database::VAR_INTEGER, 'format' => '', 'size' => 0, diff --git a/app/workers/builds.php b/app/workers/builds.php index c173b99fe5..975af6532f 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -193,8 +193,8 @@ class BuildsV1 extends Worker $build->setAttribute('endTime', DateTime::format($endTime)); $build->setAttribute('duration', \intval($response['duration'])); $build->setAttribute('status', $response['status']); - $build->setAttribute('outputPath', $response['outputPath']); - $build->setAttribute('outputSize', $response['outputSize']); + $build->setAttribute('path', $response['path']); + $build->setAttribute('size', $response['size']); $build->setAttribute('stderr', $response['stderr']); $build->setAttribute('stdout', $response['stdout']); @@ -261,7 +261,7 @@ class BuildsV1 extends Worker ->setParam('builds.{scope}.compute', 1) ->setParam('buildStatus', $build->getAttribute('status', '')) ->setParam('buildTime', $build->getAttribute('duration')) - ->setParam('buildSize', $build->getAttribute('outputSize')) + ->setParam('buildSize', $build->getAttribute('size')) ->setParam('networkRequestSize', 0) ->setParam('networkResponseSize', 0) ->submit(); diff --git a/docker-compose.yml b/docker-compose.yml index 8ccb90c656..a24e739c89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -666,7 +666,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: myexc + image: meldiron/appwrite-executor:latest networks: - appwrite - runtimes diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index d00df0a61e..695d31bc8f 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -49,11 +49,11 @@ class V17 extends Migration case 'builds': try { /** - * Create 'region' attribute + * Create 'size' attribute */ - $this->createAttributeFromCollection($this->projectDB, $id, 'outputSize'); + $this->createAttributeFromCollection($this->projectDB, $id, 'size'); } catch (\Throwable $th) { - Console::warning("'region' from {$id}: {$th->getMessage()}"); + Console::warning("'size' from {$id}: {$th->getMessage()}"); } break; default: From 8f363eae7aa511aacdf3ccbced966b98fb0c18a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 18 Dec 2022 08:35:16 +0100 Subject: [PATCH 09/14] Fix bugs --- app/config/collections.php | 11 ----------- app/controllers/api/functions.php | 2 +- app/workers/builds.php | 12 +++++------- app/workers/deletes.php | 12 ++++++------ app/workers/functions.php | 2 +- src/Appwrite/Migration/Version/V17.php | 10 ++++++++++ 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index 4d8d734109..a8c7a46b18 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2561,17 +2561,6 @@ $collections = [ 'array' => false, 'filters' => ['datetime'], ], - [ - '$id' => ID::custom('endTime'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], [ '$id' => ID::custom('duration'), 'type' => Database::VAR_INTEGER, diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 6fe7c67e69..4c84795712 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1197,7 +1197,7 @@ App::post('/v1/functions/:functionId/executions') variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $build->getAttribute('outputPath', ''), + source: $build->getAttribute('path', ''), entrypoint: $deployment->getAttribute('entrypoint', ''), ); diff --git a/app/workers/builds.php b/app/workers/builds.php index 975af6532f..94c984caf8 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -99,13 +99,13 @@ class BuildsV1 extends Worker 'startTime' => $startTime, 'deploymentId' => $deployment->getId(), 'status' => 'processing', - 'outputPath' => '', + 'path' => '', + 'size' => 0, 'runtime' => $function->getAttribute('runtime'), 'source' => $deployment->getAttribute('path'), 'sourceType' => $device, 'stdout' => '', 'stderr' => '', - 'endTime' => null, 'duration' => 0 ])); $deployment->setAttribute('buildId', $buildId); @@ -186,11 +186,8 @@ class BuildsV1 extends Worker ] ); - $endTime = new \DateTime(); - $endTime->setTimestamp($response['endTimeUnix']); - /** Update the build document */ - $build->setAttribute('endTime', DateTime::format($endTime)); + $build->setAttribute('startTime', DateTime::format((new \DateTime())->setTimestamp($response['startTime']))); $build->setAttribute('duration', \intval($response['duration'])); $build->setAttribute('status', $response['status']); $build->setAttribute('path', $response['path']); @@ -225,12 +222,13 @@ class BuildsV1 extends Worker } catch (\Throwable $th) { $endTime = DateTime::now(); $interval = (new \DateTime($endTime))->diff(new \DateTime($startTime)); - $build->setAttribute('endTime', $endTime); + $build->setAttribute('duration', $interval->format('%s') + 0); $build->setAttribute('status', 'failed'); $build->setAttribute('stderr', $th->getMessage()); Console::error($th->getMessage()); } finally { + \var_dump($build); $build = $dbForProject->updateDocument('builds', $buildId, $build); /** diff --git a/app/workers/deletes.php b/app/workers/deletes.php index 458b341a45..6bf29cc3ff 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -486,10 +486,10 @@ class DeletesV1 extends Worker $this->deleteByGroup('builds', [ Query::equal('deploymentId', [$deploymentId]) ], $dbForProject, function (Document $document) use ($storageBuilds, $deploymentId) { - if ($storageBuilds->delete($document->getAttribute('outputPath', ''), true)) { - Console::success('Deleted build files: ' . $document->getAttribute('outputPath', '')); + if ($storageBuilds->delete($document->getAttribute('path', ''), true)) { + Console::success('Deleted build files: ' . $document->getAttribute('path', '')); } else { - Console::error('Failed to delete build files: ' . $document->getAttribute('outputPath', '')); + Console::error('Failed to delete build files: ' . $document->getAttribute('path', '')); } }); } @@ -535,10 +535,10 @@ class DeletesV1 extends Worker $this->deleteByGroup('builds', [ Query::equal('deploymentId', [$deploymentId]) ], $dbForProject, function (Document $document) use ($storageBuilds) { - if ($storageBuilds->delete($document->getAttribute('outputPath', ''), true)) { - Console::success('Deleted build files: ' . $document->getAttribute('outputPath', '')); + if ($storageBuilds->delete($document->getAttribute('path', ''), true)) { + Console::success('Deleted build files: ' . $document->getAttribute('path', '')); } else { - Console::error('Failed to delete build files: ' . $document->getAttribute('outputPath', '')); + Console::error('Failed to delete build files: ' . $document->getAttribute('path', '')); } }); diff --git a/app/workers/functions.php b/app/workers/functions.php index 31e64a2bb4..2e8dccc7aa 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -133,7 +133,7 @@ Server::setResource('execute', function () { variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $build->getAttribute('outputPath', ''), + source: $build->getAttribute('path', ''), entrypoint: $deployment->getAttribute('entrypoint', ''), ); diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index e719980635..d0f7372a9a 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -66,6 +66,16 @@ class V17 extends Migration } catch (\Throwable $th) { Console::warning("'size' from {$id}: {$th->getMessage()}"); } + + try { + /** + * Delete 'endTime' attribute (use startTime+duration if needed) + */ + $this->projectDB->deleteAttribute($id, 'startTime'); + $this->createAttributeFromCollection($this->projectDB, $id, 'startTime'); + } catch (\Throwable $th) { + Console::warning("'startTime' from {$id}: {$th->getMessage()}"); + } break; default: break; From 1a33ffa86756ec250ee046c9e89e7aa9f9451f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 18 Dec 2022 08:37:53 +0100 Subject: [PATCH 10/14] Linter fix --- src/Appwrite/Migration/Version/V17.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index d0f7372a9a..cef4ae0716 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -66,7 +66,7 @@ class V17 extends Migration } catch (\Throwable $th) { Console::warning("'size' from {$id}: {$th->getMessage()}"); } - + try { /** * Delete 'endTime' attribute (use startTime+duration if needed) From fdd9a1caf364b17c700689f4d0110626921bccc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 18 Dec 2022 08:40:56 +0100 Subject: [PATCH 11/14] Add size to build response --- src/Appwrite/Utopia/Response/Model/Build.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model/Build.php b/src/Appwrite/Utopia/Response/Model/Build.php index b76f0ee083..4d7a6cd27c 100644 --- a/src/Appwrite/Utopia/Response/Model/Build.php +++ b/src/Appwrite/Utopia/Response/Model/Build.php @@ -51,18 +51,18 @@ class Build extends Model 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, ]) - ->addRule('endTime', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'The time the build was finished in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, - ]) ->addRule('duration', [ 'type' => self::TYPE_INTEGER, 'description' => 'The build duration in seconds.', 'default' => 0, 'example' => 0, ]) + ->addRule('size', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'The code size in bytes.', + 'default' => 0, + 'example' => 128, + ]) ; } From ff7393985533a0cc5d7934ddf7e9ab320485bcfb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 18 Dec 2022 15:23:18 +0530 Subject: [PATCH 12/14] feat: update console and build args --- app/console | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/console b/app/console index c1ac63889c..43891a526e 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit c1ac63889c0a97b280599355e526669bb207880a +Subproject commit 43891a526e061454617cbb13def3c4901d99a7f1 diff --git a/docker-compose.yml b/docker-compose.yml index 7620039b63..feac2c89d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,7 @@ services: DEBUG: false TESTING: true VERSION: dev + VITE_CONSOLE_MODE: self-hosted ports: - 9501:80 networks: From b014eda788c63040092b7538c91bbea9b983dd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 20 Dec 2022 12:48:11 +0100 Subject: [PATCH 13/14] PR review changes --- docker-compose.yml | 2 +- src/Appwrite/Migration/Version/V17.php | 27 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8f6d5257e3..448a2ba2aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -657,7 +657,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: meldiron/appwrite-executor:latest + image: openruntimes/executor:0.2.0 networks: - appwrite - runtimes diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index cef4ae0716..e6877e7225 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -63,6 +63,7 @@ class V17 extends Migration * Create 'size' attribute */ $this->createAttributeFromCollection($this->projectDB, $id, 'size'); + $this->projectDB->deleteCachedCollection($id); } catch (\Throwable $th) { Console::warning("'size' from {$id}: {$th->getMessage()}"); } @@ -71,10 +72,30 @@ class V17 extends Migration /** * Delete 'endTime' attribute (use startTime+duration if needed) */ - $this->projectDB->deleteAttribute($id, 'startTime'); - $this->createAttributeFromCollection($this->projectDB, $id, 'startTime'); + $this->projectDB->deleteAttribute($id, 'endTime'); + $this->projectDB->deleteCachedCollection($id); } catch (\Throwable $th) { - Console::warning("'startTime' from {$id}: {$th->getMessage()}"); + Console::warning("'endTime' from {$id}: {$th->getMessage()}"); + } + + try { + /** + * Rename 'outputPath' to 'path' + */ + $this->projectDB->renameAttribute($id, 'outputPath', 'path'); + $this->projectDB->deleteCachedCollection($id); + } catch (\Throwable $th) { + Console::warning("'path' from {$id}: {$th->getMessage()}"); + } + + try { + /** + * Create 'size' + */ + $this->createAttributeFromCollection($this->projectDB, $id, 'size'); + $this->projectDB->deleteCachedCollection($id); + } catch (\Throwable $th) { + Console::warning("'size' from {$id}: {$th->getMessage()}"); } break; default: From e3737af3fec5cde9c4c15d88d6e94956826d6f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 20 Dec 2022 12:49:52 +0100 Subject: [PATCH 14/14] Update app/workers/builds.php Co-authored-by: Christy Jacob --- app/workers/builds.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index 94c984caf8..081537fdfb 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -228,7 +228,6 @@ class BuildsV1 extends Worker $build->setAttribute('stderr', $th->getMessage()); Console::error($th->getMessage()); } finally { - \var_dump($build); $build = $dbForProject->updateDocument('builds', $buildId, $build); /**