diff --git a/deploy/nosana.json b/deploy/nosana.json new file mode 100644 index 00000000..c901e000 --- /dev/null +++ b/deploy/nosana.json @@ -0,0 +1,28 @@ +{ + "version": "0.1", + "type": "container", + "ops": [ + { + "type": "container/run", + "id": "waldo", + "args": { + "image": "docker.io/matthammond962/waldo:v1.0.0-alpha_no-model", + "gpu": true, + "expose": 5000, + "env": { + "MODEL_PATH": "/model" + }, + "resources": [ + { + "type": "HF", + "repo": "jinggu/jing-model", + "files": [ + "vit_g_ps14_ak_ft_ckpt_7_clean.pth" + ], + "target": "/model" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..6dbb00d9 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,32 @@ +FROM pytorch/pytorch:2.7.1-cuda12.8-cudnn9-runtime + +ARG NO_MODEL=false + +RUN apt-get update && apt-get install -y \ + libglib2.0-0 \ + libsm6 \ + libxext6 \ + libxrender-dev \ + libgomp1 \ + && rm -rf /var/lib/apt/lists/* + +COPY . . + +# Install requirements using pip with the system Python +# Fix NumPy compatibility and replace opencv-python with opencv-python-headless for Docker compatibility +RUN pip install --no-cache-dir numpy==1.26.4 && \ + pip install --no-cache-dir -r requirements.txt && \ + pip uninstall -y opencv-python opencv-python-headless && \ + pip install opencv-python-headless==4.9.0.80 + +# Conditionally download model +RUN if [ "$NO_MODEL" != "true" ]; then \ + pip install huggingface_hub && \ + hf download jinggu/jing-model vit_g_ps14_ak_ft_ckpt_7_clean.pth --local-dir /workspace/deepcheat/VideoMAEv2; \ + fi + +# Copy and setup entrypoint script +COPY docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 00000000..3a721dc5 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ -n "$MODEL_PATH" ]; then + ln -s "$MODEL_PATH/vit_g_ps14_ak_ft_ckpt_7_clean.pth" /workspace/deepcheat/VideoMAEv2/vit_g_ps14_ak_ft_ckpt_7_clean.pth +fi + +echo "Running with model..." +exec python main.py