Skip to content

Commit

Permalink
fix: pipeline-server version to use Docker network for more consisten…
Browse files Browse the repository at this point in the history
…t container connnections


---------

Signed-off-by: Brian McGinn <[email protected]>
  • Loading branch information
brian-intel authored Aug 2, 2024
1 parent fa28b89 commit b0da3d3
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 69 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ build:
build-realsense:
docker build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} --target build-realsense -t dlstreamer:realsense -f src/Dockerfile src/

build-pipeline-server:
build-pipeline-server: | download-models update-submodules download-sample-videos
docker build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} -t dlstreamer:pipeline-server -f src/pipeline-server/Dockerfile.pipeline-server src/pipeline-server

run:
Expand All @@ -63,7 +63,7 @@ run-headless: | download-models update-submodules download-sample-videos
@echo Running automated self checkout pipeline
$(MAKE) run

run-pipeline-server: | download-models update-submodules download-sample-videos build-pipeline-server
run-pipeline-server: | build-pipeline-server
RETAIL_USE_CASE_ROOT=$(RETAIL_USE_CASE_ROOT) docker compose -f src/pipeline-server/docker-compose.pipeline-server.yml up -d

down-pipeline-server:
Expand Down
12 changes: 0 additions & 12 deletions helm/Dockerfile.cam-sim

This file was deleted.

10 changes: 2 additions & 8 deletions helm/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# Copyright © 2024 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

.PHONY: build build-cam-sim build-all build-minikube run-minikube-demo stop-minikube-demo helm-convert install-helm uninstall-helm
.PHONY: build build-all build-minikube run-minikube-demo stop-minikube-demo helm-convert install-helm uninstall-helm

build:
docker build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} -t dlstreamer:deploy -f Dockerfile ..

build-cam-sim:
docker build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} -t cam-sim:dev -f Dockerfile.cam-sim .

build-all : build build-cam-sim

build-minikube: build-all
build-minikube: build
minikube start
minikube image build -t dlstreamer:deploy -f helm/Dockerfile ..
minikube image build -t cam-sim:dev -f Dockerfile.cam-sim .

run-minikube-demo: build-minikube
kompose -f docker-compose.yml convert -o kubernetes/ && \
Expand Down
24 changes: 12 additions & 12 deletions helm/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ services:
ports:
- "8554:8554"
camera-simulator0:
image: cam-sim:dev
image: jrottenberg/ffmpeg:4.1-alpine
container_name: camera-simulator0
entrypoint: ffmpeg
command: "
-nostdin
-re -stream_loop -1
-i /sample-media/00-coca-cola-4465029-1920-15-bench.mp4
-c copy
-f rtsp
-rtsp_transport
tcp
rtsp://camera-simulator:8554/camera_0
"
entrypoint: ["/bin/sh","-c"]
command:
- |
if [ ! -f /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 ]; then
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
fi
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://camera-simulator:8554/camera_0
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media

dlstreamer:
image: dlstreamer:deploy
deploy:
Expand Down
2 changes: 0 additions & 2 deletions helm/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ kubelet: Running
For a multinode setup, we need to load the local docker images to all nodes.

```
minikube image load cam-sim:dev
minikube image load dlstreamer:deploy
```

Expand Down Expand Up @@ -172,7 +171,6 @@ minikube start --nodes 2 -p multinode
You can try these commands to load the images instead of the **minikube load**

```
minikube cache add cam-sim:dev
minikube cache add dlstreamer:deploy
```

Expand Down
4 changes: 2 additions & 2 deletions helm/swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document guides you to deploy a cluster using docker swarm with physical no

## Build docker images on all nodes

Ensure that **cam-sim:dev** and **dlstreamer:deploy** docker images are built on every node.
Ensure that **dlstreamer:deploy** docker images are built on every node.
You can transfer the docker images to the other nodes or you can clone and run this command on every node to ensure the images are available.

```
Expand Down Expand Up @@ -83,7 +83,7 @@ Output:
| ID | NAME | MODE | REPLICAS | IMAGE | PORTS |
|----------------|------------------------------|-------------|----------|------------------------------------|--------------------|
| sadfdsfdsfdd | checkout_camera-simulator | replicated | 1/1 | aler9/rtsp-simple-server:latest | *:8554->8554/tcp |
| sdfsdfsdfdsf | checkout_camera-simulator0 | replicated | 1/1 | cam-sim:dev | |
| sdfsdfsdfdsf | checkout_camera-simulator0 | replicated | 1/1 | jrottenberg/ffmpeg:4.1-alpine | |
| dsfewfdesfdf | checkout_dlstreamer | replicated | 1/1 | dlstreamer:deploy | |

### Scale dlstreamer container
Expand Down
8 changes: 6 additions & 2 deletions src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ services:
entrypoint: ["/bin/sh","-c"]
command:
- |
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
if [ ! -f /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 ]; then
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
fi
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/camera_0
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media

OvmsClientGst:
image: dlstreamer:dev
Expand Down
58 changes: 49 additions & 9 deletions src/pipeline-server/docker-compose.pipeline-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,43 @@

## Current Developer Toolbox doesn't support environment files, make sure to remove any files or environment variables starting with $
version: '3.7'
networks:
checkout-network:
driver: bridge
services:
camera-simulator:
container_name: camera-simulator
image: aler9/rtsp-simple-server
ports:
- "8554:8554"
environment:
- http_proxy=
- https_proxy=
- HTTP_PROXY=
- HTTPS_PROXY=
networks:
checkout-network: {}
camera-simulator0:
image: jrottenberg/ffmpeg:4.1-alpine
container_name: camera-simulator0
network_mode: "host"
entrypoint: ["/bin/sh","-c"]
command:
- |
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/camera_0
if [ ! -f /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 ]; then
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
fi
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://camera-simulator:8554/camera_0
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media
networks:
checkout-network: {}

evamclient0:
container_name: evam_0
image: intel/dlstreamer-pipeline-server:2022.2.0-ubuntu20-gpu419.40
image: dlstreamer:pipeline-server
ports:
- 8555:8554
- 8080:8080
Expand All @@ -40,15 +55,21 @@ services:
- RUN_MODE=EVA
- DETECTION_DEVICE=CPU
- CLASSIFICATION_DEVICE=CPU
- http_proxy=
- https_proxy=
- HTTP_PROXY=
- HTTPS_PROXY=
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/src/extensions:/home/pipeline-server/gvapython
- ${RETAIL_USE_CASE_ROOT:-../..}/models:/home/pipeline-server/models
- ${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/asc:/home/pipeline-server/pipelines
- "${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/config.json:/home/pipeline-server/config.json"
networks:
checkout-network: {}

evamclient1:
container_name: evam_1
image: intel/dlstreamer-pipeline-server:2022.2.0-ubuntu20-gpu419.40
image: dlstreamer:pipeline-server
ports:
- 8556:8554
- 8081:8080
Expand All @@ -60,15 +81,21 @@ services:
- RUN_MODE=EVA
- DETECTION_DEVICE=CPU
- CLASSIFICATION_DEVICE=CPU
- http_proxy=
- https_proxy=
- HTTP_PROXY=
- HTTPS_PROXY=
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/src/extensions:/home/pipeline-server/gvapython
- ${RETAIL_USE_CASE_ROOT:-../..}/models:/home/pipeline-server/models
- ${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/asc:/home/pipeline-server/pipelines
- "${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/config.json:/home/pipeline-server/config.json"
networks:
checkout-network: {}

evamclient2:
container_name: evam_2
image: intel/dlstreamer-pipeline-server:2022.2.0-ubuntu20-gpu419.40
image: dlstreamer:pipeline-server
ports:
- 8557:8554
- 8082:8080
Expand All @@ -80,19 +107,30 @@ services:
- RUN_MODE=EVA
- DETECTION_DEVICE=CPU
- CLASSIFICATION_DEVICE=CPU
- http_proxy=
- https_proxy=
- HTTP_PROXY=
- HTTPS_PROXY=
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/src/extensions:/home/pipeline-server/gvapython
- ${RETAIL_USE_CASE_ROOT:-../..}/models:/home/pipeline-server/models
- ${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/asc:/home/pipeline-server/pipelines
- "${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/config.json:/home/pipeline-server/config.json"
networks:
checkout-network: {}

pipeline-init:
image: postman/newman
command: run /postman/pipeline.json -e "/postman/env.json" --verbose
environment:
- LOCAL_IP=192.168.1.140
- http_proxy=
- https_proxy=
- HTTP_PROXY=
- HTTPS_PROXY=
volumes:
- ./postman/:/postman
networks:
checkout-network: {}

mqtt-broker:
command:
Expand All @@ -112,4 +150,6 @@ services:
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
user: 2002:2001
networks:
checkout-network: {}
6 changes: 0 additions & 6 deletions src/pipeline-server/postman/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"id": "773fe33a-1231-4703-af91-e5cb72e6fcb4",
"name": "Pipeline Environment",
"values": [
{
"key": "host",
"value": "192.168.1.140",
"type": "default",
"enabled": true
},
{
"key": "pipeline",
"value": "yolov5",
Expand Down
Loading

0 comments on commit b0da3d3

Please sign in to comment.