From e1e1cf02eb8301ef6297a8fe624b269a8538704e Mon Sep 17 00:00:00 2001 From: Roman Meshko Date: Sun, 7 Jun 2026 11:22:53 +0300 Subject: [PATCH] Changed to have an attempt of build TRT10.3 --- .dockerignore | 4 ++- .woodpecker/build-push-jetson-trt104.yml | 31 ++++++++++++++++++++++++ Dockerfile.jetson.trt104 | 21 ++++++++++++++++ _docs/04_deploy/containerization.md | 15 ++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .woodpecker/build-push-jetson-trt104.yml create mode 100644 Dockerfile.jetson.trt104 diff --git a/.dockerignore b/.dockerignore index dcaa74e..c90f746 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,4 +15,6 @@ __pycache__ .pytest_cache .git *.md -scripts +scripts/* +!scripts/jetson/ +!scripts/jetson/generate_int8_cache.py diff --git a/.woodpecker/build-push-jetson-trt104.yml b/.woodpecker/build-push-jetson-trt104.yml new file mode 100644 index 0000000..50f77f5 --- /dev/null +++ b/.woodpecker/build-push-jetson-trt104.yml @@ -0,0 +1,31 @@ +when: + - event: [manual] + evaluate: 'BUILD_JETSON_TRT104 == "1"' + +labels: + platform: arm64 + +steps: + - name: build-push-jetson-trt104 + image: docker + environment: + REGISTRY_HOST: + from_secret: registry_host + REGISTRY_USER: + from_secret: registry_user + REGISTRY_TOKEN: + from_secret: registry_token + commands: + - echo "$REGISTRY_TOKEN" | docker login "$REGISTRY_HOST" -u "$REGISTRY_USER" --password-stdin + - export TAG=${CI_COMMIT_BRANCH}-arm-trt104 + - export BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) + - | + docker build -f Dockerfile.jetson.trt104 \ + --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA \ + --label org.opencontainers.image.revision=$CI_COMMIT_SHA \ + --label org.opencontainers.image.created=$BUILD_DATE \ + --label org.opencontainers.image.source=$CI_REPO_URL \ + -t $REGISTRY_HOST/azaion/detections:$TAG . + - docker push $REGISTRY_HOST/azaion/detections:$TAG + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/Dockerfile.jetson.trt104 b/Dockerfile.jetson.trt104 new file mode 100644 index 0000000..1b064e0 --- /dev/null +++ b/Dockerfile.jetson.trt104 @@ -0,0 +1,21 @@ +FROM nvcr.io/nvidia/tensorrt:24.09-py3-igpu +ARG CI_COMMIT_SHA=unknown +ENV AZAION_REVISION=$CI_COMMIT_SHA + +RUN apt-get update && apt-get install -y \ + python3 python3-pip python3-dev gcc \ + libgl1 libglib2.0-0 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app +COPY requirements.txt requirements-jetson.txt ./ +RUN pip3 install --no-cache-dir -r requirements-jetson.txt +COPY . . +RUN BUILD_TENSORRT_EXTENSIONS=1 python3 setup.py build_ext --inplace +ENV PYTHONPATH=/app/src +RUN adduser --disabled-password --no-create-home --gecos "" appuser \ + && mkdir -p /app/Logs \ + && chown -R appuser /app +USER appuser +EXPOSE 8080 +CMD ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"] diff --git a/_docs/04_deploy/containerization.md b/_docs/04_deploy/containerization.md index 5bc592b..81c799b 100644 --- a/_docs/04_deploy/containerization.md +++ b/_docs/04_deploy/containerization.md @@ -139,6 +139,21 @@ Already exists: `e2e/docker-compose.test.yml`. No changes needed — supports bo docker compose -f docker-compose.jetson.yml up ``` +### detections-jetson-trt104 (Dockerfile.jetson.trt104) + +Experimental INT8 calibration image for Jetson Orin devices. It uses NVIDIA's TensorRT iGPU container: + +| Aspect | Specification | +|--------|--------------| +| Base image | `nvcr.io/nvidia/tensorrt:24.09-py3-igpu` | +| TensorRT | TensorRT 10.4.0.26 | +| Purpose | Work around TensorRT 10.3 INT8 calibration failures such as `checkSanity.cpp::checkLinks` / `Graph::regions` internal errors | + +Build/tag example: +```bash +docker build -f Dockerfile.jetson.trt104 -t /azaion/detections:dev-arm-trt104 . +``` + ## Image Tagging Strategy | Context | Tag Format | Example |