Dockerized Rhino with AWS load balancing

I am new to Rhino. We have a requirement to set up a Rhino instance on AWS cloud with a Dockized app. We also deploy the app using the EKS kuberntes service. We also need to load balance the service. Please advise me on how to properly deploy this. Is it necessary for me to first obtain a license in order to test this setup?

Is the forum still active? Could someone please assist me in resolving my problem? I am using this Github project to Dockerize the app, but it appears to be outdated.

1 Like

The forum is very active, but I suspect your question is so specific that there are hardly any people who can answer your question. Maybe someone from ShapeDiver, they also run Rhino in the cloud.

@imvishal we can offer experience in running Rhino and Grasshopper on AWS EC2 AutoScaling Groups. The AMI which we are currently using is based on Windows Server 2019.

I recommend you to read this technical comparison between Rhino Compute and ShapeDiver which I wrote a while ago. We also provide a higher level comparison.

In general, when running Rhino on Windows Server you need to use Rhino’s core hour billing, it won’t work in trial mode.

5 Likes

In general, we don’t have a ton of experience (internally) with using Docker and Rhino.Compute. There are some resources online where other users have created a DockerFile which has worked in the past. That said, I’m not sure if it has been tested for Rhino 8. In general, we try to point people towards using a bootstrap script that we wrote which deploys a Rhino.Compute instance via IIS. Here is a guide which explains how that process works. And as @snabela mentioned, if you are using Rhino.Compute on a Windows.Server instance then you will need a core-hour billing account.

1 Like

Hi @snabela

Thank you for responding; I was wondering how we could achieve autoscaling and load balancing for Rhino on AWS. Compute ? I mean, will it require a single license, or will I need to purchase multiple licenses for each EC2 instance?
If you have more information, please share it. My primary goal is to deploy rhino compute on AWS, complete with load balancing and autoscaling.

Billing is based on core-hours. So you’ll need to pay for the number of concurrent cores (threads) on the computers that are capable of running Rhino multiplied by the number of hours they run. Once you set up an EC2 Image with your core-hour billing token, you can use it on all your instances.

So if you have 10 instances with 4 cores each, and all of them run Rhino for an hour, you’ll pay $0.10 per core-hour * 10 instances *4 cores per instance = $4.00.

Load balancers and other AWS billing and other infrastructure cost extra on AWS.

2 Likes

@imvishal in order to achieve autoscaling and load balancing on AWS for Rhino Compute, you need to use an EC2 Auto Scaling Group, integrated with a so-called Application Load Balancer. You can define autoscaling metrics for the Auto Scaling Group, and attach the load balancer.

Also, you need to either create an AMI which has Rhino installed, or set up CodeDeploy integrated with your auto scaling group, such that the deployment of Rhino and whatever other software you need takes place automatically whenever new instances are provisioned. It’s best to use a hybrid approach (custom AMI and CodeDeploy) to achieve a minimal lead time until new instances become available.

Ideally you would set all of this up using CloudFormation, which allows you to manage your infrastructure as code, and replicate to further systems.

4 Likes

Hi @brian There are three types of licenses. Could you tell me which one I need if I run rhino behind AWS ec2 compute with autoscaling? Because autoscaling will increase and decrease the VM size based on the load. If autoscaling scales more than one VM at a time, would a single license suffice?
image

@snabela mentioned this already:

To set up Rhino on AWS with a Dockerized app and deploy it using EKS Kubernetes while also incorporating load balancing, follow these steps:

1. Obtain a Rhino License (If Required): Depending on your organization’s licensing agreement with Rhino, you may need to acquire a valid license before deploying it on AWS. Ensure compliance with licensing terms.

2. AWS Account Setup: Create an AWS account if you don’t already have one. Familiarize yourself with AWS services, including Elastic Kubernetes Service (EKS) and Elastic Load Balancing (ELB).

3. Dockerize Your App: Containerize your application using Docker. This involves creating a Docker image that contains your app and its dependencies.

4. Set Up EKS Cluster: Create an EKS cluster on AWS and configure it to meet your application’s requirements. You can use the AWS Management Console or AWS CLI to set up the cluster.

5. Deploy Your App: Use Kubernetes manifests (YAML files) to deploy your Dockerized app on the EKS cluster. Ensure that your app’s deployment includes necessary configurations for scalability, such as replica sets and resource limits.

6. Implement Load Balancing: Configure an Elastic Load Balancer (ELB) to distribute incoming traffic to the instances running your application. This ensures high availability and reliability.

7. Monitor and Scale: Implement monitoring and auto-scaling policies to manage the performance and availability of your application. AWS offers tools like CloudWatch for monitoring and Auto Scaling for automatic scaling.

8. Security and Access Control: Secure your deployment by configuring network policies, role-based access control (RBAC), and AWS Identity and Access Management (IAM) roles to control access to your resources.

9. Testing and Optimization: Thoroughly test your deployment to ensure it meets your requirements. Optimize configurations for performance, scalability, and cost efficiency.

10. Documentation and Support: Document your deployment process and configurations for reference. Additionally, consider leveraging AWS support if you encounter any technical challenges or require assistance.

Remember to review the Rhino licensing terms and AWS pricing details to understand the costs associated with your deployment. It’s advisable to consult with your organization’s IT or DevOps team to ensure compliance with internal policies and best practices for deploying applications in the AWS cloud.

2 Likes

@Khan_Sarfaraz_Akram I have already set up Rhino compute on an AWS VM with auto scaling and load balancing; all I need to do is dockerize the application. I ran the app in Docker using the Dockerfile provided here (compute.rhino3d/Dockerfile at 8.x · mcneel/compute.rhino3d · GitHub). However, I have several issues with the Dockerized app. Can you share the contents of the docker file if you have already tested the app in Docker? My goal is to deploy the rhino app in a Kubernetes cluster using docker images.

Thank You!

Unfortunately, i don’t have it but you can learn about AWS if you need.

Hi @Khan_Sarfaraz_Akram I am very familiar with AWS, but if your Dockerfile worked, could you please share the content of the Dockerfile you used? Because I am getting an error while trying to build the Dockerfile that was updated in the Rhino github repository.