Skip to content

Commit 15331b7

Browse files
committed
chore(vscode): update settings for non-xformers, add watchdog task
1 parent b9dd6b7 commit 15331b7

7 files changed

Lines changed: 69 additions & 6 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,27 @@
1111

1212
// Features to add to the dev container. More info: https://containers.dev/features.
1313
"features": {
14-
"ghcr.io/devcontainers/features/python:1": {}
14+
"ghcr.io/devcontainers/features/python:1": {
15+
// "version": "3.10"
16+
}
1517
},
1618

1719
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1820
"forwardPorts": [8000],
1921

2022
// Uncomment the next line to run commands after the container is created.
21-
"postCreateCommand": "conda activate xformers",
23+
"postCreateCommand": "scripts/devContainerPostCreate.sh",
2224

2325
"customizations": {
2426
"vscode": {
2527
"extensions": [
2628
"ryanluker.vscode-coverage-gutters",
27-
"fsevenm.run-it-on"
28-
]
29+
"fsevenm.run-it-on",
30+
"ms-python.black-formatter",
31+
],
32+
"settings": {
33+
"python.pythonPath": "/opt/conda/bin/python"
34+
}
2935
}
3036
},
3137

@@ -38,6 +44,8 @@
3844

3945
"runArgs": [
4046
"--gpus",
41-
"all"
47+
"all",
48+
"--env-file",
49+
".devcontainer/local.env"
4250
]
4351
}

.devcontainer/local.example.env

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Useful environment variables:
2+
3+
# AWS or S3-compatible storage credentials and buckets
4+
AWS_ACCESS_KEY_ID=
5+
AWS_SECRET_ACCESS_KEY=
6+
AWS_DEFAULT_REGION=
7+
AWS_S3_DEFAULT_BUCKET=
8+
# Only fill this in if your (non-AWS) provider has told you what to put here
9+
AWS_S3_ENDPOINT_URL=
10+
11+
# To use a proxy, e.g.
12+
# https://github.com/kiri-art/docker-diffusers-api/blob/dev/CONTRIBUTING.md#local-https-caching-proxy
13+
# DDA_http_proxy=http://172.17.0.1:3128
14+
# DDA_https_proxy=http://172.17.0.1:3128
15+
16+
# HuggingFace credentials
17+
HF_AUTH_TOKEN=
18+
HF_USERNAME=
19+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ dmypy.json
130130
permutations
131131
tests/output
132132
node_modules
133+
.devcontainer/local.env

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
"--cov=.",
44
"--cov-report=xml",
55
"--ignore=test.py",
6+
"--ignore=tests/integration",
7+
"--ignore=diffusers",
68
// "unit_tests.py"
79
// "."
810
],
911
"python.testing.unittestEnabled": false,
1012
"python.testing.pytestEnabled": true,
11-
"python.defaultInterpreterPath": "/opt/conda/envs/xformers/bin/python",
13+
// "python.defaultInterpreterPath": "/opt/conda/envs/xformers/bin/python",
14+
"python.defaultInterpreterPath": "/opt/conda/bin/python",
1215
"runItOn": {
1316
"commands": [
1417
{

.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Watching Server",
8+
"type": "shell",
9+
"command": "scripts/devContainerServer.sh"
10+
}
11+
]
12+
}

scripts/devContainerPostCreate.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# devcontainer.json postCreateCommand
4+
5+
echo
6+
echo Initialize conda bindings for bash
7+
conda init bash
8+
9+
echo Activating
10+
source /opt/conda/bin/activate base
11+
12+
echo Installing dev dependencies
13+
pip install watchdog

scripts/devContainerServer.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source /opt/conda/bin/activate base
4+
5+
ln -sf /api/diffusers .
6+
7+
watchmedo auto-restart --recursive -d api python api/server.py

0 commit comments

Comments
 (0)