mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: keep the embeddings API on for installations that already run it
The gate defaulted _APP_EMBEDDING to disabled, so an upgrade with a pre-change .env turned every embeddings request into a service disabled error even though the container had been running. Default the API to enabled and leave only the resource-heavy container behind the Compose profile.
This commit is contained in:
3 files changed
+13
-11
No files matched your search
@@ -48,8 +48,8 @@ _APP_CONSOLE_GOOGLE_APP_ID=
|
||||
_APP_CONSOLE_GOOGLE_SECRET=
|
||||
# MariaDB and MongoDB only start when their profile is listed here; PostgreSQL always
|
||||
# runs because VectorsDB requires it. MongoDB is on by default for DocumentsDB.
|
||||
# The embedding service is resource-heavy and off by default; add 'embedding' here and
|
||||
# set _APP_EMBEDDING=enabled below to turn it on.
|
||||
# The embedding container is resource-heavy and off by default; add 'embedding' here to
|
||||
# start it. The embeddings API is on by default and is switched off below until then.
|
||||
COMPOSE_PROFILES=mongodb
|
||||
_APP_DB_ADAPTER=postgresql
|
||||
_APP_DB_HOST=postgresql
|
||||
|
||||
@@ -717,9 +717,9 @@ return [
|
||||
],
|
||||
[
|
||||
'name' => '_APP_EMBEDDING',
|
||||
'description' => 'Enables the embeddings API, backed by the resource-heavy appwrite-embedding container. That container is off by default (it is behind the "embedding" Compose profile), so start it and add "embedding" to COMPOSE_PROFILES before enabling this; until then the /v1/embeddings routes return a service disabled error. Default value is: disabled.',
|
||||
'description' => 'Enables the embeddings API, backed by the resource-heavy appwrite-embedding container. That container sits behind the "embedding" Compose profile, so add "embedding" to COMPOSE_PROFILES to start it. Set this to "disabled" to have the /v1/embeddings routes return a service disabled error instead of reaching for the container. Default value is: enabled.',
|
||||
'introduction' => '2.0.0',
|
||||
'default' => 'disabled',
|
||||
'default' => 'enabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
|
||||
@@ -463,18 +463,20 @@ Http::init()
|
||||
|
||||
// DocumentsDB runs only on MongoDB and VectorsDB only on PostgreSQL, while an
|
||||
// installation deploys just the engine backing the platform, so neither is on
|
||||
// until an operator provisions that engine and says so. Embeddings is the same:
|
||||
// its container is resource-heavy and off by default. Closed to everyone --
|
||||
// until an operator provisions that engine and says so. Closed to everyone --
|
||||
// keys and privileged roles included -- rather than answering and then failing
|
||||
// against an absent service with the reason only in the logs.
|
||||
// against an absent service with the reason only in the logs. Embeddings ran
|
||||
// on every installation before it had a switch, so it stays on unless an
|
||||
// operator turns it off; the resource-heavy container is what sits behind a
|
||||
// Compose profile.
|
||||
$products = [
|
||||
'documentsdb' => '_APP_DOCUMENTSDB',
|
||||
'vectorsdb' => '_APP_VECTORSDB',
|
||||
'embeddings' => '_APP_EMBEDDING',
|
||||
'documentsdb' => ['_APP_DOCUMENTSDB', 'disabled'],
|
||||
'vectorsdb' => ['_APP_VECTORSDB', 'disabled'],
|
||||
'embeddings' => ['_APP_EMBEDDING', 'enabled'],
|
||||
];
|
||||
if (
|
||||
isset($products[$namespace])
|
||||
&& System::getEnv($products[$namespace], 'disabled') !== 'enabled'
|
||||
&& System::getEnv(...$products[$namespace]) !== 'enabled'
|
||||
) {
|
||||
throw new Exception(Exception::GENERAL_SERVICE_DISABLED);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user