Skip to content

Commit

Permalink
Fix pinned-dependency issues for docker (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu authored Feb 28, 2024
1 parent c9d8bf8 commit 081d7c3
Show file tree
Hide file tree
Showing 5 changed files with 502 additions and 8 deletions.
11 changes: 5 additions & 6 deletions docker/segment-anything/Dockerfile.exporter
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG model_type

FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime AS onnx-exporter-base
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime@sha256:1e26efd426b0fecbfe7cf3d3ae5003fada6ac5a76eddc1e042857f5d049605ee AS onnx-exporter-base

ARG http_proxy
ARG https_proxy
Expand All @@ -9,14 +9,13 @@ ARG no_proxy
RUN apt update && apt install -y git curl && \
rm -rf /var/lib/apt/lists/*

RUN pip install opencv-python pycocotools matplotlib onnxruntime onnx
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --require-hashes --no-deps -r /tmp/requirements.txt && rm /tmp/requirements.txt

WORKDIR /ws
RUN mkdir -p /ws/output
RUN git clone https://github.com/facebookresearch/segment-anything.git

WORKDIR /ws/segment-anything
RUN pip install -e .
RUN pip install -e git+https://github.com/facebookresearch/segment-anything/@6fdee8f2727f4506cfbbe553e23b895e27956588#egg=segment_anything
WORKDIR /ws/src/segment-anything

# From https://github.com/facebookresearch/segment-anything/tree/main#model-checkpoints
# vit_h: https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
Expand Down
2 changes: 1 addition & 1 deletion docker/segment-anything/Dockerfile.ovms
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openvino/model_server:2023.0-gpu AS ovms
FROM openvino/model_server:2023.0-gpu@sha256:c29fa4c2c7bd0432f85e69fd2ed28bff9c3e27defaf0055b3c9b314df21a9d38 AS ovms

USER root

Expand Down
2 changes: 1 addition & 1 deletion docker/segment-anything/Dockerfile.triton
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvcr.io/nvidia/tritonserver:23.07-py3 AS nvidia-triton
FROM nvcr.io/nvidia/tritonserver:23.07-py3@sha256:643b13be1086195615554646cf1d6c0ba2273349f175bfab833142534af1796d AS nvidia-triton

ADD triton/sam_encoder /models/sam_encoder
ADD triton/sam_decoder /models/sam_decoder
Expand Down
5 changes: 5 additions & 0 deletions docker/segment-anything/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
opencv-python
pycocotools
matplotlib
onnxruntime
onnx
Loading

0 comments on commit 081d7c3

Please sign in to comment.