Move dev container to trt

This commit is contained in:
Nick Mowen 2023-07-18 06:08:43 -06:00
parent b3ce493a16
commit 84adb7ef83
3 changed files with 28 additions and 11 deletions

View File

@ -223,16 +223,6 @@ RUN --mount=type=bind,source=./requirements-dev.txt,target=/workspace/frigate/re
CMD ["sleep", "infinity"] CMD ["sleep", "infinity"]
# Dev Container w/ TRT
FROM devcontainer AS devcontainer-trt
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
COPY docker/tensorrt/detector/rootfs/ /
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
pip3 install -U /deps/trt-wheels/*.whl
# Frigate web build # Frigate web build
# This should be architecture agnostic, so speed up the build on multiarch by not using QEMU. # This should be architecture agnostic, so speed up the build on multiarch by not using QEMU.

View File

@ -37,3 +37,13 @@ RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels
WORKDIR /opt/frigate/ WORKDIR /opt/frigate/
COPY --from=rootfs / / COPY --from=rootfs / /
# Dev Container w/ TRT
FROM devcontainer AS devcontainer-trt
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
COPY docker/tensorrt/detector/rootfs/ /
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
pip3 install -U /deps/trt-wheels/*.whl

View File

@ -13,7 +13,12 @@ target wheels {
platforms = ["linux/amd64"] platforms = ["linux/amd64"]
} }
target "tensorrt" { target devcontainer {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/amd64"]
}
target tensorrt {
dockerfile = "docker/tensorrt/Dockerfile" dockerfile = "docker/tensorrt/Dockerfile"
context = "." context = "."
contexts = { contexts = {
@ -23,3 +28,15 @@ target "tensorrt" {
} }
platforms = ["linux/amd64"] platforms = ["linux/amd64"]
} }
target devcontainer-trt {
dockerfile = "docker/tensorrt/Dockerfile"
context = "."
contexts = {
deps = "target:deps",
rootfs = "target:rootfs"
wheels = "target:wheels"
devcontainer = "target:devcontainer
}
platforms = ["linux/amd64"]
}