Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FileExistsError: [Errno 17] File exists: '/root/bentoml' #4781

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

tripathiarpan20
Copy link
Contributor

@tripathiarpan20 tripathiarpan20 commented Jun 6, 2024

Randomly encountering the error below when serving a BentoML server with bentoml serve . -p 5000:
image

The accompanying change should fix it.

The script serves multiple models in parallel and some race condition might be causing the same:

#!/bin/bash
source activate venv_speech
port=${PORT:-6919}

# Check if styletts2-cog directory exists
if [ -d "styletts2-cog" ]; then
  cd styletts2-cog
  sudo rm -r /root/bentoml/models
  nohup bentoml serve . -p 5000 > styletts2-cog.log 2>&1 &
  cd ..
else
  echo "Directory styletts2-cog does not exist."
fi

# Check if ImageBind directory exists
if [ -d "ImageBind" ]; then
  cd ImageBind
  sudo rm -r /root/bentoml/models
  nohup bentoml serve . -p 5001 > ImageBind.log 2>&1 &
  cd ..
else
  echo "Directory ImageBind does not exist."
fi

if [ -d "whisper" ]; then
  cd whisper
  sudo rm -r /root/bentoml/models
  nohup bentoml serve . -p 5002 > whisper.log 2>&1 &
  cd ..
else
  echo "Directory whisper does not exist."
fi

uvicorn main:app --host 0.0.0.0 --port ${port}

@tripathiarpan20 tripathiarpan20 requested a review from a team as a code owner June 6, 2024 17:43
@tripathiarpan20 tripathiarpan20 requested review from parano and removed request for a team June 6, 2024 17:43
@frostming frostming merged commit e40d1a8 into bentoml:main Jun 11, 2024
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants