-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6072aa7
commit a7bffb6
Showing
24 changed files
with
260 additions
and
54 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
workspace | ||
*__pycache__ | ||
build/COPY_ROOT_EXTRA/ | ||
config/authorized_keys | ||
config/rclone | ||
|
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
21 changes: 21 additions & 0 deletions
21
build/COPY_ROOT/etc/supervisor/supervisord/conf.d/comfyui_rp_api.conf
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,21 @@ | ||
[program:comfyui_rp_api] | ||
command=/opt/ai-dock/bin/supervisor-comfyui-rp-api.sh | ||
process_name=%(program_name)s | ||
numprocs=1 | ||
directory=/opt/serverless/providers/runpod | ||
priority=1500 | ||
autostart=true | ||
startsecs=5 | ||
startretries=3 | ||
autorestart=unexpected | ||
stopsignal=TERM | ||
stopwaitsecs=10 | ||
stopasgroup=true | ||
killasgroup=true | ||
stdout_logfile=/var/log/supervisor/comfyui-rp-api.log | ||
stdout_logfile_maxbytes=10MB | ||
stdout_logfile_backups=1 | ||
stderr_logfile=/dev/null | ||
stderr_logfile_maxbytes=0 | ||
stderr_logfile_backups=0 | ||
environment=PROC_NAME="%(program_name)s" |
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
31 changes: 31 additions & 0 deletions
31
build/COPY_ROOT/opt/ai-dock/bin/supervisor-comfyui-rp-api.sh
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,31 @@ | ||
#!/bin/bash | ||
|
||
trap cleanup EXIT | ||
|
||
LISTEN_PORT=38188 | ||
SERVICE_NAME="RunPod Serverless API" | ||
|
||
function cleanup() { | ||
kill $(jobs -p) > /dev/null 2>&1 | ||
} | ||
|
||
|
||
function start() { | ||
if [[ ${SERVERLESS,,} = "true" ]]; then | ||
printf "Refusing to start hosted API service in serverless mode\n" | ||
exec sleep 10 | ||
fi | ||
|
||
printf "Starting %s...\n" ${SERVICE_NAME} | ||
|
||
kill $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 & | ||
wait -n | ||
|
||
cd /opt/serverless/providers/runpod && \ | ||
micromamba run -n serverless python worker.py \ | ||
--rp_serve_api \ | ||
--rp_api_port $LISTEN_PORT \ | ||
--rp_api_host 127.0.0.1 | ||
} | ||
|
||
start 2>&1 |
10 changes: 10 additions & 0 deletions
10
build/COPY_ROOT/opt/ai-dock/storage_monitor/etc/mappings.sh
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,10 @@ | ||
# Key is relative to $WORKSPACE/storage/ | ||
|
||
declare -A storage_map | ||
storage_map["stable_diffusion/models/ckpt"]="/opt/ComfyUI/models/checkpoints" | ||
storage_map["stable_diffusion/models/lora"]="/opt/ComfyUI/models/loras" | ||
storage_map["stable_diffusion/models/controlnet"]="/opt/ComfyUI/models/controlnet" | ||
storage_map["stable_diffusion/models/vae"]="/opt/ComfyUI/models/vae" | ||
storage_map["stable_diffusion/models/esrgan"]="/opt/ComfyUI/models/upscale_models" | ||
|
||
# Add more mappings for other repository directories as needed |
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,12 @@ | ||
:!PROXY_PORT { | ||
handle_path /openapi.json { | ||
root * /opt/serverless/docs/swagger/openapi.yaml | ||
file_server | ||
} | ||
|
||
handle_path /rp-api* { | ||
reverse_proxy localhost:38188 | ||
} | ||
|
||
reverse_proxy localhost:!LISTEN_PORT | ||
} |
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,16 @@ | ||
:!PROXY_PORT { | ||
basicauth * { | ||
import /opt/caddy/etc/basicauth | ||
} | ||
|
||
handle_path /openapi.json { | ||
root * /opt/serverless/docs/swagger/openapi.yaml | ||
file_server | ||
} | ||
|
||
handle_path /rp-api* { | ||
reverse_proxy localhost:38188 | ||
} | ||
|
||
reverse_proxy localhost:!LISTEN_PORT | ||
} |
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
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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.