aws / aws-rfdk

The Render Farm Deployment Kit on AWS is a library for use with the AWS Cloud Development Kit that helps you define your render farm cloud infrastructure as code.
https://docs.aws.amazon.com/rfdk/index.html
Apache License 2.0
107 stars 42 forks source link

Windows Worker Fleet Example #194

Open crashGoBoom opened 3 years ago

crashGoBoom commented 3 years ago

Hi! The current example seems to be for linux support only. If there is Windows support can this be added as an example / documented?

Thank you!


This is a 📕 documentation issue

statik commented 3 years ago

I'm interested in this as well, we have been able to deploy the RFDK examples but haven't been able to get a windows worker node up and running.

ddneilson commented 3 years ago

Adding a Windows worker fleet to the examples is definitely something that we'll do. In the meantime, here are the modifications that you'll need to make; I'm going to assume the Python example, but the conversion to the Typescript example is just syntax.

  1. The fleet of Workers is created here -- https://github.com/aws/aws-rfdk/blob/0125d9b7d09cd625f8164098091d129621a096ad/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/lib/compute_tier.py#L73
  2. To create a Windows fleet instead of a Linux one, all that we need to do is change the worker_machine_image property ( https://docs.aws.amazon.com/rfdk/api/latest/docs/aws-rfdk.deadline.WorkerInstanceFleet.html#workermachineimage ) to an image that is based off of Windows instead of Linux.
  3. In the example, we define the machine image in the main app here -- https://github.com/aws/aws-rfdk/blob/0125d9b7d09cd625f8164098091d129621a096ad/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/app.py#L117 -- which uses the configuration value that is defined here -- https://github.com/aws/aws-rfdk/blob/0125d9b7d09cd625f8164098091d129621a096ad/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/config.py#L22
  4. In the configuration, add a new property called deadline_client_windows_ami_map and define it the same way you would the Linux one except use a Windows-based AMI instead of a Linux one.
  5. Change the deadline_client_image = MachineImage.generic_linux(config.deadline_client_linux_ami_map) line from the app.py into deadline_client_image = MachineImage.generic_windows(config.deadline_client_windows_ami_map) (this is just using the CDK MachineImage class -- https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.MachineImage.html )

If you would like multiple worker fleets (ex: one Linux & one Windows) then just modify the ComputeTierProps to add properties for each of the different client images that you want to use, and add a new instance of WorkerInstanceFleet in the Compute Tier for each of those added properties.