diff --git a/.github/workflows/docker.jetson.6.2.0.yml b/.github/workflows/docker.jetson.6.2.0.yml index 31ae25ae8b..031ca391ea 100644 --- a/.github/workflows/docker.jetson.6.2.0.yml +++ b/.github/workflows/docker.jetson.6.2.0.yml @@ -14,6 +14,7 @@ on: default: false env: + TARGET_IMAGE: "roboflow/roboflow-inference-server-jetson-6.2.0" VERSION: "0.0.0" # Default version, will be overwritten jobs: @@ -30,17 +31,21 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: 🛎️ Checkout uses: actions/checkout@v4 + - name: Read version from file run: echo "VERSION=$(DISABLE_VERSION_CHECK=true python ./inference/core/version.py)" >> $GITHUB_ENV + - name: Set up Depot CLI uses: depot/setup-action@v1 + - name: Build and Push uses: depot/build-push-action@v1 with: - push: ${{ github.event_name == 'release' || (github.event.inputs.force_push == 'true')}} + push: ${{ github.event_name == 'release' || (github.event.inputs.force_push == 'true') }} project: grl7ffzxd7 - tags: roboflow/roboflow-inference-server-jetson-6.2.0:latest,roboflow/roboflow-inference-server-jetson-6.2.0:${{ env.VERSION}} + tags: ${{ env.TARGET_IMAGE }}:latest,${{ env.TARGET_IMAGE }}:${{ env.VERSION }} platforms: linux/arm64 file: ./docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0 diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0 b/docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0 index 9410a084d4..1913366881 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0 @@ -1,176 +1,24 @@ -FROM nvcr.io/nvidia/l4t-jetpack:r36.4.0 AS builder - -ARG DEBIAN_FRONTEND=noninteractive -ENV LANG=en_US.UTF-8 - -WORKDIR /app - -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends \ - libxext6 \ - libopencv-dev \ - uvicorn \ - python3-pip \ - git \ - libgdal-dev \ - libvips-dev \ - wget \ - rustc \ - cargo \ - curl \ - cmake \ - ninja-build \ - && rm -rf /var/lib/apt/lists/* - -RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.30.5/cmake-3.30.5-linux-aarch64.sh && \ - chmod +x cmake-3.30.5-linux-aarch64.sh && \ - ./cmake-3.30.5-linux-aarch64.sh --prefix=/usr/local --skip-license && \ - rm cmake-3.30.5-linux-aarch64.sh - -RUN curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh && \ - ln -s /root/.local/bin/uv /usr/local/bin/uv - -COPY requirements/requirements.sam.txt \ - requirements/requirements.clip.txt \ - requirements/requirements.http.txt \ - requirements/requirements.gpu.txt \ - requirements/requirements.gaze.txt \ - requirements/requirements.doctr.txt \ - requirements/requirements.groundingdino.txt \ - requirements/requirements.yolo_world.txt \ - requirements/_requirements.txt \ - requirements/requirements.transformers.txt \ - requirements/requirements.jetson.txt \ - requirements/requirements.sdk.http.txt \ - requirements/requirements.easyocr.txt \ - ./ - -RUN python3 -m pip install --upgrade pip && \ - python3 -m pip install "torch>=2.8.0" "torchvision>=0.15.2" \ - --index-url https://pypi.jetson-ai-lab.io/jp6/cu126 - -RUN uv pip install --system --break-system-packages --index-strategy unsafe-best-match \ - --extra-index-url https://pypi.jetson-ai-lab.io/jp6/cu126 \ - -r _requirements.txt \ - -r requirements.sam.txt \ - -r requirements.clip.txt \ - -r requirements.http.txt \ - -r requirements.gaze.txt \ - -r requirements.groundingdino.txt \ - -r requirements.doctr.txt \ - -r requirements.yolo_world.txt \ - -r requirements.transformers.txt \ - -r requirements.jetson.txt \ - -r requirements.sdk.http.txt \ - -r requirements.easyocr.txt \ - jupyterlab \ - "setuptools<=75.5.0" \ - packaging \ - numpy \ - && rm -rf ~/.cache/uv - -WORKDIR /tmp -RUN git clone --recursive --branch v1.20.0 https://github.com/microsoft/onnxruntime.git /tmp/onnxruntime - -WORKDIR /tmp/onnxruntime - -RUN sed -i 's/be8be39fdbc6e60e94fa7870b280707069b5b81a/32b145f525a8308d7ab1c09388b2e288312d8eba/g' cmake/deps.txt - -RUN ./build.sh \ - --config Release \ - --build_dir build/cuda12 \ - --parallel 4 \ - --use_cuda \ - --cuda_version 12.6 \ - --cuda_home /usr/local/cuda \ - --cudnn_home /usr/lib/aarch64-linux-gnu \ - --use_tensorrt \ - --tensorrt_home /usr/lib/aarch64-linux-gnu \ - --build_wheel \ - --build_shared_lib \ - --skip_tests \ - --cmake_generator Ninja \ - --compile_no_warning_as_error \ - --allow_running_as_root \ - --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES="87" \ - --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF - -RUN uv pip install --system --break-system-packages /tmp/onnxruntime/build/cuda12/Release/dist/onnxruntime_gpu-*.whl - -FROM nvcr.io/nvidia/l4t-jetpack:r36.4.0 AS runtime - -ARG DEBIAN_FRONTEND=noninteractive -ENV LANG=en_US.UTF-8 +# Build from existing working Jetson 6.2.0 image +# This avoids layer depth issues with the large l4t-ml base image (186 layers) +FROM roboflow/roboflow-inference-server-jetson:jetpack-6.2.0 + +# Update with latest inference code +COPY inference/ /app/inference/ +COPY inference_cli/ /app/inference_cli/ +COPY inference_sdk/ /app/inference_sdk/ +COPY .release /app/.release +COPY requirements /app/requirements +COPY Makefile /app/Makefile WORKDIR /app -COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10 -COPY --from=builder /usr/local/bin /usr/local/bin - -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends \ - libxext6 \ - libopencv-dev \ - uvicorn \ - python3-pip \ - git \ - libgdal-dev \ - libvips-dev \ - wget \ - rustc \ - cargo \ - curl \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /build -COPY . . -RUN ln -sf /usr/bin/python3 /usr/bin/python || true +# Rebuild and reinstall inference packages +RUN make create_inference_cli_whl PYTHON=python3 && \ + pip3 install --index-url https://pypi.jetson-ai-lab.io/jp6/cu126 --force-reinstall dist/inference_cli*.whl -RUN python -m pip install --break-system-packages wheel twine requests && \ - rm -f dist/* && \ - python .release/pypi/inference.core.setup.py bdist_wheel && \ - python .release/pypi/inference.gpu.setup.py bdist_wheel && \ - python .release/pypi/inference.cli.setup.py bdist_wheel && \ - python .release/pypi/inference.sdk.setup.py bdist_wheel - -RUN python -m pip install --break-system-packages --no-deps dist/inference_gpu*.whl && \ - python -m pip install --break-system-packages \ - dist/inference_core*.whl \ - dist/inference_cli*.whl \ - dist/inference_sdk*.whl \ - "setuptools<=75.5.0" - -WORKDIR /notebooks -COPY examples/notebooks . - -WORKDIR /app/ -COPY inference inference -COPY docker/config/gpu_http.py gpu_http.py - -ENV VERSION_CHECK_MODE=continuous \ - PROJECT=roboflow-platform \ - NUM_WORKERS=1 \ - HOST=0.0.0.0 \ - PORT=9001 \ - ORT_TENSORRT_FP16_ENABLE=1 \ - ORT_TENSORRT_ENGINE_CACHE_ENABLE=1 \ - ORT_TENSORRT_ENGINE_CACHE_PATH=/tmp/ort_cache \ - OPENBLAS_CORETYPE=ARMV8 \ - LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1 \ - WORKFLOWS_STEP_EXECUTION_MODE=local \ - WORKFLOWS_MAX_CONCURRENT_STEPS=4 \ - API_LOGGING_ENABLED=True \ - LMM_ENABLED=True \ - CORE_MODEL_SAM2_ENABLED=True \ - CORE_MODEL_OWLV2_ENABLED=True \ - ENABLE_STREAM_API=True \ - ENABLE_PROMETHEUS=True \ - STREAM_API_PRELOADED_PROCESSES=2 \ - RUNS_ON_JETSON=True \ - PYTHONPATH=/app:$PYTHONPATH - -RUN mkdir -p /tmp/ort_cache +# Environment variables are already set in base image +# Just ensure VERSION_CHECK_MODE is set correctly +ENV VERSION_CHECK_MODE=continuous EXPOSE 9001 - -ENTRYPOINT uvicorn gpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT +ENTRYPOINT ["sh", "-c", "uvicorn gpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT"] diff --git a/requirements/requirements.sam.txt b/requirements/requirements.sam.txt index 17254092a1..0d046271d9 100644 --- a/requirements/requirements.sam.txt +++ b/requirements/requirements.sam.txt @@ -1,6 +1,6 @@ rf-segment-anything==1.0 samv2==0.0.4 -rasterio~=1.4.0 +rasterio~=1.3.0 pycocotools>=2.0.10 # TODO: update to 2.8.0 once pre-built flashattn is available torch>=2.0.1,<2.7.0