Skip to content

Commit 3feb555

Browse files
mo-getterkaixi-wangkevin-dimichel
authored
feat(telemetry): integrate the new telemetry sidecar (#566)
Enables the new observability features released in FiftyOne Enterprise 2.19.0, including enhanced process metrics, real-time logs, and more, viewable directly within the UI. Changes: * Helm * Adds a sidecar container to the following pods: * fiftyone-app * teams-api * plugins * do deployments * do jobs (as a native sidecar) * Adds a role and rolebinding for telemetry * Adds get pods/log permission to api role * Adds an optional redis deployment and service, with a further optional chart-managed pvc, or a further optional existing PVC by name * Compose * Drops support for `FIFTYONE_DELEGATED_OPERATOR_WORKER_REPLICAS` config option, replacing it with `COMPOSE_PROFILES="do-3"` * Adds sidecar containers to same services as Helm * Adds a tmpfs volume for the telemetry socket * Scripts: Adds support for the new telemetry-sidecar image --------- Signed-off-by: Alan Smith <209585+mo-getter@users.noreply.github.com> Signed-off-by: Kacey <kacey@voxel51.com> Co-authored-by: kacey <kacey@voxel51.com> Co-authored-by: Kevin DiMichel <56850465+kevin-dimichel@users.noreply.github.com>
1 parent 195cff9 commit 3feb555

68 files changed

Lines changed: 4224 additions & 334 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ regarding FiftyOne Enterprise.
7575
- [Advanced Configuration](#advanced-configuration)
7676
- [Backup And Recovery](#backup-and-recovery)
7777
- [Secrets And Sensitive Data](#secrets-and-sensitive-data)
78+
- [Telemetry](#telemetry)
7879
- [Snapshot Archival](#snapshot-archival)
7980
- [Static Banner Configuration](#static-banner-configuration)
8081
- [Storage Credentials and `FIFTYONE_ENCRYPTION_KEY`](#storage-credentials-and-fiftyone_encryption_key)
@@ -656,6 +657,17 @@ and
656657
[adding secrets](https://docs.voxel51.com/enterprise/secrets.html#adding-secrets)
657658
for questions regarding storage and encryption.
658659

660+
### Telemetry
661+
662+
FiftyOne Enterprise bundles a telemetry sidecar and Redis backend by
663+
default in every compose file.
664+
The Settings → Metrics page in teams-app exposes live per-service
665+
metrics (CPU, memory, FDs, thread counts) and tailed logs.
666+
667+
Please refer to the
668+
[telemetry configuration documentation](./docs/configuring-telemetry.md)
669+
for full details.
670+
659671
### Snapshot Archival
660672

661673
Since version v1.5, FiftyOne Enterprise supports

docker/common-services.yaml

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
FIFTYONE_MEDIA_CACHE_APP_IMAGES: false
1818
FIFTYONE_MEDIA_CACHE_SIZE_BYTES: -1
1919
FIFTYONE_SIGNED_URL_EXPIRATION: ${FIFTYONE_SIGNED_URL_EXPIRATION:-24}
20+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
2021
# If you are routing through a proxy server you will want to set
2122
# HTTP_PROXY_URL, HTTPS_PROXY_URL, and NO_PROXY_LIST in your .env
2223
# then add the following environment variables to your
@@ -43,6 +44,7 @@ services:
4344
FIFTYONE_ENV: ${FIFTYONE_ENV}
4445
FIFTYONE_INTERNAL_SERVICE: true
4546
FIFTYONE_LOGGING_FORMAT: ${FIFTYONE_LOGGING_FORMAT:-text}
47+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
4648
GRAPHQL_DEFAULT_LIMIT: ${GRAPHQL_DEFAULT_LIMIT}
4749
LOGGING_LEVEL: ${API_LOGGING_LEVEL:-INFO}
4850
MONGO_DEFAULT_DB: ${FIFTYONE_DATABASE_NAME}
@@ -72,6 +74,7 @@ services:
7274
FIFTYONE_SERVER_ADDRESS: ""
7375
FIFTYONE_SERVER_PATH_PREFIX: /api/proxy/fiftyone-teams
7476
FIFTYONE_TEAMS_PROXY_URL: ${FIFTYONE_TEAMS_PROXY_URL}
77+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
7578
NODE_ENV: production
7679
RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED: false
7780
FIFTYONE_APP_ANONYMOUS_ANALYTICS_ENABLED: ${FIFTYONE_APP_ANONYMOUS_ANALYTICS_ENABLED:-true}
@@ -144,6 +147,7 @@ services:
144147
FIFTYONE_MEDIA_CACHE_APP_IMAGES: false
145148
FIFTYONE_MEDIA_CACHE_SIZE_BYTES: -1
146149
FIFTYONE_PLUGINS_DIR: /opt/plugins
150+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
147151
# If you are routing through a proxy server you will want to set
148152
# HTTP_PROXY_URL, HTTPS_PROXY_URL, and NO_PROXY_LIST in your .env
149153
# then add the following environment variables to your
@@ -158,8 +162,12 @@ services:
158162

159163
teams-do-common:
160164
image: voxel51/fiftyone-teams-cv-full:v2.19.0
165+
# Telemetry default-on requires teams-do to share its PID namespace
166+
# with a single sidecar (compose's `pid: "service:<name>"` only joins
167+
# one replica). Force replicas=1 to keep the 1:1 pairing deterministic.
168+
# See docker/docs/configuring-telemetry.md for multi-worker patterns.
161169
deploy:
162-
replicas: ${FIFTYONE_DELEGATED_OPERATOR_WORKER_REPLICAS:-3}
170+
replicas: 1
163171
command: >
164172
/bin/sh -c "fiftyone delegated launch -t remote -m"
165173
environment:
@@ -171,6 +179,144 @@ services:
171179
FIFTYONE_INTERNAL_SERVICE: true
172180
FIFTYONE_MEDIA_CACHE_SIZE_BYTES: -1
173181
FIFTYONE_PLUGINS_DIR: /opt/plugins
182+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
183+
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
174184
restart: always
175185
volumes:
176186
- plugins-vol:/opt/plugins:ro
187+
- telemetry-socket:/tmp/telemetry
188+
189+
telemetry-redis-common:
190+
image: ${TELEMETRY_REDIS_IMAGE:-redis:7-alpine}
191+
command:
192+
- redis-server
193+
- --save
194+
- "60"
195+
- "1"
196+
- --dir
197+
- /data
198+
- --maxmemory
199+
- ${TELEMETRY_REDIS_MAXMEMORY:-400mb}
200+
- --maxmemory-policy
201+
- allkeys-lru
202+
restart: always
203+
deploy:
204+
resources:
205+
limits:
206+
cpus: "0.25"
207+
memory: 512M
208+
reservations:
209+
cpus: "0.10"
210+
memory: 256M
211+
volumes:
212+
- telemetry-redis-data:/data
213+
214+
# One sidecar per observed service. `pid: "service:<target>"` joins the
215+
# target's PID namespace so the sidecar can read /proc/<pid>/fd/1 and
216+
# psutil can see the target's process.
217+
fiftyone-app-telemetry-common:
218+
image: voxel51/telemetry-sidecar:v2.19.0
219+
pid: "service:fiftyone-app"
220+
# Matches the workload image's USER 1000:1000 so the kernel's
221+
# ptrace_may_access() check on /proc/<workload-pid>/fd/1 reads passes via the
222+
# same-UID fast path to allow for log tailing
223+
user: "1000:1000"
224+
cap_drop:
225+
- ALL
226+
security_opt:
227+
- no-new-privileges:true
228+
environment:
229+
POD_NAME: fiftyone-app
230+
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
231+
SERVICE_TYPE: fiftyone-app
232+
TARGET_NAME: ${FIFTYONE_APP_TARGET_NAME:-hypercorn}
233+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
234+
deploy:
235+
resources:
236+
limits:
237+
cpus: "0.10"
238+
memory: 512M
239+
reservations:
240+
cpus: "0.10"
241+
memory: 512M
242+
restart: always
243+
244+
teams-api-telemetry-common:
245+
image: voxel51/telemetry-sidecar:v2.19.0
246+
pid: "service:teams-api"
247+
user: "1000:1000"
248+
cap_drop:
249+
- ALL
250+
security_opt:
251+
- no-new-privileges:true
252+
environment:
253+
POD_NAME: teams-api
254+
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
255+
SERVICE_TYPE: teams-api
256+
TARGET_NAME: ${TEAMS_API_TARGET_NAME:-fiftyone-teams-api}
257+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
258+
deploy:
259+
resources:
260+
limits:
261+
cpus: "0.10"
262+
memory: 512M
263+
reservations:
264+
cpus: "0.10"
265+
memory: 512M
266+
restart: always
267+
268+
teams-plugins-telemetry-common:
269+
image: voxel51/telemetry-sidecar:v2.19.0
270+
pid: "service:teams-plugins"
271+
user: "1000:1000"
272+
cap_drop:
273+
- ALL
274+
security_opt:
275+
- no-new-privileges:true
276+
environment:
277+
POD_NAME: teams-plugins
278+
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
279+
SERVICE_TYPE: teams-plugins
280+
TARGET_NAME: ${TEAMS_PLUGINS_TARGET_NAME:-hypercorn}
281+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
282+
deploy:
283+
resources:
284+
limits:
285+
cpus: "0.10"
286+
memory: 512M
287+
reservations:
288+
cpus: "0.10"
289+
memory: 512M
290+
restart: always
291+
292+
teams-do-telemetry-common:
293+
image: voxel51/telemetry-sidecar:v2.19.0
294+
pid: "service:teams-do"
295+
user: "1000:1000"
296+
cap_drop:
297+
- ALL
298+
cap_add:
299+
- SYS_PTRACE # allows for additional profiling metrics (sampled stacks via py-spy)
300+
security_opt:
301+
- no-new-privileges:true
302+
environment:
303+
POD_NAME: teams-do
304+
POD_NAMESPACE: ${TELEMETRY_NAMESPACE:-docker}
305+
SERVICE_TYPE: delegated-operator
306+
TARGET_NAME: ${TEAMS_DO_TARGET_NAME:-fiftyone delegated}
307+
EXECUTOR_SIDECAR: "true"
308+
TELEMETRY_SOCKET: /tmp/telemetry/agent.sock
309+
FIFTYONE_TELEMETRY_REDIS_URL: ${FIFTYONE_TELEMETRY_REDIS_URL:-redis://telemetry-redis:6379}
310+
FIFTYONE_DATABASE_URI: ${FIFTYONE_DATABASE_URI}
311+
FIFTYONE_DATABASE_NAME: ${FIFTYONE_DATABASE_NAME}
312+
deploy:
313+
resources:
314+
limits:
315+
cpus: "0.10"
316+
memory: 512M
317+
reservations:
318+
cpus: "0.10"
319+
memory: 512M
320+
volumes:
321+
- telemetry-socket:/tmp/telemetry
322+
restart: always

docker/docs/configuring-delegated-operators.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ in conjunction with one of the three plugin configurations.
3232
up -d
3333
```
3434

35+
> [!IMPORTANT]
36+
> The `compose.delegated-operators.yaml` overlay defines three worker
37+
> slots — `teams-do`, `teams-do-2`, `teams-do-3` — each paired with a
38+
> telemetry sidecar. Slot 1 is always on (the default renders one
39+
> observed worker); slots 2 and 3 are gated behind cumulative Compose
40+
> profiles (`do-2`, `do-3`). Set `COMPOSE_PROFILES=do-N` to add slots
41+
> up to N (cap of 3). This replaces the deprecated
42+
> `FIFTYONE_DELEGATED_OPERATOR_WORKER_REPLICAS` environment variable.
43+
> If you used on the <2.19 default of 3 workers, set `COMPOSE_PROFILES=do-3`.
44+
> See
45+
> [Scaling teams-do with telemetry](./configuring-telemetry.md#scaling-teams-do-with-telemetry)
46+
> for the slot/profile reference and the rationale.
47+
3548
Optionally, delegated operation run logs may be uploaded to a
3649
network-mounted file system or cloud storage path.
3750
Logs are uploaded in the format

docker/docs/configuring-gpu-workloads.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,19 @@ We will configure the
5151
[delegated operators](./configuring-delegated-operators.md)
5252
with GPUs.
5353

54-
In your `compose.delegated-operators.yaml`, under `.services.teams-do`,
55-
add the `deploy.resource.reservation.devices` configuration.
56-
57-
The below will deploy a CPU-based delegated operator (`teams-do`) as well
58-
as a GPU-based delegated operator (`teams-do-with-gpu`):
54+
For most deployments, use the shipped GPU overlay
55+
`compose.delegated-operators.gpu.yaml`, which includes the GPU
56+
worker and its paired telemetry sidecar. Activate it alongside the CPU
57+
worker profile (e.g. `COMPOSE_PROFILES=do-1,gpu`); see
58+
[Configuring Telemetry](./configuring-telemetry.md#scaling-teams-do-with-telemetry)
59+
for the full profile reference.
60+
61+
The snippet below contains custom inline example of
62+
how to add a GPU-based delegated operator (`teams-do-with-gpu`)
63+
alongside the standard `teams-do`. Pair it with telemetry by
64+
adding a matching `teams-do-with-gpu-telemetry` sidecar. See
65+
`docker/<auth-dir>/compose.delegated-operators.gpu.yaml` for an
66+
example.
5967

6068
```yaml
6169
services:
@@ -81,7 +89,7 @@ services:
8189
volumes:
8290
- plugins-vol:/opt/plugins:ro
8391
deploy:
84-
replicas: ${FIFTYONE_DELEGATED_OPERATOR_WORKER_REPLICAS:-3}
92+
replicas: 1
8593
resources:
8694
reservations:
8795
devices:

0 commit comments

Comments
 (0)