mcneel / compute.rhino3d

REST geometry server based on RhinoCommon and headless Rhino
Other
284 stars 182 forks source link

Create Heroku sample #322

Open sbaer opened 3 years ago

sbaer commented 3 years ago

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

mcneel-build commented 3 years ago

Linked with COMPUTE-219

sbaer commented 3 years ago

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

deKlerk commented 3 years ago

I might have some spare time tomorrow to make that ;)

lennertloos commented 3 years ago

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. :-)

pearswj commented 3 years ago

@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
seghier commented 3 years ago

@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
deKlerk commented 3 years ago

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

seghier commented 3 years ago

Thank you very much @deKlerk , i will try it

lennertloos commented 3 years ago

Thanks @deKlerk! It was the version of python indicated in runtime.txt that was missing.

lennertloos commented 3 years ago

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.

pearswj commented 3 years ago

@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?

lennertloos commented 3 years ago

@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.

deKlerk commented 3 years ago

Thanks for sharing @lennert-loos. There are some modules taking advantage of Cython, so that will be useful input.