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

fix(deadline): adding deadline version check for workers #100

Merged
merged 7 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/aws-rfdk/lib/deadline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The `aws-rfdk/deadline` sub-module contains Deadline-specific constructs that ca
import * as deadline from 'aws-rfdk/deadline';
```

---

_**Note:** RFDK constructs currently support Deadline 10.1.9 and later._

---

- [Render Queue](#render-queue)
- [Docker Container Images](#render-queue-docker-container-images)
- [Encryption](#render-queue-encryption)
Expand Down
6 changes: 5 additions & 1 deletion packages/aws-rfdk/lib/deadline/lib/worker-fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,17 @@ export interface WorkerInstanceFleetProps {
* Health Monitor component to monitor the health of instances.
*
* @default - Health Monitoring is turned-off
*
* Note: The health-check feature is supported with Deadline Client v10.1.9 and later.
jusiskin marked this conversation as resolved.
Show resolved Hide resolved
*/
readonly healthMonitor?: IHealthMonitor;

/**
* Properties for configuring a health check
* Properties for configuring a health check.
*
* @default properties of HealthCheckConfig applies
*
* Note: The health-check feature is supported with Deadline Client v10.1.9 and later.
*/
readonly healthCheckConfig?: HealthCheckConfig;

Expand Down
15 changes: 15 additions & 0 deletions packages/aws-rfdk/lib/deadline/scripts/bash/configureWorker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ if [ ! -f "$DEADLINE_COMMAND" ]; then
exit 1
fi

isVersionLessThan() {
python -c "import sys;sys.exit(0 if tuple(map(int, sys.argv[-2].split('.'))) < tuple(map(int, sys.argv[-1].split('.'))) else 1)" "$1" "$2"
}

DEADLINE_VERSION=$("$DEADLINE_COMMAND" -Version | grep -oP '[v]\K\d+\.\d+\.\d+\.\d+\b')
if [ -z "$DEADLINE_VERSION" ]; then
echo "ERROR: Unable to identify the version of installed Deadline Client. Exiting..."
exit 1
fi
MINIMUM_SUPPORTED_DEADLINE_VERSION="10.1.9"
if isVersionLessThan $DEADLINE_VERSION $MINIMUM_SUPPORTED_DEADLINE_VERSION; then
echo "ERROR: Installed Deadline Version ($DEADLINE_VERSION) is less than the minimum supported version ($MINIMUM_SUPPORTED_DEADLINE_VERSION). Exiting..."
exit 1
fi

# launch worker at launcher startup
"$DEADLINE_COMMAND" -SetIniFileSetting LaunchSlaveAtStartup True
# keep worker running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ if (!(Test-Path $DEADLINE_COMMAND)) {
exit 1
}

$DeadlineVersion = (& $DEADLINE_COMMAND -Version | Out-String) | Select-String -Pattern '[v](\d+\.\d+\.\d+\.\d+)\b' | % {$_.Matches.Groups[1].Value}
if ([string]::IsNullOrEmpty($DeadlineVersion)) {
Write-Host "ERROR: Unable to identify the version of installed Deadline Client. Exiting..."
exit 1
}
$MINIMUM_SUPPORTED_DEADLINE_VERSION = "10.1.9"
if([System.Version]$DeadlineVersion -lt [System.Version]$MINIMUM_SUPPORTED_DEADLINE_VERSION) {
Write-Host "ERROR: Installed Deadline Version ($($DeadlineVersion)) is less than the minimum supported version ($($MINIMUM_SUPPORTED_DEADLINE_VERSION)). Exiting..."
exit 1
}

# launch worker at launcher startup
& $DEADLINE_COMMAND -SetIniFileSetting LaunchSlaveAtStartup True | Out-Default
# keep worker running
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-rfdk/lib/deadline/test/asset-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export {CWA_ASSET_LINUX};

// configureWorker.sh
export const CONFIG_WORKER_ASSET_LINUX = {
Bucket: 'AssetParameters2435996be08703cd3819e249890abb41cc0860324e5cfe1b5945704934db7101S3BucketB40BB072',
Key: 'AssetParameters2435996be08703cd3819e249890abb41cc0860324e5cfe1b5945704934db7101S3VersionKey4F3F9A7F',
Bucket: 'AssetParametersf252aaab8e8ad001500875f428fe421863a979c5c1d7af8e9a1d9598d51fd23dS3BucketABC3C276',
Key: 'AssetParametersf252aaab8e8ad001500875f428fe421863a979c5c1d7af8e9a1d9598d51fd23dS3VersionKeyDA9A3166',
};

// configureWorker.ps1
Expand Down