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

Can't create a deadline render farm construct using RFDK constructs provided in Python SEP example #1028

Open
mainframenzo opened this issue Mar 29, 2023 · 2 comments
Labels
guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged.

Comments

@mainframenzo
Copy link

mainframenzo commented Mar 29, 2023

I have an existing non-deadline render farm stack. I am trying to integrate deadline using the RFDK.

I tried to move the example SEP stack code (Python) into a CDK construct and then pull that construct in to my existing render farm stack, but I'm running into issues like this: 'deadline/recipes/RemoteConnectionServer' should be created in the scope of a Stack, but no Stack found for various constructs.

It's highly probable I'm doing something wrong as it seems very unCDK-like to force stack-level constructs? Do ya'll have any guidance on for doing this? For example, here is what I'm doing:

class ExistingRenderFarmStack(cdk.Stack):
	def __init__(self, scope: Construct, id: str, *, props: Props, **kwargs) -> None:
		super().__init__(scope, id, **kwargs)
                
                ExistingFargateRenderFleet(scope, 'fargate-render-fleet')
                ExistingLambdaHeadlessRenderFleet(scope, 'lambda-render-fleet')

		cinema4d_render_fleet = RenderFleet(
			deadline_group='cinema4d',
			ami_type='windows',
			amis_by_region={
				'us-east-1': 'ami-07bc6c154e92f72bf'
			},
			instance_type=InstanceType.of(InstanceClass.C5, InstanceSize.XLARGE4),
			max_capacity=1,
			user_data_file='powershell.sh'
		)

		# The UBL licenses to use. See: https://www.awsthinkbox.com/ubl-info
		ubl_licenses = [
			UsageBasedLicense.for_cinema4_d()
		]

		# Note: SingletonFunction at 'deadline/version/VersionProviderFunction' should be created in the scope of a Stack, but no Stack found
		#version = VersionQuery(self, 'version', version=props.deadline_version)

		props = DeadlineRenderFarmProps(
			#deadline_version=version,
			docker_recipes_stage_path=props.docker_recipes_stage_path,
			render_fleets=[cinema4d_render_fleet],
			ubl_certificate_secret_arn='TODO',
			ubl_licenses=ubl_licenses
		)

		DeadlineRenderFarm(scope, 'deadline', props)` # Your SEP example code more or less, but as a construct, not a stack
@mainframenzo mainframenzo added the needs-triage This issue or PR still needs to be triaged. label Mar 29, 2023
@mainframenzo mainframenzo changed the title Can't create a render farm Construct using RFDK Constructs provided in Python SEP example Can't create a deadline render farm construct using RFDK constructs provided in Python SEP example Mar 29, 2023
@jusiskin
Copy link
Contributor

I believe the issue is with the line:

DeadlineRenderFarm(scope, 'deadline', props)

The scope of the stack is actually a cdk.App instance, so you're attempting to attach a construct to an App. Instead it should be:

DeadlineRenderFarm(self, 'deadline', props)

Let me know if that works.

@jusiskin jusiskin added the guidance Question that needs advice or information. label Mar 30, 2023
@jusiskin
Copy link
Contributor

@mainframenzo - just circling back here. Did the suggestion fix your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants