-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(integ): configure tests to run in pipeline (#205)
- Loading branch information
Showing
29 changed files
with
636 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 0 additions & 68 deletions
68
integ/components/deadline/deadline_03_workerFleet/bin/deadline_03_workerFleet.ts
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
integ/components/deadline/deadline_03_workerFleetHttp/bin/deadline_03_workerFleetHttp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { App, Stack } from '@aws-cdk/core'; | ||
import { | ||
Stage, | ||
ThinkboxDockerRecipes, | ||
} from 'aws-rfdk/deadline'; | ||
|
||
import { RenderStruct } from '../../../../lib/render-struct'; | ||
import { DatabaseType, StorageStruct } from '../../../../lib/storage-struct'; | ||
import { WorkerStruct } from '../../../../lib/worker-struct'; | ||
import { WorkerFleetTestingTier } from '../lib/workerFleetHttp-testing-tier'; | ||
|
||
const app = new App(); | ||
const env = { | ||
account: process.env.CDK_DEFAULT_ACCOUNT, | ||
region: process.env.CDK_DEFAULT_REGION, | ||
}; | ||
|
||
// Get unique tag for this integration test from environment variable | ||
const integStackTag = process.env.INTEG_STACK_TAG!.toString(); | ||
|
||
// Worker fleets with their own repository and render queue will be created for each permutation of OS and protocol | ||
const oss = ['Linux','Windows']; | ||
|
||
let structs: Array<WorkerStruct> = []; | ||
oss.forEach( (os, index) => { | ||
const testId = 'WF' + (index + 1).toString(); | ||
// Create component stack for structs | ||
const componentTier = new Stack(app, 'RFDKInteg-' + testId + '-ComponentTier' + integStackTag, {env}); | ||
|
||
const stagePath = process.env.DEADLINE_STAGING_PATH!.toString(); | ||
// Stage docker recipes, which include image used for the render queue instance and the repo | ||
// installer (in `recipes.version`) | ||
const recipes = new ThinkboxDockerRecipes(componentTier, 'DockerRecipes', { | ||
stage: Stage.fromDirectory(stagePath), | ||
}); | ||
|
||
// Create StorageStruct with repository | ||
const storage = new StorageStruct(componentTier, 'StorageStruct' + testId, { | ||
integStackTag, | ||
databaseType: DatabaseType.DocDB, | ||
version: recipes.version, | ||
}); | ||
// Create render queue with HTTP protocol | ||
const render = new RenderStruct(componentTier, 'RenderStruct' + testId, { | ||
integStackTag, | ||
repository: storage.repo, | ||
protocol: 'http', | ||
recipes, | ||
}); | ||
// Create worker struct containing three nodes using either Linux or Windows | ||
structs.push(new WorkerStruct(componentTier, 'WorkerStruct' + testId, { | ||
integStackTag, | ||
renderStruct: render, | ||
os, | ||
})); | ||
}); | ||
|
||
new WorkerFleetTestingTier(app, 'RFDKInteg-WF-TestingTier' + integStackTag, {env, integStackTag, structs}); |
2 changes: 1 addition & 1 deletion
2
...deadline/deadline_03_workerFleet/cdk.json → ...line/deadline_03_workerFleetHttp/cdk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
integ/components/deadline/deadline_03_workerFleetHttp/lib/workerFleetHttp-testing-tier.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import { Port } from '@aws-cdk/aws-ec2'; | ||
import { Construct } from '@aws-cdk/core'; | ||
import { IWorkerFleet } from 'aws-rfdk/deadline'; | ||
import { TestingTier, TestingTierProps } from '../../../../lib/testing-tier'; | ||
import { WorkerStruct } from '../../../../lib/worker-struct'; | ||
|
||
/** | ||
* Interface for WorkerFleetTestingTier properties | ||
*/ | ||
export interface WorkerFleetTestingTierProps extends TestingTierProps { | ||
/** | ||
* Array of WorkerStructs representing different test cases | ||
*/ | ||
readonly structs: Array<WorkerStruct>; | ||
} | ||
|
||
/** | ||
* Testing Tier for the Deadline WorkerFleet HTTP integration test | ||
* | ||
* Creates a test bastion and configures it to connect to one or more Deadline WorkerInstanceFleet constructs for testing. | ||
* | ||
* Resources Deployed | ||
* ------------------------ | ||
* - A BastionLinuxHost instance | ||
* | ||
* Security Considerations | ||
* ------------------------ | ||
* - The bastion instance created by this test is configured to access farm resources on their default ports | ||
* Test scripts stored on the bastion are used to submit Deadline jobs to farm workers and request information about the workers. | ||
*/ | ||
export class WorkerFleetTestingTier extends TestingTier { | ||
constructor(scope: Construct, id: string, props: WorkerFleetTestingTierProps) { | ||
super(scope, id, props); | ||
|
||
const structs = props.structs; | ||
structs.forEach( workerStruct => { | ||
|
||
const testSuiteId = 'WF' + (structs.indexOf(workerStruct) + 1).toString(); | ||
|
||
const renderQueue = workerStruct.renderQueue; | ||
this.configureRenderQueue(testSuiteId, renderQueue); | ||
|
||
const workerFleet = workerStruct.workerFleet; | ||
this.configureWorkerFleet(workerFleet); | ||
}); | ||
|
||
this.configureBastionUserData({ | ||
testingScriptPath: path.join(__dirname, '../scripts/bastion/testing'), | ||
}); | ||
this.installDeadlineClient(); | ||
} | ||
|
||
/** | ||
* Configures each worker to allow access from the bastion | ||
* | ||
* @param workerFleet Array of worker instances to connect to the test Bastion | ||
*/ | ||
public configureWorkerFleet(workerFleet: Array<IWorkerFleet>) { | ||
workerFleet.forEach( worker => { | ||
this.testInstance.connections.allowTo(worker, Port.tcp(22)); | ||
}); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.