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

Add dev container configs #40

Merged
merged 3 commits into from
May 23, 2023
Merged
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
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "StableStudio dev",
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
// avoid git "dubious ownership" errors, which break yarn
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && yarn install",
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"vscode.typescript-language-features"
]
}
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {

}
},
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openBrowserOnce"
}
}
}
51 changes: 51 additions & 0 deletions .devcontainer/gpu-webui/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "StableStudio+WebUI GPU dev",
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
"postCreateCommand": "cd /home/node && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git webui && cd webui && python -m venv ~/.webui-venv && bash -c 'source ~/.webui-venv/bin/activate' && pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && pip install -r requirements_versions.txt",
// avoid git "dubious ownership" errors, which break yarn
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && yarn",
"postAttachCommand": "echo 'To start the backend, run: cd ~/webui; ./webui.sh'",
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "/home/node/.webui-venv/stability-generator/bin/python"
},
"extensions": [
"vscode.typescript-language-features"
]
}
},
"features": {
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"cudaVersion": "11.8",
"installCudnn": true,
"installNvtx": true
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10.6"
},
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": "libgl1-mesa-glx"
},
"ghcr.io/devcontainers/features/github-cli:1": {

}
},
"remoteEnv": {
"COMMANDLINE_ARGS": "--nowebui --cors-allow-origins=http://localhost:3000",
"venv_dir": "/home/node/.webui-venv"
},
"runArgs": ["--gpus", "all"],
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openBrowserOnce"
},
"7861": {
"label": "Backend",
"onAutoForward": "ignore"
}
}
}