litellm
litellm copied to clipboard
[Bug]: OpenShift Deployment starts without Prisma
What happened?
Problem:
In this issue, the default litellm
command within the LiteLLM container attempts to execute prisma generate
within a directory facing two significant challenges that must be addressed on OpenShift for the command to successfully write to the directory:
-
Permissions: The target path,
/usr/local/lib/python3.11/site-packages/prisma/,
is mounted as read-only. -
Overwriting: The file
schema.prisma
, already present at the target path, cannot be overwritten. This is due to the function callshutil.copy(data.schema_path, packaged_schema)
attempting to overwriteschema.prisma.
Solution:
- Build Without Prisma Schema: A straightforward solution would be to construct the upstream container without including the Prisma schema at the path
/usr/local/lib/python3.11/site-packages/prisma/schema.prisma
. - Rebuild with Adjusted Permissions and File Removal: A more involved solution entails using the upstream container as a base and then rebuilding the LiteLLM image with adjusted permissions to allow writing to the directory and removing the pre-existing
schema.prisma
file. This way we can executelitellm
command can executeprisma generate
without encountering issues.
It is worth highlighting that OpenShift permissions are stricter security policies.
Relevant log output
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prisma/generator/generator.py",
line 112, in run
self._on_request(request)
File "/usr/local/lib/python3.11/site-packages/prisma/generator/generator.py",
line 170, in _on_request
self.generate(data)
File "/usr/local/lib/python3.11/site-packages/prisma/generator/generator.py",
line 255, in generate
shutil.copy(data.schema_path, packaged_schema)
File "/usr/local/lib/python3.11/shutil.py", line 431, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/local/lib/python3.11/shutil.py", line 258, in copyfile
with open(dst, 'wb') as fdst:
^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: '/usr/local/lib/python3.11/site-packa
ges/prisma/schema.prisma'
### Twitter / LinkedIn details
_No response_