From 265ce4cefb82a194b0a19b51c93582f1b6c70575 Mon Sep 17 00:00:00 2001 From: Josh Usiskin Date: Mon, 31 Aug 2020 14:42:04 +0000 Subject: [PATCH 1/2] fix(examples): Fix UBL in python example app README - fixes #105 - The python example app README gave instructions for using the TypeScript `UsageBasedLicense` API. Fixed to use the python API. - Also fix up formatting in README markdown for both example app languages --- .../python/README.md | 134 ++++++++++-------- .../ts/README.md | 124 +++++++++------- 2 files changed, 146 insertions(+), 112 deletions(-) diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md index 01b4726cc..75832f2b3 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md @@ -12,66 +12,86 @@ These instructions assume that your working directory is `examples/deadline/All- --- -1. Install the dependencies of the sample app: -```bash -pip install -r requirements.txt -``` -2. Change the value in the `deadline_client_linux_ami_map` variable in `package/config.py` to include the region + AMI ID mapping of your EC2 AMI(s) with Deadline Worker. -```python -# For example, in the us-west-2 region -self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': ' --secret-binary fileb:// -``` -4. The output from the previous step will contain the secret's ARN. Change the value of the `ubl_certificate_secret_arn` variable in `package/config.py` to the secret's ARN: -```python -self.ubl_certificate_secret_arn: str = '' -``` -5. Choose your UBL limits and change the value of the `ubl_licenses` variable in `package/config.py` accordingly: -```python -self.ubl_licenses: List[UsageBasedLicense] = [ (e.g. UsageBasedLicense.forMaya(10))] -``` ---- +1. Install the dependencies of the sample app: -**Note:** The next two steps are optional. You may skip these if you do not need SSH access into your render farm. + ```bash + pip install -r requirements.txt + ``` +2. Change the value in the `deadline_client_linux_ami_map` variable in `package/config.py` to include the region + AMI ID mapping of your EC2 AMI(s) with Deadline Worker. ---- -6. Create an EC2 key pair to give you SSH access to the render farm: -```bash -aws ec2 create-key-pair --key-name -``` + ```python + # For example, in the us-west-2 region + self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': ' --secret-binary fileb:// + ``` +4. The output from the previous step will contain the secret's ARN. Change the value of the `ubl_certificate_secret_arn` variable in `package/config.py` to the secret's ARN: + + ```python + self.ubl_certificate_secret_arn: str = '' + ``` +5. Choose your UBL limits and change the value of the `ubl_licenses` variable in `package/config.py` accordingly. For example: + + ```python + self.ubl_licenses: List[UsageBasedLicense] = [ + # your UBL limits, for example: + # + # up to 10 concurrent Maya licenses used at once + UsageBasedLicense.for_maya(10), + # + # unlimited Arnold licenses + UsageBasedLicense.for_arnold() + ] + ``` + + --- + + **Note:** The next two steps are optional. You may skip these if you do not need SSH access into your render farm. + + --- +6. Create an EC2 key pair to give you SSH access to the render farm: + + ```bash + aws ec2 create-key-pair --key-name + ``` 7. Change the value of the `key_pair_name` variable in `package/config.py` to your value for `` in the previous step:

**Note:** Save the value of the "KeyMaterial" field as a file in a secure location. This is your private key that you can use to SSH into the render farm. -```python -self.key_pair_name: Optional[str] = '' -``` -8. Choose the type of database you would like to deploy and change the value of the `deploy_mongo_db` variable in `package/config.py` accordingly: -```python -# True = MongoDB, False = Amazon DocumentDB -self.deploy_mongo_db: bool = False -``` -9. If you set `deploy_mongo_db` to `True`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `accept_sspl_license` in `package/config.py`: -```python -self.accept_sspl_license: MongoDbSsplLicenseAcceptance = MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL -``` + + ```python + self.key_pair_name: Optional[str] = '' + ``` +8. Choose the type of database you would like to deploy and change the value of the `deploy_mongo_db` variable in `package/config.py` accordingly: + + ```python + # True = MongoDB, False = Amazon DocumentDB + self.deploy_mongo_db: bool = False + ``` +9. If you set `deploy_mongo_db` to `True`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `accept_sspl_license` in `package/config.py`: + + ```python + self.accept_sspl_license: MongoDbSsplLicenseAcceptance = MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL + ``` 10. Stage the Docker recipes for `RenderQueue` and `UBLLicensing`: -```bash -# Set this value to the version of RFDK your application targets -RFDK_VERSION= -# Set this value to the version of AWS Thinkbox Deadline you'd like to deploy to your farm -RFDK_DEADLINE_VERSION= -npx --package=aws-rfdk@${RFDK_VERSION} stage-deadline \ - --deadlineInstallerURI s3://thinkbox-installers/Deadline/${RFDK_DEADLINE_VERSION}/Linux/DeadlineClient-${RFDK_DEADLINE_VERSION}-linux-x64-installer.run \ - --dockerRecipesURI s3://thinkbox-installers/DeadlineDocker/${RFDK_DEADLINE_VERSION}/DeadlineDocker-${RFDK_DEADLINE_VERSION}.tar.gz \ - --output stage -``` + + ```bash + # Set this value to the version of RFDK your application targets + RFDK_VERSION= + # Set this value to the version of AWS Thinkbox Deadline you'd like to deploy to your farm + RFDK_DEADLINE_VERSION= + npx --package=aws-rfdk@${RFDK_VERSION} stage-deadline \ + --deadlineInstallerURI s3://thinkbox-installers/Deadline/${RFDK_DEADLINE_VERSION}/Linux/DeadlineClient-${RFDK_DEADLINE_VERSION}-linux-x64-installer.run \ + --dockerRecipesURI s3://thinkbox-installers/DeadlineDocker/${RFDK_DEADLINE_VERSION}/DeadlineDocker-${RFDK_DEADLINE_VERSION}.tar.gz \ + --output stage + ``` 11. Deploy all the stacks in the sample app: -```bash -cdk deploy "*" -``` + + ```bash + cdk deploy "*" + ``` 13. Once you are finished with the sample app, you can tear it down by running: -```bash -cdk destroy "*" -``` \ No newline at end of file + + ```bash + cdk destroy "*" + ``` diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md index ef1705251..484779bda 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md @@ -12,65 +12,79 @@ These instructions assume that your working directory is `examples/deadline/All- --- -1. Install the dependencies of the sample app: -``` -yarn install -``` -2. Change the value in the `deadlineClientLinuxAmiMap` variable in `bin/config.ts` to include the region + AMI ID mapping of your EC2 AMI(s) with Deadline Worker. -```ts -// For example, in the us-west-2 region -public readonly deadlineClientLinuxAmiMap: Record = { - ['us-west-2']: '', - // ... - }; -``` -3. Create a binary secret in [SecretsManager](https://aws.amazon.com/secrets-manager/) that contains your [Usage-Based Licensing](https://docs.thinkboxsoftware.com/products/deadline/10.1/1_User%20Manual/manual/aws-portal/licensing-setup.html?highlight=usage%20based%20licensing) certificates in a `.zip` file: -``` -aws secretsmanager create-secret --name --secret-binary fileb:// -``` -4. The output from the previous step will contain the secret's ARN. Change the value of the `ublCertificatesSecretArn` variable in `bin/config.ts` to the secret's ARN: -```ts -public readonly ublCertificatesSecretArn: string = ''; -``` -5. Choose your UBL limits and change the value of the `ublLicenses` variable in `bin/config.ts` accordingly: -```ts -public readonly ublLicenses: UsageBasedLicense[] = [ /* (e.g. UsageBasedLicense.forMaya(10)) */ ]; -``` ---- +1. Install the dependencies of the sample app: -**Note:** The next two steps are optional. You may skip these if you do not need SSH access into your render farm. + ``` + yarn install + ``` +2. Change the value in the `deadlineClientLinuxAmiMap` variable in `bin/config.ts` to include the region + AMI ID mapping of your EC2 AMI(s) with Deadline Worker. ---- -6. Create an EC2 key pair to give you SSH access to the render farm: -``` -aws ec2 create-key-pair --key-name -``` + ```ts + // For example, in the us-west-2 region + public readonly deadlineClientLinuxAmiMap: Record = { + ['us-west-2']: '', + // ... + }; + ``` +3. Create a binary secret in [SecretsManager](https://aws.amazon.com/secrets-manager/) that contains your [Usage-Based Licensing](https://docs.thinkboxsoftware.com/products/deadline/10.1/1_User%20Manual/manual/aws-portal/licensing-setup.html?highlight=usage%20based%20licensing) certificates in a `.zip` file: + + ``` + aws secretsmanager create-secret --name --secret-binary fileb:// + ``` +4. The output from the previous step will contain the secret's ARN. Change the value of the `ublCertificatesSecretArn` variable in `bin/config.ts` to the secret's ARN: + + ```ts + public readonly ublCertificatesSecretArn: string = ''; + ``` +5. Choose your UBL limits and change the value of the `ublLicenses` variable in `bin/config.ts` accordingly: + + ```ts + public readonly ublLicenses: UsageBasedLicense[] = [ /* (e.g. UsageBasedLicense.forMaya(10)) */ ]; + ``` + + --- + + **Note:** The next two steps are optional. You may skip these if you do not need SSH access into your render farm. + + --- +6. Create an EC2 key pair to give you SSH access to the render farm: + + ``` + aws ec2 create-key-pair --key-name + ``` 7. Change the value of the `keyPairName` variable in `bin/config.ts` to your value for `` in the previous step:

**Note:** Save the value of the "KeyMaterial" field as a file in a secure location. This is your private key that you can use to SSH into the render farm. -```ts -public readonly keyPairName: string = ''; -``` -8. Choose the type of database you would like to deploy and change the value of the `deployMongoDB` variable in `bin/config.ts` accordingly: -```ts -// true = MongoDB, false = Amazon DocumentDB -public readonly deployMongoDB: boolean = false; -``` -9. If you set `deployMongoDB` to `true`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `acceptSsplLicense` in `bin/config.ts`: -```ts -public readonly acceptSsplLicense: MongoDbSsplLicenseAcceptance = ; -``` + + ```ts + public readonly keyPairName: string = ''; + ``` +8. Choose the type of database you would like to deploy and change the value of the `deployMongoDB` variable in `bin/config.ts` accordingly: + + ```ts + // true = MongoDB, false = Amazon DocumentDB + public readonly deployMongoDB: boolean = false; + ``` +9. If you set `deployMongoDB` to `true`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `acceptSsplLicense` in `bin/config.ts`: + + ```ts + public readonly acceptSsplLicense: MongoDbSsplLicenseAcceptance = ; + ``` 10. Modify the `deadline_ver` field in the `config` block of `package.json` as desired, then stage the Docker recipes for `RenderQueue` and `UBLLicensing`: -``` -yarn stage -``` + + ``` + yarn stage + ``` 11. Build the sample app: -``` -yarn build -``` + + ``` + yarn build + ``` 12. Deploy all the stacks in the sample app: -``` -cdk deploy "*" -``` + + ``` + cdk deploy "*" + ``` 13. Once you are finished with the sample app, you can tear it down by running: -``` -cdk destroy "*" -``` + + ``` + cdk destroy "*" + ``` From 5fce32ffac7c82ae2827f77d69bfa3311ac17cc3 Mon Sep 17 00:00:00 2001 From: Josh Usiskin Date: Tue, 8 Sep 2020 16:31:46 +0000 Subject: [PATCH 2/2] fix(examples): clarify sspl and unify python and ts examples --- .../python/README.md | 25 +++++++++++------ .../ts/README.md | 27 ++++++++++++++----- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md index 75832f2b3..0d3e4f8a6 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/README.md @@ -21,7 +21,9 @@ These instructions assume that your working directory is `examples/deadline/All- ```python # For example, in the us-west-2 region - self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': '' + } ``` 3. Create a binary secret in [SecretsManager](https://aws.amazon.com/secrets-manager/) that contains your [Usage-Based Licensing](https://docs.thinkboxsoftware.com/products/deadline/10.1/1_User%20Manual/manual/aws-portal/licensing-setup.html?highlight=usage%20based%20licensing) certificates in a `.zip` file: @@ -38,10 +40,10 @@ These instructions assume that your working directory is `examples/deadline/All- ```python self.ubl_licenses: List[UsageBasedLicense] = [ # your UBL limits, for example: - # + # up to 10 concurrent Maya licenses used at once UsageBasedLicense.for_maya(10), - # + # unlimited Arnold licenses UsageBasedLicense.for_arnold() ] @@ -57,12 +59,16 @@ These instructions assume that your working directory is `examples/deadline/All- ```bash aws ec2 create-key-pair --key-name ``` -7. Change the value of the `key_pair_name` variable in `package/config.py` to your value for `` in the previous step:

**Note:** Save the value of the "KeyMaterial" field as a file in a secure location. This is your private key that you can use to SSH into the render farm. +7. Change the value of the `key_pair_name` variable in `package/config.py` to your value for `` in the previous step: + + **Note:** Save the value of the `"KeyMaterial"` field as a file in a secure location. This is your private key that you can use to SSH into the render farm. ```python self.key_pair_name: Optional[str] = '' ``` -8. Choose the type of database you would like to deploy and change the value of the `deploy_mongo_db` variable in `package/config.py` accordingly: +8. Choose the type of database you would like to deploy (AWS DocumentDB or MongoDB). + If you would like to use MongoDB, you will need to accept the Mongo SSPL (see next step). + Once you've decided on a database type, change the value of the `deploy_mongo_db` variable in `package/config.py` accordingly: ```python # True = MongoDB, False = Amazon DocumentDB @@ -71,15 +77,18 @@ These instructions assume that your working directory is `examples/deadline/All- 9. If you set `deploy_mongo_db` to `True`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `accept_sspl_license` in `package/config.py`: ```python + # To accept the MongoDB SSPL, change from USER_REJECTS_SSPL to USER_ACCEPTS_SSPL self.accept_sspl_license: MongoDbSsplLicenseAcceptance = MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL ``` 10. Stage the Docker recipes for `RenderQueue` and `UBLLicensing`: ```bash # Set this value to the version of RFDK your application targets - RFDK_VERSION= - # Set this value to the version of AWS Thinkbox Deadline you'd like to deploy to your farm - RFDK_DEADLINE_VERSION= + RFDK_VERSION= + + # Set this value to the version of AWS Thinkbox Deadline you'd like to deploy to your farm. Deadline 10.1.9 and up are supported. + RFDK_DEADLINE_VERSION= + npx --package=aws-rfdk@${RFDK_VERSION} stage-deadline \ --deadlineInstallerURI s3://thinkbox-installers/Deadline/${RFDK_DEADLINE_VERSION}/Linux/DeadlineClient-${RFDK_DEADLINE_VERSION}-linux-x64-installer.run \ --dockerRecipesURI s3://thinkbox-installers/DeadlineDocker/${RFDK_DEADLINE_VERSION}/DeadlineDocker-${RFDK_DEADLINE_VERSION}.tar.gz \ diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md index 484779bda..6f86fe685 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/README.md @@ -29,17 +29,25 @@ These instructions assume that your working directory is `examples/deadline/All- 3. Create a binary secret in [SecretsManager](https://aws.amazon.com/secrets-manager/) that contains your [Usage-Based Licensing](https://docs.thinkboxsoftware.com/products/deadline/10.1/1_User%20Manual/manual/aws-portal/licensing-setup.html?highlight=usage%20based%20licensing) certificates in a `.zip` file: ``` - aws secretsmanager create-secret --name --secret-binary fileb:// + aws secretsmanager create-secret --name --secret-binary fileb:// ``` 4. The output from the previous step will contain the secret's ARN. Change the value of the `ublCertificatesSecretArn` variable in `bin/config.ts` to the secret's ARN: ```ts public readonly ublCertificatesSecretArn: string = ''; ``` -5. Choose your UBL limits and change the value of the `ublLicenses` variable in `bin/config.ts` accordingly: +5. Choose your UBL limits and change the value of the `ublLicenses` variable in `bin/config.ts` accordingly. For example: ```ts - public readonly ublLicenses: UsageBasedLicense[] = [ /* (e.g. UsageBasedLicense.forMaya(10)) */ ]; + public readonly ublLicenses: UsageBasedLicense[] = [ + // your UBL limits, for example: + + // up to 10 concurrent Maya licenses used at once + UsageBasedLicense.forMaya(10), + + // unlimited Arnold licenses + UsageBasedLicense.forArnold() + ]; ``` --- @@ -52,12 +60,16 @@ These instructions assume that your working directory is `examples/deadline/All- ``` aws ec2 create-key-pair --key-name ``` -7. Change the value of the `keyPairName` variable in `bin/config.ts` to your value for `` in the previous step:

**Note:** Save the value of the "KeyMaterial" field as a file in a secure location. This is your private key that you can use to SSH into the render farm. +7. Change the value of the `keyPairName` variable in `bin/config.ts` to your value for `` in the previous step: + + **Note:** Save the value of the `"KeyMaterial"` field as a file in a secure location. This is your private key that you can use to SSH into the render farm. ```ts public readonly keyPairName: string = ''; ``` -8. Choose the type of database you would like to deploy and change the value of the `deployMongoDB` variable in `bin/config.ts` accordingly: +8. Choose the type of database you would like to deploy (AWS DocumentDB or MongoDB). + If you would like to use MongoDB, you will need to accept the Mongo SSPL (see next step). + Once you've decided on a database type, change the value of the `deployMongoDB` variable in `bin/config.ts` accordingly: ```ts // true = MongoDB, false = Amazon DocumentDB @@ -66,9 +78,10 @@ These instructions assume that your working directory is `examples/deadline/All- 9. If you set `deployMongoDB` to `true`, then you must accept the [SSPL license](https://www.mongodb.com/licensing/server-side-public-license) to successfully deploy MongoDB. To do so, change the value of `acceptSsplLicense` in `bin/config.ts`: ```ts - public readonly acceptSsplLicense: MongoDbSsplLicenseAcceptance = ; + // To accept the MongoDB SSPL, change from USER_REJECTS_SSPL to USER_ACCEPTS_SSPL + public readonly acceptSsplLicense: MongoDbSsplLicenseAcceptance = MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL; ``` -10. Modify the `deadline_ver` field in the `config` block of `package.json` as desired, then stage the Docker recipes for `RenderQueue` and `UBLLicensing`: +10. Modify the `deadline_ver` field in the `config` block of `package.json` as desired (Deadline 10.1.9 and up are supported), then stage the Docker recipes for `RenderQueue` and `UBLLicensing`: ``` yarn stage