compute.rhino3d
compute.rhino3d copied to clipboard
Create Heroku sample
Hi deKlerk , can you please make a tutorial how you used heroku to create the script and use it online? i tried alot without success
Originally posted by @seghier in https://github.com/mcneel/compute.rhino3d/issues/319#issuecomment-806176734
Linked with COMPUTE-219
See #319 for the discussion. The issue went off on a tangent and I can’t find tools in github issues to move the entire tangential discussion to a new issue
I might have some spare time tomorrow to make that ;)
Hi, wanting to quickly deploy an example to check feasibility atm, but running into the same thing as mentioned here:
compute.rhino3d/issues/319, without reasonable log information in deployment.
Seems to deploy without issues when only rhino3dm is imported however, so wondering how to get ghhops-server work on heroku. :-)
@lennert-loos, make sure you have a web
process defined.
Try adding "gunicorn" to requirements.txt
(or Pipfile
) and create a Procfile
with the following (assumes you have a Flask app called app
in main.py
)...
web: gunicorn main:app
@lennert-loos In my case i have peoblem with a python module , maybe this can solve your problem
heroku login
heroku git:remote -a your-app-name
heroku ps:scale worker=1
Ok, I put up a small tutorial that should get you through the process and successfully deploying your app to Heroku: https://github.com/deKlerk/Hops/blob/master/HowToHeroku.md
@sbaer
Thank you very much @deKlerk , i will try it
Thanks @deKlerk! It was the version of python indicated in runtime.txt
that was missing.
Additional comment:
I had the issue that I needed to have cython installed. But this was not possible by using the requirements.txt
. No issue locally (windows), but issue on Heroku deployment.
This package should be installed using a buildpack for Heroku, before pip installing all the other packages in requirements.txt
.
I refer to this thread.
@lennert-loos deKlerk's sample worked for me out of the box, as did another simple hops server that I published to Heroku. Could the cython issue be related to a particular package that you're using?
@lennert-loos deKlerk's sample worked for me out of the box, as did another simple hops server that I published to Heroku. Could the cython issue be related to a particular package that you're using?
Yes. I was checking the compas framework and commented for those running in the same issue perhaps.
Thanks for sharing @lennert-loos. There are some modules taking advantage of Cython, so that will be useful input.