Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote dev container #4

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
http_proxy=http://10.232.14.15:8118
https_proxy=http://10.232.14.15:8118
HF_ENDPOINT=https://hf-mirror.com
HF_TOKEN=
36 changes: 36 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ghcr.io/shoppal-ai/llm-base

RUN apt update && apt install -y zsh curl git sudo wget libsndfile1 ffmpeg

# # install python environment
# RUN apt install -y python3.8-dev python3-pip
# RUN update-alternatives --install /usr/bin/pthon python /usr/bin/python3.10 1
RUN apt install -y python3.10-venv

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN usermod -aG sudo $USERNAME
RUN echo 'vscode ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER $USERNAME

RUN cd ~ && wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && sh install.sh

RUN python3 -m venv ~/venv
RUN echo "source ~/venv/bin/activate" >> ~/.zshrc

# Set Python path in the virtual environment.
RUN echo "export PYTHONPATH=\$PYTHONPATH:/workspace" >> ~/.zshrc
RUN /bin/zsh ~/.zshrc

# Setup HF_ENDPOINT and PYANNOTE_CACHE
ENV HF_ENDPOINT=https://hf-mirror.com
ENV PYANNOTE_CACHE=/data0/cache/pyannote/

ENV DEBIAN_FRONTEND=dialog

56 changes: 56 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/postgres
{
"name": "VoiceStreamAI Demo",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceMount": "source=~/VoiceStreamAI,target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
},
"extensions": [
"GitHub.copilot",
"GitHub.copilot-labs",
"GitHub.vscode-pull-request-github",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.isort",
"ms-python.black-formatter",
"matangover.mypy",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.vscode-jupyter-slideshow",
"eamodio.gitlens",
"github.vscode-github-actions"
]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or the host.
// "forwardPorts": [8080],

// Run Args to use GPU
// "runArgs": ["--gpus", "all"],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"

// Configure tool-specific properties.
// "customizations": {},


// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root",
}

23 changes: 23 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.8'

services:
app:
build:
context: .
args:
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
dockerfile: Dockerfile
volumes:
- ~/VoiceStreamAI:/workspace:cached
- /data0:/data0:cached
user: vscode
command: sleep infinity
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
environment:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
6 changes: 6 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
source /home/vscode/venv/bin/activate
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt
pip install -r requirements-dev.txt
sudo chown vscode:vscode /workspace
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_STORE
SHOPPAL_README.md
audio_files/*
__pycache__/
*.ipynb
.ipynb_checkpoints
9 changes: 9 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ffmpeg
pyannote.core
pyannote.audio
torchvision
transformers
websockets
jupyter
datasets
openai
Loading