Deployment Failures
With no time to spare let's hop into the details:
I have to present this application in front of recruiters and stuff in like 12 hours.
github repo I'm using (my team and I's work): https://github.com/CTP-DS330-One-of-a-Kind/What-Up-Dog/tree/main
deployment error im receiving: application failed to respond
GitHub
GitHub - CTP-DS330-One-of-a-Kind/What-Up-Dog: What up dog utilizes ...
What up dog utilizes a variety of models to not only predict the emotion your dog is experiencing in a picture you upload, but also will generate text based on environmental factors and the dog&...
95 Replies
Project ID:
N/A
551b214
the project id is a uuid v4, so thats wrong, but it doesnt matter, you really only need to provide those for platform issues
ok, first time using this app or deploying really so expect noob mistakes
no worries, getting the solution ready now
is your model.pkl file in git lfs?
LFS as in the largefilesystem thing? Yers
Yes*
railway wont pull files from git lfs, youd need to host that file elsewhere and download it yourself.
but you would also still need to add this as a railway.json file to your project.
mm ok, any ideas on how to host it? It's a crucial model for this app
adding that to root now
are you sure its on lfs? nothing on the page tells me its in lfs?
uhh i mean it should be it's over the limit when i would drag and drop (ik bad practice)
its 100mib or more for git lfs i think
so i dont think its in git lfs
falls short then by .8mb lol
1.7mb*
6.26mib*
98.3 mb -> 93.74 mib
100 mib - 93.74 mib = 6.26mib -> 6.56mb
either way, let me know how adding that railway.json file works out
lol will do
i should note by saving files into this folder https://github.com/CTP-DS330-One-of-a-Kind/What-Up-Dog/blob/main/app.py#L6
you are saving the files into the containers ephemeral storage and anything you save there will not persist between deployments, to persist data between deployments you must use a volume https://docs.railway.app/reference/volumes
Persistance (thankfully) is not needed.
im having issues with the push
okay good, just thought id mention
railway.json becomes untracked each time its added to project root
github is hard
for real though
thats why i use github desktop
ok its pushed will test now
well it decided to push it to my personal account but whatever
GitHub
GitHub - theUncluded/final_dog
Contribute to theUncluded/final_dog development by creating an account on GitHub.
haha well you gotta get the file into the repo that railway is deploying from
also, this is an ai thingy, you will likely need more than the trail accounts max 512mb of ram to run it
Yes, willing to throw money at this problem rn
sounds good 😆
i mean i dont see a railway.json file in the repo you linked at first?
its in finaldog , most recent one i linked
but is railway deploying from that repo?
yes it is deploying from final_dog
set it up when it sent here
can you send both your build and deploy logs https://bookmarklets.up.railway.app/log-downloader/
in the orignal repo you linked you did have gunicorn in the requirements.txt file, but in the new repo you dont
ok will update rn
re-init ing , building , deploying
same deal, app failed to respond
both logs again please
build seems to pass, errors out near the end of what i assume deployment is
FileNotFoundError: [Errno 2] No such file or directory: 'gpt_api.txt'
oh my lord
looks like you are trying to store your open ai key in a text file?
yes
i forgot to do the environmental var
put the key into your service variables (make sure to cancel the popup)
then remove these two lines https://github.com/theUncluded/final_dog/blob/main/util/load_models.py#L41-L42
Updated, environ set, redoing the 10m process
any idea why your image is 5 something gigabytes?
uh
where at?
haha read your build logs
you have the model.pkl file but thats only 98mb
do you have a bunch of other large files elsewhere in the repo?
yeah wtf, my only guess would be all the dependances .. but im really at a loss for that one
you only have a 7 line requirements.txt file
apologies, ive been trying to deploy this for about 7 hours straight.
i think its the timm package
"It comes packaged with >700 pretrained models, and is designed to be flexible and easy to use."
You know timm was just added today and both myself and the other ml dev dont know where its used
was probably where the other dude got his model from tbh\
only guesses though irdk
well then you could save 5gb and drop your deploy time down to a tiny fraction of what it is right now
lets see if i remove import and timm req after this deploy run
sounds good
already see it in the deploy logs
Hi, resident python guy here. What's the issue?
raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
a lot lol
well it seems to really just be my api
did you set a
OPENAI_API_KEY
service variable?yes
set the OPENAI_API_KEY variable and if that doesn't work,
API_KEY = os.getenv("OPENAI_API_KEY")
and pass that through to the apiand removed the lines
gonna trim timm rq
pushed, reinit ing
longest deployment yet without timm
is the image still 5gb?
checking rn
It's very weird how long your deployments are taking
their images are 5gb so the time isnt too odd
deployment isnt done but I dont see the image thing in here
unless if im blatantly blind
The image hasn't published yet
oh
There'll be more lines
ok
whoops
370 seconds, very odd but this isnt your doing
well glad I didnt do that one haha
same deal image is there
still 5 something gb?
yeah, so strange
The error this time is that you removed timm and a section of your code still expects it. I don't think reducing the image size is the way to go here, let's just get your app hosted and you can worry about optimizations later
yeah seems like timm is a requirement
gonna re add
While you're at it, do what I said above here
that should be done already
Instead of opening your text file to retrieve the key, use os.getenv
redoing everything
im still getting the same api error
The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
from the looks of your code, you arent doing the first option
https://github.com/theUncluded/final_dog/blob/main/util/load_models.py#L41
but setting OPENAI_API_KEY
in the service variables should work, since they are injected into the containers environment, that makes me think you didnt set the service variable properly or did a typothat api key works tested local
uh you spelt it wrong
bruh
motherfuck
well not spelt but you know
yeah ty
talk to yall in 10
omfg it worked
thank you
woohoo!!