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

Test appserver locally against a remote compute server #63

Closed
andrewringler opened this issue Feb 8, 2021 · 2 comments
Closed

Test appserver locally against a remote compute server #63

andrewringler opened this issue Feb 8, 2021 · 2 comments

Comments

@andrewringler
Copy link

I have appserver running fine for production. We have a compute server in a virtual machine and we have appserver on a separate web machine.

For locally testing during development I am trying to run appserver locally, while still connecting to our remote compute server so that I do not have to install Rhino on my local machine. So I am doing:

export COMPUTE_URL=some external server
export RHINO_API_TOKEN=…
export RHINO_COMPUTE_KEY=…
npm start

But, this does not seem to work, I keep getting 500 errors from the compute server. Should I expect this type of setup to work? Does the compute server require some sort of publicly accessible callback URL at appserver?

Thanks for any thoughts. Andrew.

@pearswj
Copy link
Member

pearswj commented Feb 9, 2021

This kind of set up doesn't work unless the appserver (running on your machine) is also accessible from compute. When the appserver makes a request to compute to solve a grasshopper definition it includes a link to the definition, rather than send the whole file. Compute then downloads the file using the link and will cache the file so that it doesn't need to do this every time. If you're running locally then this link will be something like http://localhost:3000/definition/<id>, which isn't accessible from compute.

To get around this you could use something like ngrok (free version is fine). Run ngrok http 3000 and leave it running at the same time as the appserver is running. Use the unique ngrok.io url that's given to you to access your appserver. This set up should be fine for testing.

p.s. use RHINO_COMPUTE_URL and RHINO_COMPUTE_KEY. You shouldn't need to set RHINO_API_TOKEN.

@andrewringler
Copy link
Author

Perfect thanks! ngrok worked for me.

@pearswj pearswj closed this as completed Feb 9, 2021
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

No branches or pull requests

2 participants