Rhino Compute in AWS

I am following this tutorial Rhino - Deployment to Production Servers
I have completed both the steps successfully. After that the tutorial talks about how to access within grasshopper using hops. I want to know how to access in a web app? I know the public ip of ec2 instance.
When i run locally compute runs in 5000 port and http://localhost:5000/version gives output


https://65.1.193.104/version returns ‘Site can’t be reached’
Where is it actually running on server?

Try this report.Use postman to test.

Yes, the post linked above is probably helpful for testing how to send a HTTP request to your rhino.compute instance. However, I have a question for you about your server setup. If you’re trying to send a request to your VM instance, make sure you’re using the public IP of your VM and using port 80. I am curious why your local compute runs on port 5000. Usually, this port is reserved for the compute.geometry child application, whereas the parent rhino.compute application usually uses a port like 6000. How are you running your local instance of rhino.compute? You can build from the source code, but you need to run the rhino.compute.exe once the project is built. Honestly, the easiest way (I think) is to just install the Hops plugin via the package manager. When you do this, every time you start Grasshopper, an instance of rhino.compute will be started automatically for you. The console window for rhino.compute is hidden by default, but you can make it visible by modifying the Hops settings under the Grasshopper preferences.

Hi Andy,
I am a rookie at both Rhino compute& deploy servers. I found this discussion.
Sometimes, I manually open compute_rhino.exe from the package folder, and the port is 5000. when I open rhino.exe, it is port 6500.
I am trying to figure out how to change the IP address to my EC2 Elastic IP, like in this tutorial. After setting them up, I’ve tried restarting Rhino and Grasshopper, but Hops is still computing on my local machine; I hope you give me some tips.

Have you followed this guide for setting up Rhino.Compute on a VM? Rhino - Deployment to Production Servers

Yes, I thought I had done this to set up Rhino.Compute on my VM. I can use Postman to check IP:80/healthcheck and IP:80/activechildren, both are fine.
Follow this suggestion. My gh file is on the local machine and Github raw download path.

But URL not work fine :smiling_face_with_tear:
擷取_2024_03_22_23_39_05_811

If you’re sending a request to the IP address of your VM and you’re hitting the endpoint /activechildren and it’s returning an integer greater than zero, then your rhino.compute instance is working and the problem is likely to do with the file you’re sending over. What happens if you place a Hops component onto the canvas (on your local machine) and then right-click on that component and point it to this file (attached below). Does it return a valid value?
HelloWorld.gh (5.6 KB)

THX Andy.
I am very Happy it returns a valid value. :muscle:
I don’t know why, but my Hops with EC2 servers is working now. Even the self-made gh file before is also working. Grasshopper now is not open Rhino.Compute Console automatically when Hops request IIS and localhost:6500/version is rejected quest. :grinning:
Maybe sending a /activechildren request once for warm-up new servers is necessary?!?! Get 4 by default.
Is there any way to check the Compute license bill and how many is used?

I’m not sure I understand this last question. Are you saying you aren’t able to get an integer value when you call the /activechildren endpoint? Also, you shouldn’t need to open Grasshopper/Hops at all on the VM. Rhino.Compute will be started automatically via IIS (on the VM). So, once you start your VM, IIS will be started which in turn will handle starting up Rhino.Compute. Now, if you’ve just restarted your VM, then there will be zero “active children” (ie. compute.geometry.exe) running on the VM. If you send a valid Hops request, OR if you send a request to the /activechildren endpoint, then Rhino.Compute will start spinning up the child Compute.Geometry.exe process. This can take some time so, you may get a value of 0 at first, but if you wait a minute and resend your request it should return a non-zero value after that.

I couldn’t get a valid value before the warm-up → using the Postman call request to the /activechildren endpoint: get a 4 number.
The Grasshopper was opened on the local WIP machine and Rhino.Compute Console automatically launched with localhost before. I will reboot my VM and test to find the correct workflows.

It is all great now. Thank Andy. Have a nice day :slight_smile:

1 Like