Skip to content

Commit 7e32a37

Browse files
committed
fix: new services
1 parent 1c10a43 commit 7e32a37

File tree

6 files changed

+57
-39
lines changed

6 files changed

+57
-39
lines changed

app/Models/Service.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,31 @@ public function extraFields()
288288
continue;
289289
}
290290
switch ($image) {
291+
case $image->contains('label-studio'):
292+
$data = collect([]);
293+
$username = $this->environment_variables()->where('key', 'LABEL_STUDIO_USERNAME')->first();
294+
$password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_LABELSTUDIO')->first();
295+
if ($username) {
296+
$data = $data->merge([
297+
'Username' => [
298+
'key' => 'LABEL_STUDIO_USERNAME',
299+
'value' => data_get($username, 'value'),
300+
'rules' => 'required',
301+
],
302+
]);
303+
}
304+
if ($password) {
305+
$data = $data->merge([
306+
'Password' => [
307+
'key' => 'LABEL_STUDIO_PASSWORD',
308+
'value' => data_get($password, 'value'),
309+
'rules' => 'required',
310+
'isPassword' => true,
311+
],
312+
]);
313+
}
314+
$fields->put('Label Studio', $data->toArray());
315+
break;
291316
case $image->contains('litellm'):
292317
$data = collect([]);
293318
$username = $this->environment_variables()->where('key', 'SERVICE_USER_UI')->first();

templates/compose/labelstudio.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,41 @@
77
services:
88
labelstudio:
99
image: heartexlabs/label-studio:latest
10-
restart: always
1110
depends_on:
1211
postgres:
1312
condition: service_healthy
1413
environment:
1514
- SERVICE_FQDN_LABELSTUDIO_8080
16-
- DJANGO_DB=default
15+
- DJANGO_DB=${DJANGO_DB:-default}
1716
- POSTGRE_NAME=${POSTGRES_DB:-labelstudio}
1817
- POSTGRE_USER=${SERVICE_USER_POSTGRES}
1918
- POSTGRE_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
2019
- POSTGRE_PORT=5432
2120
- POSTGRE_HOST=postgres
22-
- LABEL_STUDIO_HOST=${LABEL_STUDIO_HOST:-0.0.0.0}
23-
- SSRF_PROTECTION_ENABLED=true
21+
- LABEL_STUDIO_HOST=${SERVICE_FQDN_LABELSTUDIO}
22+
- SSRF_PROTECTION_ENABLED=${SSRF_PROTECTION_ENABLED:-true}
2423
- LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK=${LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK:-true}
2524
- DATA_UPLOAD_MAX_NUMBER_FILES=${DATA_UPLOAD_MAX_NUMBER_FILES:-10000}
25+
- LABEL_STUDIO_USERNAME=${LABEL_STUDIO_USERNAME:[email protected]}
26+
- LABEL_STUDIO_PASSWORD=${SERVICE_PASSWORD_LABELSTUDIO}
27+
- LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK=${LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK:-true}
2628
volumes:
27-
- labelstudio_data:/label-studio/data:rw
28-
29+
- labelstudio-data:/label-studio/data
30+
healthcheck:
31+
test: ["CMD-SHELL", "curl -f http://localhost:8080/health || exit 1"]
32+
interval: 5s
33+
timeout: 20s
34+
retries: 3
2935
postgres:
3036
image: postgres:16-alpine
31-
restart: always
3237
environment:
3338
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
3439
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
3540
- POSTGRES_DB=${POSTGRES_DB:-labelstudio}
3641
volumes:
37-
- pg_data:/var/lib/postgresql/data
42+
- pg-data:/var/lib/postgresql/data
3843
healthcheck:
39-
test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
44+
test: ["CMD-SHELL", "pg_isready -h localhost -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
4045
interval: 5s
41-
timeout: 5s
46+
timeout: 20s
4247
retries: 3
43-
44-
volumes:
45-
pg_data:
46-
labelstudio_data:

templates/compose/rabbitmq.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ services:
1616
- ${PORT}:5672
1717
healthcheck:
1818
test: rabbitmq-diagnostics -q ping
19-
interval: 30s
19+
interval: 5s
2020
timeout: 30s
21-
retries: 3
21+
retries: 10

templates/compose/unstructured.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# logo: svgs/unstructured.png
55
# port: 8000
66

7-
version: "3"
8-
97
services:
108
unstructured:
119
image: "downloads.unstructured.io/unstructured-io/unstructured-api:latest"
@@ -17,8 +15,7 @@ services:
1715
- CMD
1816
- wget
1917
- "-qO-"
20-
- "--spider"
2118
- "http://0.0.0.0:8000/healthcheck"
22-
interval: 15s
23-
timeout: 15s
24-
retries: 3
19+
interval: 5s
20+
timeout: 30s
21+
retries: 10

templates/compose/weaviate.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
# logo: svgs/weaviate.png
55
# port: 8080
66

7-
version: "3"
87

98
services:
109
weaviate:
1110
image: "cr.weaviate.io/semitechnologies/weaviate:1.26.4"
12-
restart: always
1311
volumes:
14-
- "weaviate_data:/var/lib/weaviate"
12+
- "weaviate-data:/var/lib/weaviate"
1513
command:
1614
- "--host"
1715
- 0.0.0.0
@@ -21,20 +19,20 @@ services:
2119
- http
2220
environment:
2321
- SERVICE_FQDN_WEAVIATE_8080
24-
- DISABLE_TELEMETRY=true
25-
- QUERY_DEFAULTS_LIMIT=1000
26-
- LOG_LEVEL=info
22+
- DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-true}
23+
- QUERY_DEFAULTS_LIMIT=${QUERY_DEFAULTS_LIMIT:-1000}
24+
- LOG_LEVEL=${LOG_LEVEL:-info}
2725
- GOMEMLIMIT=${GOMEMLIMIT:-1024MiB}
2826
- GOMAXPROCS=${GOMAXPROCS:-2}
29-
- AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=false
27+
- AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=${AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED:-false}
3028
- AUTHORIZATION_ADMINLIST_USERS=${AUTHORIZATION_ADMINLIST_USERS:[email protected]}
3129
- AUTHENTICATION_APIKEY_USERS=${AUTHENTICATION_APIKEY_USERS:[email protected]}
32-
- AUTHENTICATION_APIKEY_ENABLED=true
33-
- "AUTHENTICATION_APIKEY_ALLOWED_KEYS=${SERVICE_PASSWORD_APIKEYS}"
30+
- AUTHENTICATION_APIKEY_ENABLED=${AUTHENTICATION_APIKEY_ENABLED:-true}
31+
- AUTHENTICATION_APIKEY_ALLOWED_KEYS=${SERVICE_PASSWORD_APIKEYS}
3432
- PERSISTENCE_DATA_PATH=/var/lib/weaviate
35-
- DEFAULT_VECTORIZER_MODULE=none
33+
- DEFAULT_VECTORIZER_MODULE=${DEFAULT_VECTORIZER_MODULE:-none}
3634
- ENABLE_MODULES=${ENABLE_MODULES:-text2vec-openai,generative-openai,qna-openai}
37-
- CLUSTER_HOSTNAME=node1
35+
- CLUSTER_HOSTNAME=${CLUSTER_HOSTNAME:-node1}
3836
healthcheck:
3937
test:
4038
- CMD
@@ -43,8 +41,5 @@ services:
4341
- "--spider"
4442
- "http://localhost:8080/v1/.well-known/ready"
4543
interval: 5s
46-
timeout: 5s
47-
retries: 3
48-
49-
volumes:
50-
weaviate_data: null
44+
timeout: 30s
45+
retries: 10

templates/service-templates.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)