Unverified Commit 45bd0f2a authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #2473 from cheahjs/fix/space-litellm-config

fix: space startup script
parents 25c9fb6a b20ec058
...@@ -37,22 +37,26 @@ if [ -n "$SPACE_ID" ]; then ...@@ -37,22 +37,26 @@ if [ -n "$SPACE_ID" ]; then
# Copy litellm_config.yaml with specified ownership # Copy litellm_config.yaml with specified ownership
echo "Copying litellm_config.yaml to the desired location with specified ownership..." echo "Copying litellm_config.yaml to the desired location with specified ownership..."
cp ./backend/space/litellm_config.yaml ./data/litellm/config.yaml cp -f ./space/litellm_config.yaml ./data/litellm/config.yaml
WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" uvicorn main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' & if [ -n "$ADMIN_USER_EMAIL" ] && [ -n "$ADMIN_USER_PASSWORD" ]; then
webui_pid=$! echo "Admin user configured, creating"
echo "Waiting for webui to start..." WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" uvicorn main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' &
while ! curl -s http://localhost:8080/health > /dev/null; do webui_pid=$!
sleep 1 echo "Waiting for webui to start..."
done while ! curl -s http://localhost:8080/health > /dev/null; do
echo "Creating admin user..." sleep 1
curl \ done
-X POST "http://localhost:8080/api/v1/auths/signup" \ echo "Creating admin user..."
-H "accept: application/json" \ curl \
-H "Content-Type: application/json" \ -X POST "http://localhost:8080/api/v1/auths/signup" \
-d "{ \"email\": \"${ADMIN_USER_EMAIL}\", \"password\": \"${ADMIN_USER_PASSWORD}\", \"name\": \"Admin\" }" -H "accept: application/json" \
echo "Shutting down webui..." -H "Content-Type: application/json" \
kill $webui_pid -d "{ \"email\": \"${ADMIN_USER_EMAIL}\", \"password\": \"${ADMIN_USER_PASSWORD}\", \"name\": \"Admin\" }"
echo "Shutting down webui..."
kill $webui_pid
fi
export WEBUI_URL=${SPACE_HOST} export WEBUI_URL=${SPACE_HOST}
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment