-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logging UI improvements Improve workspace sync logic Add SERVERLESS env for slim startup Add build-essential package
- Loading branch information
1 parent
fe226c4
commit 33d8ec2
Showing
29 changed files
with
652 additions
and
263 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
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
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/serverless.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:serverless] | ||
command=/opt/ai-dock/bin/supervisor-serverless.sh | ||
process_name=%(program_name)s | ||
numprocs=1 | ||
directory=/root | ||
priority=100 | ||
autostart=true | ||
startsecs=0 | ||
startretries=3 | ||
autorestart=unexpected | ||
stopsignal=TERM | ||
stopwaitsecs=10 | ||
stopasgroup=true | ||
killasgroup=true | ||
stdout_logfile=/var/log/supervisor/serverless.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
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,38 @@ | ||
#!/bin/bash | ||
|
||
trap cleanup EXIT | ||
|
||
function cleanup() { | ||
kill $(jobs -p) >/dev/null 2>&1 | ||
} | ||
|
||
unset -v port | ||
metrics="" | ||
while getopts p: flag | ||
do | ||
case "${flag}" in | ||
p) port="${OPTARG}";; | ||
esac | ||
done | ||
|
||
if [[ -z $port ]]; then | ||
printf "port (-p) is required\n" | ||
exit 1 | ||
fi | ||
|
||
listen_port=$(cat /run/http_ports/${port} | jq -r '.listen_port' 2>/dev/null) | ||
ingress_json=$(curl -s http://localhost:2999/config | jq -r .config.ingress 2>/dev/null) | ||
ingress_count=$(printf "%s" "$ingress_json" | jq length 2>/dev/null) | ||
|
||
for ((i=0;i<ingress_count;i++)); do | ||
ingress=$(printf "%s" "$ingress_json" | jq -r ".[${i}]" 2>/dev/null) | ||
service_port=$(printf "%s" "$ingress" | jq -r .service | cut -d ":" -f 3 2>/dev/null) | ||
|
||
if [[ $service_port = $port ]]; then | ||
printf "https://%s\n" $(echo "$ingress" | jq -r .hostname 2>/dev/null) | ||
exit 0 | ||
fi | ||
done | ||
|
||
printf "No cloudflare tunnel running for localhost:%s\n" $port | ||
exit 1 |
Oops, something went wrong.