Skip to content

Commit

Permalink
feat(deadline): versionquery construct
Browse files Browse the repository at this point in the history
Fixes #176

BREAKING CHANGE: The version parameter in the RenderQueue constructor
properties was removed and the one taken by the Repository constructor
was modified to use the new VersionQuery construct.
  • Loading branch information
horsmand committed Oct 15, 2020
1 parent 479af57 commit fad2e80
Show file tree
Hide file tree
Showing 30 changed files with 1,150 additions and 861 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ThinkboxDockerRecipes,
UsageBasedLicense,
UsageBasedLicensing,
VersionQuery,
)


Expand Down Expand Up @@ -117,11 +118,13 @@ def __init__(self, scope: Construct, stack_id: str, *, props: ServiceTierProps,
stage=Stage.from_directory(props.docker_recipes_stage_path)
)

version_query = VersionQuery(self, 'VersionQuery')

repository = Repository(
self,
'Repository',
vpc=props.vpc,
version=recipes.version,
version=version_query,
database=props.database,
file_system=props.file_system,
repository_installation_timeout=Duration.minutes(20)
Expand All @@ -142,7 +145,6 @@ def __init__(self, scope: Construct, stack_id: str, *, props: ServiceTierProps,
self,
'RenderQueue',
vpc=props.vpc,
version=recipes.version,
images=recipes.render_queue_images,
repository=repository,
hostname=RenderQueueHostNameProps(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
IPrivateHostedZone,
} from '@aws-cdk/aws-route53';
import * as cdk from '@aws-cdk/core';
import {
import {
IMountableLinuxFilesystem,
X509CertificatePem,
} from 'aws-rfdk';
Expand All @@ -29,9 +29,10 @@ import {
ThinkboxDockerRecipes,
UsageBasedLicense,
UsageBasedLicensing,
VersionQuery,
} from 'aws-rfdk/deadline';
import {
Secret
import {
Secret,
} from '@aws-cdk/aws-secretsmanager';
import { Duration } from '@aws-cdk/core';

Expand Down Expand Up @@ -132,9 +133,12 @@ export class ServiceTier extends cdk.Stack {
stage: Stage.fromDirectory(props.dockerRecipesStagePath),
});

// By not specifying the version property, this will always pull the latest version
const versionQuery = new VersionQuery(this, 'VersionQuery');

const repository = new Repository(this, 'Repository', {
vpc: props.vpc,
version: recipes.version,
version: versionQuery,
database: props.database,
fileSystem: props.fileSystem,
repositoryInstallationTimeout: Duration.minutes(20),
Expand All @@ -150,7 +154,6 @@ export class ServiceTier extends cdk.Stack {
});
this.renderQueue = new RenderQueue(this, 'RenderQueue', {
vpc: props.vpc,
version: recipes.version,
images: recipes.renderQueueImages,
repository: repository,
hostname: {
Expand All @@ -170,7 +173,7 @@ export class ServiceTier extends cdk.Stack {
});
this.renderQueue.connections.allowDefaultPortFrom(this.bastion);

const ublCertSecret = Secret.fromSecretArn(this, 'UBLCertsSecret', props.ublCertsSecretArn);
const ublCertSecret = Secret.fromSecretArn(this, 'UBLCertsSecret', props.ublCertsSecretArn);
this.ublLicensing = new UsageBasedLicensing(this, 'UBLLicensing', {
vpc: props.vpc,
images: recipes.ublImages,
Expand Down
1 change: 0 additions & 1 deletion integ/lib/render-struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class RenderStruct extends Construct {
vpc,
repository: props.repository,
images: recipes.renderQueueImages,
version: recipes.version,
logGroupProps: {
logGroupPrefix: Stack.of(this).stackName + '-' + id,
},
Expand Down
41 changes: 30 additions & 11 deletions integ/lib/storage-struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@
*/

import { DatabaseCluster } from '@aws-cdk/aws-docdb';
import { InstanceClass, InstanceSize, InstanceType, Vpc, SubnetType } from '@aws-cdk/aws-ec2';
import {
InstanceClass,
InstanceSize,
InstanceType,
Vpc,
SubnetType,
} from '@aws-cdk/aws-ec2';
import { FileSystem } from '@aws-cdk/aws-efs';
import { PrivateHostedZone } from '@aws-cdk/aws-route53';
import { ISecret } from '@aws-cdk/aws-secretsmanager';
import { Construct, Duration, RemovalPolicy, Stack } from '@aws-cdk/core';
import { MongoDbInstance, MongoDbPostInstallSetup, MongoDbSsplLicenseAcceptance, MongoDbVersion, MountableEfs, X509CertificatePem, X509CertificatePkcs12 } from 'aws-rfdk';
import { DatabaseConnection, Repository, Stage, ThinkboxDockerRecipes } from 'aws-rfdk/deadline';
import {
Construct,
Duration,
RemovalPolicy,
Stack,
} from '@aws-cdk/core';
import {
MongoDbInstance,
MongoDbPostInstallSetup,
MongoDbSsplLicenseAcceptance,
MongoDbVersion,
MountableEfs,
X509CertificatePem,
X509CertificatePkcs12,
} from 'aws-rfdk';
import {
DatabaseConnection,
Repository,
VersionQuery,
} from 'aws-rfdk/deadline';


// Interface for supplying database connection and accompanying secret for credentials
Expand Down Expand Up @@ -44,16 +67,12 @@ export class StorageStruct extends Construct {
userAcceptsSSPL === 'true' ? MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL : MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL;

const infrastructureStackName = 'RFDKIntegInfrastructure' + props.integStackTag;
const stagePath = process.env.DEADLINE_STAGING_PATH!.toString();

// Get farm VPC from lookup
const vpc = Vpc.fromLookup(this, 'Vpc', { tags: { StackName: infrastructureStackName }}) as Vpc;

// Create recipes object used to prepare the Deadline installers
const recipes = new ThinkboxDockerRecipes(this, 'DockerRecipes', {
stage: Stage.fromDirectory(stagePath),
});
const version = recipes.version;
// This will get the installers for the latest version of Deadline if the version property isn't specified
const versionQuery = new VersionQuery(this, 'VersionQuery');

let cacert;
let database;
Expand Down Expand Up @@ -188,7 +207,7 @@ export class StorageStruct extends Construct {
vpc,
database: databaseConnection,
fileSystem: deadlineMountableEfs,
version: version,
versionedInstallers: versionQuery,
repositoryInstallationTimeout: Duration.minutes(20),
logGroupProps: {
logGroupPrefix: Stack.of(this).stackName + '-' + id,
Expand Down
Loading

0 comments on commit fad2e80

Please sign in to comment.