Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build-publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: '2.2.1'
plugins: poetry-plugin-export

- name: Export requirements
run: |
poetry export -o requirements.txt --without-hashes

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: '2.2.1'
plugins: poetry-plugin-export

- name: Export requirements
run: |
poetry export -o requirements.txt --without-hashes

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: PR Build with Poetry
runs-on: [self-hosted, linux, X64]
container:
image: starwitorg/base-python-image:0.0.15
image: starwitorg/base-python-image:3.13.0
volumes:
- /home/githubrunner/.cache/pypoetry:/root/.cache/pypoetry
steps:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ cache
!.github/workflows/*.yaml
!settings.template.yaml
target
dist
dist
requirements.txt
41 changes: 21 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
FROM starwitorg/base-python-image:0.0.15 AS build
# You must run `poetry export` before building this
FROM python:3.13-slim AS build

ADD "https://drive.google.com/uc?id=1Kkx2zW89jq_NETu4u42CFZTMVD5Hwm6e" /code/osnet_x0_25_msmt17.pt


# Copy only files that are necessary to install dependencies
COPY poetry.lock poetry.toml pyproject.toml /code/
RUN apt update && apt install --no-install-recommends -y \
build-essential \
git

WORKDIR /code
RUN poetry install

# Copy the rest of the project
COPY . /code/
# This needs to be generated with poetry export
COPY requirements.txt ./
Comment thread
flonix8 marked this conversation as resolved.

RUN pip wheel --no-cache-dir --no-deps -r requirements.txt -w /wheels

### Main artifact / deliverable image
FROM python:3.13-slim

FROM python:3.12-slim
RUN apt update && apt install --no-install-recommends -y \
libglib2.0-0 \
libgl1 \
libturbojpeg0
libturbojpeg0 \
git

# Create a non-root user and group
Comment thread
flonix8 marked this conversation as resolved.
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser

COPY --from=build --chown=appuser:appgroup /code /code

WORKDIR /code

# Switch to non-root user
USER appuser
# This needs to be generated with poetry export (same file as above)
COPY requirements.txt ./

# This should be fine if and only if the wheels are generated based on the poetry exported requirements.txt (see above)
RUN --mount=type=bind,from=build,source=/wheels,target=/wheels \
pip install /wheels/*

ENV PATH="/code/.venv/bin:$PATH"
COPY --chown=appuser:appgroup main.py ./
COPY --chown=appuser:appgroup ./objecttracker ./objecttracker

USER appuser
CMD [ "python", "main.py" ]
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This component hooks into SAE's streams of frames annotated with detected object

## How to set up
- Make sure you have Poetry installed (otherwise see here: https://python-poetry.org/docs/#installing-with-the-official-installer)
- Set environment variable `NVIDIA_TENSORRT_DISABLE_INTERNAL_PIP=True` (otherwise `tensorrt-*` installation will fail)
- Run `poetry install`

## How to Build
Expand All @@ -25,4 +24,10 @@ The following Github Actions are available:

## Dependabot Version Update

With [dependabot.yml](.github/dependabot.yml) a scheduled version update via Dependabot is configured. Dependabot creates a pull request if newer versions are available and the compilation is checked via PR build.
With [dependabot.yml](.github/dependabot.yml) a scheduled version update via Dependabot is configured. Dependabot creates a pull request if newer versions are available and the compilation is checked via PR build.

## Changelog

### 3.4.0
- Remove all support for DeepOCSort (which has not been accessible through config before, so no config changes needed)
- Reduce Docker image size by 90%
7 changes: 6 additions & 1 deletion docker_build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash

docker build -t starwitorg/sae-object-tracker:local .
poetry export -o requirements.txt --without-hashes

docker build -t starwitorg/sae-object-tracker:local .

# Run with other components from the SAE compose project (set redis host to `redis`):
# `docker run -it --rm --network sae -v $(pwd)/settings.yaml:/code/settings.yaml starwitorg/sae-object-tracker:local`
5 changes: 5 additions & 0 deletions objecttracker/boxmot_ocsort/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This package consists of the entire OCSort implementation from "boxmot==13.0.8" by Mikel Brostrom
# in an effort to reduce dependencies. All code that is not needed has been removed. Original file names have been preserved.
# The original boxmot project can be found here: https://github.com/mikel-brostrom/boxmot

from .ocsort import OcSort
Loading
Loading