diff --git a/Dockerfile b/Dockerfile index 38bbb0abeb..57e99f4da4 100755 --- a/Dockerfile +++ b/Dockerfile @@ -269,6 +269,7 @@ RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/install && \ chmod +x /usr/local/bin/migrate && \ chmod +x /usr/local/bin/realtime && \ + chmod +x /usr/local/bin/executor && \ chmod +x /usr/local/bin/schedule && \ chmod +x /usr/local/bin/sdks && \ chmod +x /usr/local/bin/specs && \ @@ -282,8 +283,7 @@ RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/worker-functions && \ chmod +x /usr/local/bin/worker-builds && \ chmod +x /usr/local/bin/worker-mails && \ - chmod +x /usr/local/bin/worker-webhooks && \ - chmod +x /usr/local/bin/executor + chmod +x /usr/local/bin/worker-webhooks # Letsencrypt Permissions RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ diff --git a/app/tasks/usage.php b/app/tasks/usage.php index aa8c42bcb8..67795e872b 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -377,7 +377,6 @@ $cli $loopTook = microtime(true) - $loopStart; $now = date('d-m-Y H:i:s', time()); Console::info("[{$now}] Aggregation took {$loopTook} seconds"); - Console::warning($e->getTraceAsString()); return; } diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 6451d67eb4..f3327ac2c5 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -174,16 +174,6 @@ services: - appwrite environment: - _APP_ENV - - _APP_OPENSSL_KEY_V1 - - _APP_REDIS_HOST - - _APP_REDIS_PORT - - _APP_REDIS_USER - - _APP_REDIS_PASS - - _APP_DB_HOST - - _APP_DB_PORT - - _APP_DB_SCHEMA - - _APP_DB_USER - - _APP_DB_PASS - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_BUILD_TIMEOUT - _APP_FUNCTIONS_CONTAINERS @@ -193,13 +183,11 @@ services: - _APP_FUNCTIONS_MEMORY_SWAP - _APP_EXECUTOR_SECRET - _APP_EXECUTOR_RUNTIME_NETWORK - - _APP_USAGE_STATS - - _APP_STATSD_HOST - - _APP_STATSD_PORT - _APP_LOGGING_PROVIDER - _APP_LOGGING_CONFIG - DOCKERHUB_PULL_USERNAME - DOCKERHUB_PULL_PASSWORD + - OPENRUNTIMES_INACTIVE_THRESHOLD appwrite-worker-database: image: /: diff --git a/src/Appwrite/Utopia/Response/Model/Build.php b/src/Appwrite/Utopia/Response/Model/Build.php index 218e82d5e3..a09ccafa5e 100644 --- a/src/Appwrite/Utopia/Response/Model/Build.php +++ b/src/Appwrite/Utopia/Response/Model/Build.php @@ -24,7 +24,7 @@ class Build extends Model ]) ->addRule('deploymentId', [ 'type' => self::TYPE_STRING, - 'description' => 'The deployment that created this build', + 'description' => 'The deployment that created this build.', 'default' => '', 'example' => '5e5ea5c16897e', ]) @@ -35,7 +35,7 @@ class Build extends Model // Building - The deployment is currently being built ->addRule('status', [ 'type' => self::TYPE_STRING, - 'description' => 'The build status.', + 'description' => 'The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built', 'default' => '', 'example' => 'ready', ]) @@ -71,17 +71,17 @@ class Build extends Model * * @return string */ - public function getName():string + public function getName(): string { return 'Build'; } /** - * Get Collection + * Get Type * * @return string */ - public function getType():string + public function getType(): string { return Response::MODEL_BUILD; } diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index c4afaafc9e..c409768b9b 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -122,9 +122,12 @@ class Func extends Model } /** - * Get Collection + * Filter Function * - * @return string + * Automatically converts a [] default to a stdClass, this is called while grabbing the document. + * + * @param Document $document + * @return Document */ public function filter(Document $document): Document { diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 841e1ab64a..659ad16170 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -31,6 +31,25 @@ class Executor $this->endpoint = $endpoint; } + /** + * Create runtime + * + * Launches a runtime container for a deployment ready for execution + * + * @param string $functionId + * @param string $deploymentId + * @param string $projectId + * @param string $source + * @param string $runtime + * @param string $baseImage + * @param bool $remove + * @param string $entrypoint + * @param string $workdir + * @param string $destinaction + * @param string $network + * @param array $vars + * @param array $commands + */ public function createRuntime( string $deploymentId, string $projectId, @@ -74,6 +93,14 @@ class Executor return $response['body']; } + /** + * Delete Runtime + * + * Deletes a runtime and cleans up any containers remaining. + * + * @param string $projectId + * @param string $deploymentId + */ public function deleteRuntime(string $projectId, string $deploymentId) { $runtimeId = "$projectId-$deploymentId"; @@ -95,6 +122,22 @@ class Executor return $response['body']; } + /** + * Create an execution + * + * @param string $projectId + * @param string $functionId + * @param string $deploymentId + * @param string $path + * @param array $vars + * @param string $entrypoint + * @param string $data + * @param string runtime + * @param string $baseImage + * @param int $timeout + * + * @return array + */ public function createExecution( string $projectId, string $deploymentId, @@ -106,7 +149,6 @@ class Executor string $baseImage, $timeout ) { - $route = "/execution"; $headers = [ 'content-type' => 'application/json',