-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.delegated-operators.yaml
More file actions
169 lines (163 loc) · 5.65 KB
/
Copy pathcompose.delegated-operators.yaml
File metadata and controls
169 lines (163 loc) · 5.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---
# See docker/docs/configuring-telemetry.md for details on telemetry settings.
#
# For Proxy Server instructions please see
# https://github.com/voxel51/fiftyone-teams-app-deploy/tree/main/docker#environment-proxies
services:
teams-do:
extends:
file: ../common-services.yaml
service: teams-do-common
teams-do-telemetry:
extends:
file: ../common-services.yaml
service: teams-do-telemetry-common
depends_on:
teams-do:
condition: service_started
restart: true
telemetry-redis:
condition: service_started
# Slot 2 — included by the `do-2` and `do-3` profiles. Defined inline
# (rather than extending teams-do-common) so it can own its own
# executor-socket named volume; named volumes are shared by their
# volume name, so reusing `telemetry-socket` across slots would
# clobber the socket. `-n teams-do-2` registers this worker as a
# distinct orchestrator name so it surfaces separately in the
# Settings → Metrics UI.
teams-do-2:
image: voxel51/fiftyone-teams-cv-full:v2.22.0
profiles: ["do-2", "do-3"]
deploy:
replicas: 1
command: >
/bin/sh -c "fiftyone delegated launch -t remote -m -n teams-do-2"
environment:
API_URL: ${API_URL}
FIFTYONE_DATABASE_ADMIN: false
FIFTYONE_DATABASE_NAME: ${FIFTYONE_DATABASE_NAME}
FIFTYONE_DATABASE_URI: ${FIFTYONE_DATABASE_URI}
FIFTYONE_ENCRYPTION_KEY: ${FIFTYONE_ENCRYPTION_KEY}
FIFTYONE_INTERNAL_SERVICE: true
FIFTYONE_MEDIA_CACHE_SIZE_BYTES: -1
FIFTYONE_PLUGINS_DIR: /opt/plugins
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
restart: always
volumes:
- plugins-vol:/opt/plugins:ro
- telemetry-socket-2:/tmp/telemetry
teams-do-2-telemetry:
image: voxel51/telemetry-sidecar:v2.22.0
profiles: ["do-2", "do-3"]
pid: "service:teams-do-2"
user: "1000:1000"
cap_drop:
- ALL
cap_add:
- SYS_PTRACE # allows for additional profiling metrics (sampled stacks via py-spy)
security_opt:
- no-new-privileges:true
environment:
POD_NAME: teams-do-2
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
SERVICE_TYPE: delegated-operator
TARGET_NAME: ${TEAMS_DO_TARGET_NAME:-fiftyone delegated}
EXECUTOR_SIDECAR: "true"
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
FIFTYONE_DATABASE_URI: ${FIFTYONE_DATABASE_URI}
FIFTYONE_DATABASE_NAME: ${FIFTYONE_DATABASE_NAME}
deploy:
resources:
limits:
cpus: "0.10"
memory: 512M
reservations:
cpus: "0.10"
memory: 512M
volumes:
- telemetry-socket-2:/tmp/telemetry
depends_on:
teams-do-2:
condition: service_started
restart: true
telemetry-redis:
condition: service_started
restart: always
# Slot 3 — included by the `do-3` profile. Mirror of slot 2 with its
# own socket volume and orchestrator name. The cap is 3 by design;
# for higher worker counts use the helm chart, which adds a sidecar
# to every pod automatically.
teams-do-3:
image: voxel51/fiftyone-teams-cv-full:v2.22.0
profiles: ["do-3"]
deploy:
replicas: 1
command: >
/bin/sh -c "fiftyone delegated launch -t remote -m -n teams-do-3"
environment:
API_URL: ${API_URL}
FIFTYONE_DATABASE_ADMIN: false
FIFTYONE_DATABASE_NAME: ${FIFTYONE_DATABASE_NAME}
FIFTYONE_DATABASE_URI: ${FIFTYONE_DATABASE_URI}
FIFTYONE_ENCRYPTION_KEY: ${FIFTYONE_ENCRYPTION_KEY}
FIFTYONE_INTERNAL_SERVICE: true
FIFTYONE_MEDIA_CACHE_SIZE_BYTES: -1
FIFTYONE_PLUGINS_DIR: /opt/plugins
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
restart: always
volumes:
- plugins-vol:/opt/plugins:ro
- telemetry-socket-3:/tmp/telemetry
teams-do-3-telemetry:
image: voxel51/telemetry-sidecar:v2.22.0
profiles: ["do-3"]
pid: "service:teams-do-3"
user: "1000:1000"
cap_drop:
- ALL
cap_add:
- SYS_PTRACE # allows for additional profiling metrics (sampled stacks via py-spy)
security_opt:
- no-new-privileges:true
environment:
POD_NAME: teams-do-3
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
SERVICE_TYPE: delegated-operator
TARGET_NAME: ${TEAMS_DO_TARGET_NAME:-fiftyone delegated}
EXECUTOR_SIDECAR: "true"
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
FIFTYONE_DATABASE_URI: ${FIFTYONE_DATABASE_URI}
FIFTYONE_DATABASE_NAME: ${FIFTYONE_DATABASE_NAME}
deploy:
resources:
limits:
cpus: "0.10"
memory: 512M
reservations:
cpus: "0.10"
memory: 512M
volumes:
- telemetry-socket-3:/tmp/telemetry
depends_on:
teams-do-3:
condition: service_started
restart: true
telemetry-redis:
condition: service_started
restart: always
# tmpfs-backed named volumes with uid/gid set at mount time so the
# non-root sidecar can bind agent.sock without any init container.
# Add new slots with `telemetry-socket-N: *telemetry-socket-spec`.
volumes:
plugins-vol:
telemetry-socket: &telemetry-socket-spec
driver_opts:
type: tmpfs
device: tmpfs
o: "uid=1000,gid=1000,mode=0755"
telemetry-socket-2: *telemetry-socket-spec
telemetry-socket-3: *telemetry-socket-spec