-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1342 from BerriAI/litellm_dockerfile_updates
build(Dockerfile): moves prisma logic to dockerfile
- Loading branch information
Showing
6 changed files
with
100 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
retry_count=0 | ||
max_retries=3 | ||
exit_code=1 | ||
|
||
until [ $retry_count -ge $max_retries ] || [ $exit_code -eq 0 ] | ||
do | ||
retry_count=$((retry_count+1)) | ||
echo "Attempt $retry_count..." | ||
|
||
# Run the Prisma db push command | ||
prisma db push --accept-data-loss | ||
|
||
exit_code=$? | ||
|
||
if [ $exit_code -ne 0 ] && [ $retry_count -lt $max_retries ]; then | ||
echo "Retrying in 10 seconds..." | ||
sleep 10 | ||
fi | ||
done | ||
|
||
if [ $exit_code -ne 0 ]; then | ||
echo "Unable to push database changes after $max_retries retries." | ||
exit 1 | ||
fi | ||
|
||
echo "Database push successful!" |
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,33 @@ | ||
datasource client { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-py" | ||
} | ||
|
||
model LiteLLM_UserTable { | ||
user_id String @unique | ||
max_budget Float? | ||
spend Float @default(0.0) | ||
user_email String? | ||
} | ||
|
||
// required for token gen | ||
model LiteLLM_VerificationToken { | ||
token String @unique | ||
spend Float @default(0.0) | ||
expires DateTime? | ||
models String[] | ||
aliases Json @default("{}") | ||
config Json @default("{}") | ||
user_id String? | ||
max_parallel_requests Int? | ||
metadata Json @default("{}") | ||
} | ||
|
||
model LiteLLM_Config { | ||
param_name String @id | ||
param_value Json? | ||
} |