compute.rhino3d icon indicating copy to clipboard operation
compute.rhino3d copied to clipboard

Create Heroku sample

Open sbaer opened this issue 3 years ago • 13 comments

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

sbaer avatar Mar 25 '21 13:03 sbaer

Linked with COMPUTE-219

mcneel-build avatar Mar 25 '21 13:03 mcneel-build

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

sbaer avatar Mar 25 '21 13:03 sbaer

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

deKlerk avatar Mar 25 '21 14:03 deKlerk

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

lennertloos avatar Mar 26 '21 10:03 lennertloos

@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

pearswj avatar Mar 26 '21 14:03 pearswj

@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

seghier avatar Mar 26 '21 15:03 seghier

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

deKlerk avatar Mar 26 '21 20:03 deKlerk

Thank you very much @deKlerk , i will try it

seghier avatar Mar 26 '21 20:03 seghier

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

lennertloos avatar Mar 29 '21 11:03 lennertloos

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.

lennertloos avatar Mar 29 '21 13:03 lennertloos

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

pearswj avatar Mar 29 '21 20:03 pearswj

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

lennertloos avatar Mar 29 '21 20:03 lennertloos

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

deKlerk avatar Mar 30 '21 09:03 deKlerk