Skip to content

Commit a1eacd8

Browse files
authored
Merge pull request #25 from insight-platform/10-11-samples-n-benchmark
Resolve #10, #11: E2E samples and benchmarks, release Dockerfile, better naming * * better naming to be better aligned with Savant repo and have Docker images configured similarly * no environment variables prefix for the same reason * fix some typos * * Dockerfile build based on uv build * different E2E samples: plain HTTP stream, SSL stream, Nginx based setup, high frame rate * benchmarks: normal frame rate and high frame rate * benchmarks metrics: Message Drops, Total Messages, Messages per Second, Total Data transferred, Data per Second, Average Message Delay, Message Delay Histogram * don't run `prometheus` and `otlp-collector` with default Dev Containers start. There is option to run it with docker compose `docker -f .devcontainer/compose.yaml -f .devcontainer/compose.services.yaml up` * use git LFS for images and video, enable it for the dev container
2 parents 9a9cea6 + 5b01684 commit a1eacd8

Some content is hidden

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

49 files changed

+1422
-398
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
prometheus:
3+
image: prom/prometheus:latest
4+
ports:
5+
- 9090:9090
6+
volumes:
7+
- ./configs/prometheus.yml:/etc/prometheus/prometheus.yml
8+
command:
9+
- --config.file=/etc/prometheus/prometheus.yml
10+
- --storage.tsdb.path=/prometheus
11+
- --web.enable-otlp-receiver
12+
networks:
13+
- dev
14+
15+
otlp-collector:
16+
image: otel/opentelemetry-collector-contrib:latest
17+
volumes:
18+
- ./configs/otlp-collector.yaml:/etc/otelcol-contrib/config.yaml
19+
networks:
20+
- dev

.devcontainer/compose.yaml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,12 @@ services:
66
REMOTE_USER: ${USER}
77
REMOTE_UID: ${REMOTE_UID:-1000}
88
REMOTE_GID: ${REMOTE_GID:-1000}
9-
command: /bin/sh -c "while sleep 1000; do :; done"
109
volumes:
1110
- ..:/workspace:cached
12-
depends_on:
13-
prometheus:
14-
condition: service_started
15-
required: false
16-
otlp-collector:
17-
condition: service_started
18-
required: false
19-
prometheus:
20-
image: prom/prometheus:latest
21-
ports:
22-
- 9090:9090
23-
volumes:
24-
- ./configs/prometheus.yml:/etc/prometheus/prometheus.yml
25-
command:
26-
- --config.file=/etc/prometheus/prometheus.yml
27-
- --storage.tsdb.path=/prometheus
28-
- --web.enable-otlp-receiver
29-
otlp-collector:
30-
image: otel/opentelemetry-collector-contrib:latest
31-
volumes:
32-
- ./configs/otlp-collector.yaml:/etc/otelcol-contrib/config.yaml
11+
networks:
12+
- dev
13+
14+
networks:
15+
dev:
16+
name: dev
17+
driver: bridge

.devcontainer/devcontainer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"dockerComposeFile": "./compose.yaml",
3-
"remoteUser": "${localEnv:REMOTE_USER}",
43
"service": "cloud-pin",
5-
"runServices": ["cloud-pin"],
4+
"shutdownAction": "stopCompose",
5+
"overrideCommand": true,
6+
"remoteUser": "${localEnv:REMOTE_USER}",
67
"workspaceFolder": "/workspace",
78
"features": {
89
"ghcr.io/devcontainers-extra/features/uv:1": {},
9-
"ghcr.io/devcontainers/features/git:1": {}
10+
"ghcr.io/devcontainers/features/git:1": {},
11+
"ghcr.io/devcontainers/features/git-lfs:1": {}
1012
},
1113
"containerEnv": {
1214
"UV_LINK_MODE": "copy"

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.psd filter=lfs diff=lfs merge=lfs -text
2+
*.jpeg filter=lfs diff=lfs merge=lfs -text
3+
*.jpg filter=lfs diff=lfs merge=lfs -text
4+
*.webp filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,8 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
210+
# Project temporary files
211+
/tmp/
212+
/samples/benchmarks/reports

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ghcr.io/insight-platform/savant-rs-py314:savant-latest AS build
2+
3+
RUN apt-get update && apt-get install -y build-essential
4+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
5+
6+
COPY . /build/
7+
WORKDIR /build/
8+
RUN uv pip install --system --requirements pyproject.toml && \
9+
uv build && \
10+
CLOUDPIN_VERSION=`uv version --short` && \
11+
uv pip install --system "savant-cloudpin @ /build/dist/savant_cloudpin-$CLOUDPIN_VERSION.tar.gz"
12+
13+
WORKDIR /
14+
RUN uv cache clean && \
15+
apt-get remove -y build-essential && \
16+
apt autoremove -y && \
17+
apt clean && \
18+
rm -rf /bin/uv /bin/uvx /build /var/lib/apt/lists/*
19+
20+
21+
FROM build AS savant-cloudpin
22+
23+
ENTRYPOINT ["python", "-m", "savant_cloudpin"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ where channels:
1717
* Pipeline sink (ZMQ Dealer) - 3
1818
* Pipeline source (ZMQ Router) - 4
1919
* Downstream bridge (WS) - 5
20+
21+
There are [samples and benchmarks](samples/README.md)

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "savant-cloudpin"
33
version = "0.1.0"
44
description = "A service to run Savant pipeline remotely (cloud) via WebSockets (WS)"
55
readme = "README.md"
6+
license-files = ["LICEN[CS]E*"]
67
requires-python = ">=3.14"
78
dependencies = [
89
"aiohttp>=3.13.2",
@@ -48,3 +49,12 @@ dev = [
4849
"pytest-xdist>=3.8.0",
4950
"ruff>=0.14.4",
5051
]
52+
53+
[tool.uv.build-backend]
54+
source-include = ["savant_cloudpin/**"]
55+
module-name = "savant_cloudpin"
56+
module-root = ""
57+
58+
[build-system]
59+
requires = ["uv_build>=0.9.8,<0.10.0"]
60+
build-backend = "uv_build"

samples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Samples and benchmarks
2+
3+
* [Plain HTTP setup](./http/README.md)
4+
* [SSL secured setup](./ssl/README.md)
5+
* [Nginx usage](./nginx/README.md)
6+
* [High frame rate demo](./no_sync/README.md)
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)