-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Docker and devcontainer support
- Loading branch information
1 parent
3956533
commit 461df5a
Showing
7 changed files
with
359 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "Focoos CPU", | ||
"build": { | ||
"context": "../..", | ||
"dockerfile": "../../Dockerfile", | ||
"target": "focoos-cpu" | ||
}, | ||
"shutdownAction": "none", | ||
"remoteUser": "root", | ||
"workspaceFolder": "${localWorkspaceFolder}", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", | ||
"postCreateCommand": "uv pip install -e .[dev]", | ||
"remoteEnv": { | ||
"UV_SYSTEM_PYTHON": "true" | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "true", | ||
"configureZshAsDefaultShell": "true", | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000", | ||
"upgradePackages": "true" | ||
}, | ||
// git | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "os-provided", | ||
"ppa": "false" | ||
}, | ||
// "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, | ||
"ghcr.io/iterative/features/nvtop:1": {}, | ||
}, | ||
"customizations": { | ||
"devpod": { | ||
"podManifestTemplate": ".devcontainer/pod_manifest.yaml" | ||
}, | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter", | ||
"ms-python.python", | ||
"vscode.git", | ||
"ms-azuretools.vscode-docker", | ||
"vscode.ipynb", | ||
"waderyan.gitblame", | ||
"michelemelluso.gitignore", | ||
"amazonwebservices.aws-toolkit-vscode", | ||
"naumovs.color-highlight", | ||
"mindaro-dev.file-downloader", | ||
"donjayamanne.githistory", | ||
"github.vscode-github-actions", | ||
"seatonjiang.gitmoji-vscode", | ||
"ms-vscode.remote-repositories", | ||
"donjayamanne.python-environment-manager", | ||
"ninoseki.vscode-pylens", | ||
"ninoseki.vscode-mogami", | ||
"charliermarsh.ruff" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"name": "Focoos GPU (OnnxRuntime)", | ||
"build": { | ||
"target": "focoos-onnx", | ||
"context": "../..", | ||
"dockerfile": "../../Dockerfile", | ||
}, | ||
"shutdownAction": "none", | ||
"remoteUser": "root", | ||
"hostRequirements": { | ||
"gpu": "optional" | ||
}, | ||
"workspaceFolder": "${localWorkspaceFolder}", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", | ||
"postCreateCommand": "uv pip install -e .[onnx,dev]", | ||
"remoteEnv": { | ||
"UV_SYSTEM_PYTHON": "true" | ||
}, | ||
"runArgs": [ | ||
"--gpus=all", | ||
"--ipc=host", | ||
"--runtime=nvidia", | ||
"--ulimit=memlock=-1", | ||
"--ulimit=stack=67108864", | ||
"--privileged" | ||
], | ||
"postStartCommand": [ | ||
"nvidia-smi" | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "true", | ||
"configureZshAsDefaultShell": "true", | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000", | ||
"upgradePackages": "true" | ||
}, | ||
// git | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "os-provided", | ||
"ppa": "false" | ||
}, | ||
"ghcr.io/iterative/features/nvtop:1": {}, | ||
}, | ||
"customizations": { | ||
"devpod": { | ||
"podManifestTemplate": ".devcontainer/pod_manifest.yaml" | ||
}, | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter", | ||
"ms-python.python", | ||
"vscode.git", | ||
"ms-azuretools.vscode-docker", | ||
"vscode.ipynb", | ||
"waderyan.gitblame", | ||
"michelemelluso.gitignore", | ||
"amazonwebservices.aws-toolkit-vscode", | ||
"naumovs.color-highlight", | ||
"mindaro-dev.file-downloader", | ||
"donjayamanne.githistory", | ||
"github.vscode-github-actions", | ||
"seatonjiang.gitmoji-vscode", | ||
"ms-vscode.remote-repositories", | ||
"donjayamanne.python-environment-manager", | ||
"ninoseki.vscode-pylens", | ||
"ninoseki.vscode-mogami", | ||
"charliermarsh.ruff" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"name": "Focoos GPU (OnnxRuntime, Torch, TensorRT)", | ||
|
||
"build": { | ||
"context": "../..", | ||
"dockerfile": "../../Dockerfile", | ||
"target": "focoos-tensorrt" | ||
}, | ||
"shutdownAction": "none", | ||
"remoteUser": "root", | ||
"hostRequirements": { | ||
"gpu": "optional" | ||
}, | ||
"workspaceFolder": "${localWorkspaceFolder}", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", | ||
"postCreateCommand": "uv pip install -e .[tensorrt,dev]", | ||
"remoteEnv": { | ||
"UV_SYSTEM_PYTHON": "true" | ||
}, | ||
"runArgs": [ | ||
"--gpus=all", | ||
"--ipc=host", | ||
"--runtime=nvidia", | ||
"--ulimit=memlock=-1", | ||
"--ulimit=stack=67108864", | ||
"--privileged" | ||
], | ||
"postStartCommand": [ | ||
"nvidia-smi" | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "true", | ||
"configureZshAsDefaultShell": "true", | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000", | ||
"upgradePackages": "true" | ||
}, | ||
// git | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "os-provided", | ||
"ppa": "false" | ||
}, | ||
// "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, | ||
"ghcr.io/iterative/features/nvtop:1": {}, | ||
}, | ||
"customizations": { | ||
"devpod": { | ||
"podManifestTemplate": ".devcontainer/pod_manifest.yaml" | ||
}, | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter", | ||
"ms-python.python", | ||
"vscode.git", | ||
"ms-azuretools.vscode-docker", | ||
"vscode.ipynb", | ||
"waderyan.gitblame", | ||
"michelemelluso.gitignore", | ||
"amazonwebservices.aws-toolkit-vscode", | ||
"naumovs.color-highlight", | ||
"mindaro-dev.file-downloader", | ||
"donjayamanne.githistory", | ||
"github.vscode-github-actions", | ||
"seatonjiang.gitmoji-vscode", | ||
"ms-vscode.remote-repositories", | ||
"donjayamanne.python-environment-manager", | ||
"ninoseki.vscode-pylens", | ||
"ninoseki.vscode-mogami", | ||
"charliermarsh.ruff" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"name": "Focoos GPU (OnnxRuntime,Torch)", | ||
"build": { | ||
"context": "../..", | ||
"dockerfile": "../../Dockerfile", | ||
"target": "focoos-torch" | ||
}, | ||
"shutdownAction": "none", | ||
"remoteUser": "root", | ||
"hostRequirements": { | ||
"gpu": "optional" | ||
}, | ||
"workspaceFolder": "${localWorkspaceFolder}", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", | ||
"postCreateCommand": "uv pip install -e .[torch,dev]", | ||
"remoteEnv": { | ||
"UV_SYSTEM_PYTHON": "true" | ||
}, | ||
"runArgs": [ | ||
"--gpus=all", | ||
"--ipc=host", | ||
"--runtime=nvidia", | ||
"--ulimit=memlock=-1", | ||
"--ulimit=stack=67108864", | ||
"--privileged" | ||
], | ||
"postStartCommand": [ | ||
"nvidia-smi" | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "true", | ||
"configureZshAsDefaultShell": "true", | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000", | ||
"upgradePackages": "true" | ||
}, | ||
// git | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "os-provided", | ||
"ppa": "false" | ||
}, | ||
// "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, | ||
"ghcr.io/iterative/features/nvtop:1": {}, | ||
}, | ||
"customizations": { | ||
"devpod": { | ||
"podManifestTemplate": ".devcontainer/pod_manifest.yaml" | ||
}, | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter", | ||
"ms-python.python", | ||
"vscode.git", | ||
"ms-azuretools.vscode-docker", | ||
"vscode.ipynb", | ||
"waderyan.gitblame", | ||
"michelemelluso.gitignore", | ||
"amazonwebservices.aws-toolkit-vscode", | ||
"naumovs.color-highlight", | ||
"mindaro-dev.file-downloader", | ||
"donjayamanne.githistory", | ||
"github.vscode-github-actions", | ||
"seatonjiang.gitmoji-vscode", | ||
"ms-vscode.remote-repositories", | ||
"donjayamanne.python-environment-manager", | ||
"ninoseki.vscode-pylens", | ||
"ninoseki.vscode-mogami", | ||
"charliermarsh.ruff" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM python:3.12-slim-bullseye AS focoos-cpu | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
LABEL authors="focoos.ai" | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential git ffmpeg libsm6 libxext6 gcc libmagic1 wget make cmake | ||
WORKDIR /app | ||
COPY focoos ./focoos | ||
COPY pyproject.toml ./pyproject.toml | ||
RUN uv pip install --system -e . | ||
|
||
|
||
FROM ghcr.io/focoosai/deeplearning:base-cu12-cudnn9-py312-uv AS focoos-onnx | ||
LABEL authors="focoos.ai" | ||
|
||
WORKDIR /app | ||
|
||
COPY focoos ./focoos | ||
COPY pyproject.toml ./pyproject.toml | ||
RUN uv pip install --system -e .[onnx] | ||
|
||
|
||
FROM focoos-onnx AS focoos-torch | ||
RUN uv pip install --system -e .[torch] | ||
|
||
FROM focoos-torch AS focoos-tensorrt | ||
RUN apt-get update && apt-get install -y \ | ||
wget lsb-release && \ | ||
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ | ||
dpkg -i cuda-keyring_1.1-1_all.deb && \ | ||
apt-get update && apt-get install -y \ | ||
tensorrt \ | ||
python3-libnvinfer-dev \ | ||
uff-converter-tf && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
RUN uv pip install --system -e .[tensorrt] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters