diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bae05631..a488e2bb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,13 @@ jobs: steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - name: Make dlstreamer Docker image + - name: Make Model Downloader Pipeline Docker image + run: | + make build-download-models + env: + REGISTRY: "false" + - name: Make ASC Pipeline Docker image run: | make build + env: + REGISTRY: "false" diff --git a/.github/workflows/trivyimagescan.yaml b/.github/workflows/trivyimagescan.yaml index 0c99653f..b7a2adac 100644 --- a/.github/workflows/trivyimagescan.yaml +++ b/.github/workflows/trivyimagescan.yaml @@ -29,7 +29,8 @@ jobs: if: github.event_name == 'pull_request' uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 with: - ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} - name: Checkout code for Push Request if: github.event_name == 'push' uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 @@ -40,11 +41,20 @@ jobs: echo "running make build benchmark" make build env: - REGISTRY: "false" + REGISTRY: "false" + + - name: Extract ASC value from VERSION file + id: extract_asc + run: | + pwd + ls -ltra + ASC_TAG=$(grep '^ASC=' VERSION | cut -d= -f2) + echo "ASC_TAG=$ASC_TAG" >> $GITHUB_OUTPUT + - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 with: - image-ref: 'pipeline-runner-asc:3.6.2' + image-ref: 'pipeline-runner-asc:${{ steps.extract_asc.outputs.ASC_TAG}}' format: 'table' severity: 'CRITICAL,HIGH' output: 'trivy-asc-results.txt' diff --git a/Makefile b/Makefile index 18bde03b..028192d5 100644 --- a/Makefile +++ b/Makefile @@ -24,18 +24,19 @@ RESULTS_DIR ?= $(PWD)/benchmark -TAG ?= rc2 +ASC_TAG := $(shell cat VERSION) +PT_TAG := $(shell cat performance-tools/VERSION) #local image references -MODELDOWNLOADER_IMAGE ?= model-downloader-asc:3.6.2 -PIPELINE_RUNNER_IMAGE ?= pipeline-runner-asc:3.6.2 -BENCHMARK_IMAGE ?= benchmark:latest +MODELDOWNLOADER_IMAGE ?= model-downloader-asc:$(ASC_TAG) +PIPELINE_RUNNER_IMAGE ?= pipeline-runner-asc:$(ASC_TAG) +BENCHMARK_IMAGE ?= benchmark:$(PT_TAG) REGISTRY ?= true # Registry image references -REGISTRY_MODEL_DOWNLOADER ?= intel/model-downloader-asc:3.6.2 -REGISTRY_PIPELINE_RUNNER ?= intel/pipeline-runner-asc:3.6.2 -REGISTRY_BENCHMARK ?= intel/retail-benchmark:3.3.1 +REGISTRY_MODEL_DOWNLOADER ?= intel/model-downloader-asc:$(ASC_TAG) +REGISTRY_PIPELINE_RUNNER ?= intel/pipeline-runner-asc:$(ASC_TAG) +REGISTRY_BENCHMARK ?= intel/retail-benchmark:$(PT_TAG) download-models: check-models-needed @@ -103,21 +104,21 @@ build-pipeline-server: | download-models update-submodules download-sample-video 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 build-sensors: - docker compose -f src/${DOCKER_COMPOSE_SENSORS} build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} + ASC_TAG=$(ASC_TAG) docker compose -f src/${DOCKER_COMPOSE_SENSORS} build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} run: @if [ "$(REGISTRY)" = "true" ]; then \ echo "Running registry version..."; \ echo "############### Running registry mode ###############################"; \ - docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) up -d; \ + ASC_TAG=$(ASC_TAG) docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) up -d; \ else \ echo "Running standard version..."; \ echo "############### Running STANDARD mode ###############################"; \ - docker compose -f src/$(DOCKER_COMPOSE) up -d; \ + ASC_TAG=$(ASC_TAG) docker compose -f src/$(DOCKER_COMPOSE) up -d; \ fi run-sensors: - docker compose -f src/${DOCKER_COMPOSE_SENSORS} up -d + ASC_TAG=$(ASC_TAG) docker compose -f src/${DOCKER_COMPOSE_SENSORS} up -d run-render-mode: @@ -132,23 +133,23 @@ run-render-mode: @xhost +local:docker @if [ "$(REGISTRY)" = "true" ]; then \ echo "Running registry version with render mode..."; \ - RENDER_MODE=1 docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) up -d; \ + ASC_TAG=$(ASC_TAG) RENDER_MODE=1 docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) up -d; \ else \ echo "Running standard version with render mode..."; \ - RENDER_MODE=1 docker compose -f src/$(DOCKER_COMPOSE) up -d; \ + ASC_TAG=$(ASC_TAG) RENDER_MODE=1 docker compose -f src/$(DOCKER_COMPOSE) up -d; \ fi down: @if [ "$(REGISTRY)" = "true" ]; then \ echo "Stopping registry demo containers..."; \ - docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) down; \ + ASC_TAG=$(ASC_TAG) docker compose -f src/$(DOCKER_COMPOSE_REGISTRY) down; \ echo "Registry demo containers stopped and removed."; \ else \ - docker compose -f src/$(DOCKER_COMPOSE) down; \ + ASC_TAG=$(ASC_TAG) docker compose -f src/$(DOCKER_COMPOSE) down; \ fi down-sensors: - docker compose -f src/${DOCKER_COMPOSE_SENSORS} down + ASC_TAG=$(ASC_TAG) docker compose -f src/${DOCKER_COMPOSE_SENSORS} down run-demo: | download-models update-submodules download-sample-videos @echo "Building automated self checkout app" @@ -167,10 +168,10 @@ run-headless: | download-models update-submodules download-sample-videos $(MAKE) run run-pipeline-server: | download-models update-submodules download-sample-videos - RETAIL_USE_CASE_ROOT=$(RETAIL_USE_CASE_ROOT) docker compose -f src/pipeline-server/docker-compose.pipeline-server.yml up -d + ASC_TAG=$(ASC_TAG) RETAIL_USE_CASE_ROOT=$(RETAIL_USE_CASE_ROOT) docker compose -f src/pipeline-server/docker-compose.pipeline-server.yml up -d down-pipeline-server: - docker compose -f src/pipeline-server/docker-compose.pipeline-server.yml down + ASC_TAG=$(ASC_TAG) docker compose -f src/pipeline-server/docker-compose.pipeline-server.yml down fetch-benchmark: @echo "Fetching benchmark image from registry..." @@ -185,7 +186,7 @@ build-benchmark: else \ echo "Building pipeline-runner-asc img locally..."; \ docker build --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} --target build-default -t $(PIPELINE_RUNNER_IMAGE) -f src/Dockerfile src/; \ - cd performance-tools && $(MAKE) build-benchmark-docker; \ + cd performance-tools && PT_TAG=$(PT_TAG) $(MAKE) build-benchmark-docker; \ fi benchmark: build-benchmark download-models download-sample-videos @@ -194,9 +195,9 @@ benchmark: build-benchmark download-models download-sample-videos . venv/bin/activate && \ pip install -r requirements.txt && \ if [ "$(REGISTRY)" = "true" ]; then \ - python benchmark.py --compose_file ../../src/$(DOCKER_COMPOSE_REGISTRY) --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR) --benchmark_type reg; \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python benchmark.py --compose_file ../../src/$(DOCKER_COMPOSE_REGISTRY) --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR) --benchmark_type reg; \ else \ - python benchmark.py --compose_file ../../src/$(DOCKER_COMPOSE) --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR); \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python benchmark.py --compose_file ../../src/$(DOCKER_COMPOSE) --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR); \ fi && \ deactivate @@ -226,7 +227,7 @@ benchmark-stream-density: build-benchmark download-models . venv/bin/activate && \ pip install -r requirements.txt && \ if [ "$(REGISTRY)" = "true" ]; then \ - python3 benchmark.py \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python3 benchmark.py \ --compose_file ../../src/$(DOCKER_COMPOSE_REGISTRY) \ --init_duration $(INIT_DURATION) \ --target_fps $(TARGET_FPS) \ @@ -235,7 +236,7 @@ benchmark-stream-density: build-benchmark download-models --benchmark_type reg \ --results_dir $(RESULTS_DIR); \ else \ - python3 benchmark.py \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python3 benchmark.py \ --compose_file ../../src/$(DOCKER_COMPOSE) \ --init_duration $(INIT_DURATION) \ --target_fps $(TARGET_FPS) \ @@ -252,10 +253,10 @@ benchmark-quickstart: build-benchmark download-models download-sample-videos pip install -r requirements.txt && \ if [ "$(REGISTRY)" = "true" ]; then \ DEVICE_ENV=res/all-gpu.env RENDER_MODE=0 PIPELINE_SCRIPT=obj_detection_age_prediction.sh \ - python benchmark.py --compose_file ../../src/docker-compose.yml --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR) --benchmark_type reg; \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python benchmark.py --compose_file ../../src/docker-compose.yml --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR) --benchmark_type reg; \ else \ DEVICE_ENV=res/all-gpu.env RENDER_MODE=0 PIPELINE_SCRIPT=obj_detection_age_prediction.sh \ - python benchmark.py --compose_file ../../src/docker-compose.yml --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR); \ + ASC_TAG=$(ASC_TAG) PT_TAG=$(PT_TAG) python benchmark.py --compose_file ../../src/docker-compose.yml --pipeline $(PIPELINE_COUNT) --results_dir $(RESULTS_DIR); \ fi && \ deactivate $(MAKE) consolidate-metrics diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..0b2eb36f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.7.2 diff --git a/check_models.sh b/check_models.sh index 87e5aa66..03175e33 100755 --- a/check_models.sh +++ b/check_models.sh @@ -1,7 +1,7 @@ #!/bin/bash # filepath: /home/intel/suryam/ASC/suryam789/automated-self-checkout/check_models.sh -set -eo pipefail +set -o pipefail echo "Checking for models required by pipeline script..." @@ -172,4 +172,4 @@ fi # else # echo "Insufficient models ($XML_COUNT < 12). Need to download." # exit 0 # Need to download -# fi \ No newline at end of file +# fi diff --git a/src/docker-compose-reg.yml b/src/docker-compose-reg.yml index 115b85fc..63f2b8bb 100644 --- a/src/docker-compose-reg.yml +++ b/src/docker-compose-reg.yml @@ -26,7 +26,7 @@ services: - ./start_stream.sh:/home/pipeline-server/src/start_stream.sh ClientGst: - image: intel/pipeline-runner-asc:3.6.2 + image: intel/pipeline-runner-asc:${ASC_TAG} deploy: mode: replicated replicas: ${PIPELINE_COUNT:-1} diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 1040fdb1..febfaa5a 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -26,7 +26,7 @@ services: - ./start_stream.sh:/home/pipeline-server/src/start_stream.sh ClientGst: - image: pipeline-runner-asc:3.6.2 + image: pipeline-runner-asc:${ASC_TAG} deploy: mode: replicated replicas: ${PIPELINE_COUNT:-1} @@ -56,4 +56,4 @@ services: - ./pipelines:/home/pipeline-server/pipelines - ./extensions:/home/pipeline-server/extensions - ${RETAIL_USE_CASE_ROOT:-}/models:/home/pipeline-server/models - restart: on-failure \ No newline at end of file + restart: on-failure