Skip to content

Commit

Permalink
Merge pull request #157 from roboflow/fix/address-vulnerabilities
Browse files Browse the repository at this point in the history
Fix Critical and High Vulnerabilities in Docker Images
  • Loading branch information
paulguerrie authored Dec 1, 2023
2 parents eda91d6 + 07fc8cd commit cb0a22f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docker/dockerfiles/Dockerfile.onnx.gpu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
# FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
FROM nvcr.io/nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04

WORKDIR /app

Expand All @@ -9,6 +10,7 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_
uvicorn \
python3-pip \
git \
libgdal-dev \
&& rm -rf /var/lib/apt/lists/*

COPY requirements/requirements.sam.txt \
Expand Down
16 changes: 8 additions & 8 deletions inference/core/interfaces/http/http_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,11 @@ async def infer_keypoints(
@with_route_exceptions
async def clip_embed_image(
inference_request: ClipImageEmbeddingRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Embeds image data using the OpenAI CLIP model.
Expand Down Expand Up @@ -608,11 +608,11 @@ async def clip_embed_image(
@with_route_exceptions
async def clip_embed_text(
inference_request: ClipTextEmbeddingRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Embeds text data using the OpenAI CLIP model.
Expand Down Expand Up @@ -645,11 +645,11 @@ async def clip_embed_text(
@with_route_exceptions
async def clip_compare(
inference_request: ClipCompareRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Computes similarity scores using the OpenAI CLIP model.
Expand Down Expand Up @@ -684,11 +684,11 @@ async def clip_compare(
@with_route_exceptions
async def doctr_retrieve_text(
inference_request: DoctrOCRInferenceRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Embeds image data using the DocTR model.
Expand Down Expand Up @@ -725,11 +725,11 @@ async def doctr_retrieve_text(
@with_route_exceptions
async def sam_embed_image(
inference_request: SamEmbeddingRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Embeds image data using the Meta AI Segmant Anything Model (SAM).
Expand Down Expand Up @@ -767,11 +767,11 @@ async def sam_embed_image(
@with_route_exceptions
async def sam_segment_image(
inference_request: SamSegmentationRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Generates segmentations for image data using the Meta AI Segmant Anything Model (SAM).
Expand Down Expand Up @@ -811,11 +811,11 @@ async def sam_segment_image(
@with_route_exceptions
async def gaze_detection(
inference_request: GazeDetectionInferenceRequest,
request: Request,
api_key: Optional[str] = Query(
None,
description="Roboflow API Key that will be passed to the model during initialization for artifact retrieval",
),
request: Request = Body(),
):
"""
Detect gaze using the gaze detection model.
Expand Down Expand Up @@ -858,6 +858,7 @@ async def gaze_detection(
@with_route_exceptions
async def legacy_infer_from_request(
background_tasks: BackgroundTasks,
request: Request,
dataset_id: str = Path(
description="ID of a Roboflow dataset corresponding to the model to use for inference"
),
Expand Down Expand Up @@ -908,7 +909,6 @@ async def legacy_infer_from_request(
0.3,
description="The IoU threhsold that must be met for a box pair to be considered duplicate during NMS",
),
request: Request = Body(),
stroke: int = Query(
1, description="The stroke width used when visualizing predictions"
),
Expand Down
4 changes: 3 additions & 1 deletion requirements/_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
APScheduler<=3.10.1
cython<=3.0.0
python-dotenv<=2.0.0
fastapi<=0.85.1
fastapi<=0.96
numpy<=1.25.2
opencv-python<=4.8.0.76
piexif<=1.1.3
Expand All @@ -15,4 +15,6 @@ supervision<1.0.0
pybase64<2.0.0
scikit-image>=0.19.0
requests-toolbelt>=1.0.0
wheel>=0.38.1
setuptools>=65.5.1
pytest-asyncio<=0.21.1
2 changes: 1 addition & 1 deletion requirements/requirements.sam.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rf-segment-anything==1.0
torch<=2.0.1
torchvision<=0.15.2
rasterio<=1.2.10
rasterio<=1.3

0 comments on commit cb0a22f

Please sign in to comment.