View a markdown version of this page

Connectez des flottes gérées par des services à un serveur de licences personnalisé - Deadline Cloud

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

Connectez des flottes gérées par des services à un serveur de licences personnalisé

Vous pouvez utiliser votre propre serveur de licences pour l'utiliser avec une flotte gérée par le service Deadline Cloud. Pour apporter votre propre licence, vous pouvez configurer un serveur de licences à l'aide d'un environnement de file d'attente dans votre parc de serveurs. Pour configurer votre serveur de licences, vous devez déjà disposer d'une batterie de serveurs et d'une file d'attente.

Service-managed les employés de la flotte travaillent dans une infrastructure qui AWS gère, en dehors de votre VPC, de manière à accéder à un serveur de licences de l'une des trois manières suivantes :

  • Par le biais d'un point de terminaison de ressources VPC. Les travailleurs se connectent à un serveur de licences de votre VPC via VPC Lattice à l'aide d'un nom de domaine privé, sans environnement de file d'attente ni redirection de port. Pour les étapes de configuration, consultezConnectez les ressources VPC à votre SMF à l'aide de points de terminaison de ressources VPC. Définissez la variable d'environnement de licence de l'application sur le nom de domaine du point de terminaison de la ressource de la même manière que pour une adresse de serveur dansÉtape 3 : connecter une application de rendu à un terminal.

  • Par le biais de la redirection de port Amazon EC2 Systems Manager (SSM). Un environnement de file d'attente transfère les ports de licence de chaque travailleur vers une instance Amazon EC2 de votre compte qui héberge le serveur de licences ou qui transmet le trafic par proxy à celui-ci. Le reste de cette page couvre cette option.

  • Directement sur Internet. Vos employés obtiennent une licence auprès du serveur de licences du fournisseur du logiciel via Internet.

Grâce aux options de point de terminaison des ressources et de redirection de port, il n'est pas nécessaire que le serveur de licences se trouve dans le même VPC ou compte que la passerelle de ressources ou l'instance proxy. La passerelle ou le proxy n'a besoin que d'un accès réseau au serveur, par exemple via le peering VPC, une passerelle de transit ou une connexion VPN.

En suivant les instructions suivantes, vous pouvez utiliser SSM pour transférer les ports d'une instance de travail vers votre serveur de licences ou votre instance proxy. Dans cet exemple, si votre serveur de licences n'est pas en mesure de fournir de licence, les licences basées sur l'utilisation de Deadline Cloud sont utilisées comme solution de rechange. Supprimez les sections qui ne s'appliquent pas à votre pipeline ou aux produits pour lesquels vous ne souhaitez pas utiliser de licences basées sur l'utilisation après avoir épuisé vos licences.

Étape 1 : Configuration de l'environnement de file d'attente

Vous pouvez configurer un environnement de file d'attente dans votre file d'attente pour accéder à votre serveur de licences. Tout d'abord, assurez-vous que vous disposez d'une AWS instance configurée avec un accès au serveur de licences à l'aide de l'une des méthodes suivantes :

  • Serveur de licences : l'instance héberge directement les serveurs de licences.

  • Proxy de licence : l'instance dispose d'un accès réseau au serveur de licences et transmet les ports du serveur de licences au serveur de licences. Pour plus d'informations sur la configuration d'une instance de proxy de licence, consultezÉtape 2 : (Facultatif) Configuration de l'instance proxy de licence.

Pour plus d'informations sur la configuration des variables d'environnement de licence, consultezÉtape 3 : connecter une application de rendu à un terminal. Pour une configuration de serveur de licences personnalisée, l'adresse du serveur de licences reste localhost au lieu du point de terminaison Amazon VPC.

Pour ajouter les autorisations requises au rôle de file d'attente
  1. Depuis la console Deadline Cloud, choisissez Accéder au tableau de bord.

  2. Dans le tableau de bord, sélectionnez la ferme, puis la file d'attente que vous souhaitez configurer.

  3. Dans Détails de la file d'attente > Rôle de service, sélectionnez le rôle.

  4. Choisissez Ajouter une autorisation, puis choisissez Créer une politique en ligne.

  5. Sélectionnez l'éditeur de règles JSON, puis copiez et collez le texte suivant dans l'éditeur.

    JSON
    { "Version":"2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ssm:us-east-1::document/AWS-StartPortForwardingSession", "arn:aws:ec2:us-east-1:111122223333:instance/instance_id" ] } ] }
  6. Avant d'enregistrer la nouvelle politique, remplacez les valeurs suivantes dans le texte de la stratégie :

    • Remplacez region par la AWS région où se trouve votre ferme

    • Remplacez-le instance_id par l'ID d'instance du serveur de licences ou de l'instance proxy que vous utilisez

    • account_idRemplacez-le par le numéro de AWS compte contenant votre ferme

  7. Choisissez Suivant.

  8. Pour le nom de la politique, entrezLicenseForwarding.

  9. Choisissez Créer une politique pour enregistrer vos modifications et créer la politique avec les autorisations requises.

Pour ajouter un nouvel environnement de file d'attente à la file
  1. Depuis la console Deadline Cloud, choisissez Accéder au tableau de bord si ce n'est pas déjà fait.

  2. Dans le tableau de bord, sélectionnez la ferme, puis la file d'attente que vous souhaitez configurer.

  3. Choisissez Environnements de file d'attente > Actions > Créer un nouveau avec YAML.

  4. Copiez et collez le texte suivant dans l'éditeur de script YAML.

    Windows
    specificationVersion: "environment-2023-09" parameterDefinitions: - name: LicenseInstanceId type: STRING description: > The Instance ID of the license server/proxy instance default: "" - name: LicenseInstanceRegion type: STRING description: > The region containing this farm default: "" - name: LicensePorts type: STRING description: > Comma-separated list of ports to be forwarded to the license server/proxy instance. Example: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" default: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" environment: name: BYOL License Forwarding variables: example_LICENSE: 2701@localhost script: actions: onEnter: command: bash args: [ "{{Env.File.Enter}}" ] onExit: command: bash args: [ "{{Env.File.Exit}}" ] embeddedFiles: - name: Enter type: TEXT runnable: True data: | curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/SessionManagerPlugin.zip" -o "{{Session.WorkingDirectory}}/ssm-plugin.zip" powershell -Command "Expand-Archive -Path '{{Session.WorkingDirectory}}/ssm-plugin.zip' -DestinationPath '{{Session.WorkingDirectory}}/ssm-plugin' -Force; Expand-Archive -Path '{{Session.WorkingDirectory}}/ssm-plugin/package.zip' -DestinationPath '{{Session.WorkingDirectory}}/ssm-plugin/package' -Force" conda activate python "{{Env.File.StartSession}}" "{{Session.WorkingDirectory}}/ssm-plugin/package/bin/session-manager-plugin.exe" - name: Exit type: TEXT runnable: True data: | echo Killing SSM Manager Plugin PIDs: $BYOL_SSM_PIDS for pid in ${BYOL_SSM_PIDS//,/ }; do kill $pid; done - name: StartSession type: TEXT data: | import boto3 import json import subprocess import sys import os import tempfile instance_id = "{{Param.LicenseInstanceId}}" region = "{{Param.LicenseInstanceRegion}}" license_ports_list = "{{Param.LicensePorts}}".split(",") ssm_client = boto3.client("ssm", region_name=region) pids = [] for port in license_ports_list: session_response = ssm_client.start_session( Target=instance_id, DocumentName="AWS-StartPortForwardingSession", Parameters={"portNumber": [port], "localPortNumber": [port]} ) cmd = [ sys.argv[1], json.dumps(session_response), region, "StartSession", "", json.dumps({"Target": instance_id}), f"https://ssm.{region}.amazonaws.com" ] process = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) pids.append(process.pid) print(f"SSM Port Forwarding Session started for port {port}") print(f"openjd_env: BYOL_SSM_PIDS={','.join(str(pid) for pid in pids)}") # Enabling UBL after the BYOL has run out requires prepending the BYOL configuration to the existing license setup # Remove the sections that do not apply to your pipeline, or you do not want to use UBL after exhausting the BYOL licenses. # The port numbers used may not match what your license server is serving. # Arnold os.environ["ADSKFLEX_LICENSE_FILE"] = f"2701@localhost;{os.environ.get('ADSKFLEX_LICENSE_FILE', '')}" print(f"openjd_env: ADSKFLEX_LICENSE_FILE={os.environ['ADSKFLEX_LICENSE_FILE']}") # Cinema4D os.environ["g_licenseServerRLM"] = f"localhost:7057;{os.environ.get('g_licenseServerRLM', '')}" print(f"openjd_env: g_licenseServerRLM={os.environ['g_licenseServerRLM']}") # Nuke os.environ["foundry_LICENSE"] = f"6101@localhost;{os.environ.get('foundry_LICENSE', '')}" print(f"openjd_env: foundry_LICENSE={os.environ['foundry_LICENSE']}") # SideFX os.environ["SESI_LMHOST"] = f"localhost:1715;{os.environ.get('SESI_LMHOST', '')}" print(f"openjd_env: SESI_LMHOST={os.environ['SESI_LMHOST']}") # Redshift and Red Giant os.environ["redshift_LICENSE"] = f"7054@localhost;7055@localhost;{os.environ.get('redshift_LICENSE', '')}" print(f"openjd_env: redshift_LICENSE={os.environ['redshift_LICENSE']}") # V-Ray doesn't support multiple license servers in a single environment variable # See https://documentation.chaos.com/space/LIC5/125050770/Sharing+a+License+Configuration+in+a+Network vray_license = os.environ.get('VRAY_AUTH_CLIENT_SETTINGS', '') xml_content = """<VRLClient> <LicServer> <Host>localhost</Host> <Port>30304</Port>""" if vray_license and vray_license.startswith('licset://'): server_parts = vray_license.removeprefix('licset://').split(':') if len(server_parts) >= 2: xml_content += f""" <Host1>{server_parts[0]}</Host1> <Port1>{server_parts[1]}</Port1>""" xml_content += """ <User></User> <Pass></Pass> </LicServer> </VRLClient>""" temp_dir = tempfile.gettempdir() xml_path = os.path.join(temp_dir, 'vrlclient.xml') with open(xml_path, 'w') as f: f.write(xml_content) os.environ["VRAY_AUTH_CLIENT_FILE_PATH"] = temp_dir print(f"openjd_env: VRAY_AUTH_CLIENT_FILE_PATH={os.environ['VRAY_AUTH_CLIENT_FILE_PATH']}") # Clear the existing VRAY_AUTH_CLIENT_SETTINGS so only the vrlclient.xml file is used. os.environ["VRAY_AUTH_CLIENT_SETTINGS"] = '' print(f"openjd_env: VRAY_AUTH_CLIENT_SETTINGS={os.environ['VRAY_AUTH_CLIENT_SETTINGS']}") # Print out the created xml file's contents print(f"V-Ray configuration file: {xml_path}") with open(xml_path, 'r') as f: print(f"{f.read()}")
    Linux
    specificationVersion: "environment-2023-09" parameterDefinitions: - name: LicenseInstanceId type: STRING description: > The Instance ID of the license server/proxy instance default: "" - name: LicenseInstanceRegion type: STRING description: > The region containing this farm default: "" - name: LicensePorts type: STRING description: > Comma-separated list of ports to be forwarded to the license server/proxy instance. Example: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" default: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" environment: name: BYOL License Forwarding variables: example_LICENSE: 2701@localhost script: actions: onEnter: command: bash args: [ "{{Env.File.Enter}}" ] onExit: command: bash args: [ "{{Env.File.Exit}}" ] embeddedFiles: - name: Enter type: TEXT runnable: True data: | curl https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm -Ls | rpm2cpio - | cpio -iv --to-stdout ./usr/local/sessionmanagerplugin/bin/session-manager-plugin > {{Session.WorkingDirectory}}/session-manager-plugin chmod +x {{Session.WorkingDirectory}}/session-manager-plugin conda activate python {{Env.File.StartSession}} {{Session.WorkingDirectory}}/session-manager-plugin - name: Exit type: TEXT runnable: True data: | echo Killing SSM Manager Plugin PIDs: $BYOL_SSM_PIDS for pid in ${BYOL_SSM_PIDS//,/ }; do kill $pid; done - name: StartSession type: TEXT data: | import boto3 import json import subprocess import sys import os import tempfile instance_id = "{{Param.LicenseInstanceId}}" region = "{{Param.LicenseInstanceRegion}}" license_ports_list = "{{Param.LicensePorts}}".split(",") ssm_client = boto3.client("ssm", region_name=region) pids = [] for port in license_ports_list: session_response = ssm_client.start_session( Target=instance_id, DocumentName="AWS-StartPortForwardingSession", Parameters={"portNumber": [port], "localPortNumber": [port]} ) cmd = [ sys.argv[1], json.dumps(session_response), region, "StartSession", "", json.dumps({"Target": instance_id}), f"https://ssm.{region}.amazonaws.com" ] process = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) pids.append(process.pid) print(f"SSM Port Forwarding Session started for port {port}") print(f"openjd_env: BYOL_SSM_PIDS={','.join(str(pid) for pid in pids)}") # Enabling UBL after the BYOL has run out requires prepending the BYOL configuration to the existing license setup # Remove the sections that do not apply to your pipeline, or you do not want to use UBL after exhausting the BYOL licenses. # The port numbers used may not match what your license server is serving. # Arnold os.environ["ADSKFLEX_LICENSE_FILE"] = f"2701@localhost:{os.environ.get('ADSKFLEX_LICENSE_FILE', '')}" print(f"openjd_env: ADSKFLEX_LICENSE_FILE={os.environ['ADSKFLEX_LICENSE_FILE']}") # Nuke os.environ["foundry_LICENSE"] = f"6101@localhost:{os.environ.get('foundry_LICENSE', '')}" print(f"openjd_env: foundry_LICENSE={os.environ['foundry_LICENSE']}") # SideFX os.environ["SESI_LMHOST"] = f"localhost:1715;{os.environ.get('SESI_LMHOST', '')}" print(f"openjd_env: SESI_LMHOST={os.environ['SESI_LMHOST']}") # Redshift and Red Giant os.environ["redshift_LICENSE"] = f"7054@localhost:7055@localhost:{os.environ.get('redshift_LICENSE', '')}" print(f"openjd_env: redshift_LICENSE={os.environ['redshift_LICENSE']}") # V-Ray doesn't support multiple license servers in a single environment variable # See https://documentation.chaos.com/space/LIC5/125050770/Sharing+a+License+Configuration+in+a+Network vray_license = os.environ.get('VRAY_AUTH_CLIENT_SETTINGS', '') xml_content = """<VRLClient> <LicServer> <Host>localhost</Host> <Port>30304</Port>""" if vray_license and vray_license.startswith('licset://'): server_parts = vray_license.removeprefix('licset://').split(':') if len(server_parts) >= 2: xml_content += f""" <Host1>{server_parts[0]}</Host1> <Port1>{server_parts[1]}</Port1>""" xml_content += """ <User></User> <Pass></Pass> </LicServer> </VRLClient>""" temp_dir = tempfile.gettempdir() xml_path = os.path.join(temp_dir, 'vrlclient.xml') with open(xml_path, 'w') as f: f.write(xml_content) os.environ["VRAY_AUTH_CLIENT_FILE_PATH"] = temp_dir print(f"openjd_env: VRAY_AUTH_CLIENT_FILE_PATH={os.environ['VRAY_AUTH_CLIENT_FILE_PATH']}") # Clear the existing VRAY_AUTH_CLIENT_SETTINGS so only the vrlclient.xml file is used. os.environ["VRAY_AUTH_CLIENT_SETTINGS"] = '' print(f"openjd_env: VRAY_AUTH_CLIENT_SETTINGS={os.environ['VRAY_AUTH_CLIENT_SETTINGS']}") # Print out the created xml file's contents print(f"V-Ray configuration file: {xml_path}") with open(xml_path, 'r') as f: print(f"{f.read()}")
  5. Avant d'enregistrer l'environnement de file d'attente, apportez les modifications suivantes au texte de l'environnement selon les besoins :

    • Mettez à jour les valeurs par défaut pour les paramètres suivants afin de refléter votre environnement :

      • LicenseInstanceID  : ID d'instance Amazon EC2 de votre serveur de licences ou de votre instance proxy

      • LicenseInstanceRegion— La AWS région dans laquelle se trouve votre ferme

      • LicensePorts— Une liste de ports séparés par des virgules à transmettre au serveur de licences ou à l'instance proxy (par exemple 2700,2701)

    • Si vous souhaitez utiliser les licences basées sur l'utilisation (UBL) une fois que Bring your own license (BYOL) est épuisé, assurez-vous que le port est correct pour votre serveur de licences. Si vous ne souhaitez pas utiliser UBL après avoir épuisé le BYOL, ajoutez toutes les variables d'environnement de licence requises à la section des variables.

      Ces variables doivent diriger les DCC vers localhost sur le port du serveur de licences. Par exemple, si votre serveur de licences Foundry écoute sur le port 6101, vous devez ajouter la variable as. foundry_LICENSE: 6101@localhost

  6. (Facultatif) Vous pouvez laisser la priorité définie sur 0 ou la modifier pour classer différemment la priorité entre plusieurs environnements de files d'attente.

  7. Choisissez Créer un environnement de file d'attente pour enregistrer le nouvel environnement.

    Lorsque l'environnement de file d'attente est défini, les tâches soumises à cette file d'attente récupéreront les licences du serveur de licences configuré.

Étape 2 : (Facultatif) Configuration de l'instance proxy de licence

Au lieu d'utiliser un serveur de licences, vous pouvez utiliser un proxy de licence. Pour créer un proxy de licence, créez une nouvelle instance Amazon Linux 2023 dotée d'un accès réseau au serveur de licences. Si nécessaire, vous pouvez configurer cet accès à l'aide d'une connexion VPN. Pour plus d'informations, consultez la section Connexions VPN dans le guide de l'utilisateur Amazon VPC.

Pour configurer une instance de proxy de licence pour Deadline Cloud, suivez les étapes de cette procédure. Effectuez les étapes de configuration suivantes sur cette nouvelle instance pour permettre le transfert du trafic de licences vers votre serveur de licences

  1. Pour installer le package HAProxy, entrez

    sudo yum install haproxy
  2. Mettez à jour la section Listen License-server du fichier de configuration/etc/haproxy/haproxy.cfg avec les informations suivantes :

    1. Remplacez LicensePort 1 et LicensePort 2 par les numéros de port à transmettre au serveur de licences. Ajoutez ou supprimez des valeurs séparées par des virgules pour tenir compte du nombre de ports requis.

    2. LicenseServerHostRemplacez-le par le nom d'hôte ou l'adresse IP du serveur de licences.

    global log 127.0.0.1 local2 chroot /var/lib/haproxy user haproxy group haproxy daemon defaults timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout http-keep-alive 10s timeout check 10s listen license-server bind *:LicensePort1,*:LicensePort2 server license-server LicenseServerHost
  3. Pour activer et démarrer le service HAProxy, exécutez les commandes suivantes :

    sudo systemctl enable haproxy sudo service haproxy start

Une fois ces étapes terminées, les demandes de licence envoyées à localhost depuis l'environnement de file d'attente de transfert doivent être transmises au serveur de licences spécifié.

Étape 3 : CloudFormation configuration du modèle

Vous pouvez utiliser un CloudFormation modèle pour configurer l'ensemble d'une ferme afin qu'elle utilise vos propres licences.

  1. Modifiez le modèle fourni à l'étape suivante pour ajouter toutes les variables d'environnement de licence requises à la section des variables ci-dessous BYOLQueueEnvironment.

  2. Utilisez le CloudFormation modèle suivant.

    AWSTemplateFormatVersion: 2010-09-09 Description: "Create Deadline Cloud resources for BYOL" Parameters: LicenseInstanceId: Type: AWS::EC2::Instance::Id Description: Instance ID for the license server/proxy instance LicensePorts: Type: String Description: Comma-separated list of ports to forward to the license instance Resources: JobAttachmentBucket: Type: AWS::S3::Bucket Properties: BucketName: !Sub byol-example-ja-bucket-${AWS::AccountId}-${AWS::Region} BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: AES256 Farm: Type: AWS::Deadline::Farm Properties: DisplayName: BYOLFarm QueuePolicy: Type: AWS::IAM::ManagedPolicy Properties: ManagedPolicyName: BYOLQueuePolicy PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - s3:GetObject - s3:PutObject - s3:ListBucket - s3:GetBucketLocation Resource: - !Sub ${JobAttachmentBucket.Arn} - !Sub ${JobAttachmentBucket.Arn}/job-attachments/* Condition: StringEquals: aws:ResourceAccount: !Sub ${AWS::AccountId} - Effect: Allow Action: logs:GetLogEvents Resource: !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/deadline/${Farm.FarmId}/* - Effect: Allow Action: - s3:ListBucket - s3:GetObject Resource: - "*" Condition: ArnLike: s3:DataAccessPointArn: - arn:aws:s3:*:*:accesspoint/deadline-software-* StringEquals: s3:AccessPointNetworkOrigin: VPC BYOLSSMPolicy: Type: AWS::IAM::ManagedPolicy Properties: ManagedPolicyName: BYOLSSMPolicy PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - ssm:StartSession Resource: - !Sub arn:aws:ssm:${AWS::Region}::document/AWS-StartPortForwardingSession - !Sub arn:aws:ec2:${AWS::Region}:${AWS::AccountId}:instance/${LicenseInstanceId} WorkerPolicy: Type: AWS::IAM::ManagedPolicy Properties: ManagedPolicyName: BYOLWorkerPolicy PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - logs:CreateLogStream Resource: !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/deadline/${Farm.FarmId}/* Condition: ForAnyValue:StringEquals: aws:CalledVia: - deadline.amazonaws.com - Effect: Allow Action: - logs:PutLogEvents - logs:GetLogEvents Resource: !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/deadline/${Farm.FarmId}/* QueueRole: Type: AWS::IAM::Role Properties: RoleName: BYOLQueueRole ManagedPolicyArns: - !Ref QueuePolicy - !Ref BYOLSSMPolicy AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - sts:AssumeRole Principal: Service: - credentials.deadline.amazonaws.com - deadline.amazonaws.com Condition: StringEquals: aws:SourceAccount: !Sub ${AWS::AccountId} ArnEquals: aws:SourceArn: !Ref Farm WorkerRole: Type: AWS::IAM::Role Properties: RoleName: BYOLWorkerRole ManagedPolicyArns: - arn:aws:iam::aws:policy/AWSDeadlineCloud-FleetWorker - !Ref WorkerPolicy AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - sts:AssumeRole Principal: Service: credentials.deadline.amazonaws.com Queue: Type: AWS::Deadline::Queue Properties: DisplayName: BYOLQueue FarmId: !GetAtt Farm.FarmId RoleArn: !GetAtt QueueRole.Arn JobRunAsUser: Posix: Group: "" User: "" RunAs: WORKER_AGENT_USER JobAttachmentSettings: RootPrefix: job-attachments S3BucketName: !Ref JobAttachmentBucket Fleet: Type: AWS::Deadline::Fleet Properties: DisplayName: BYOLFleet FarmId: !GetAtt Farm.FarmId MinWorkerCount: 1 MaxWorkerCount: 2 Configuration: ServiceManagedEc2: InstanceCapabilities: VCpuCount: Min: 4 Max: 16 MemoryMiB: Min: 4096 Max: 16384 OsFamily: LINUX CpuArchitectureType: x86_64 InstanceMarketOptions: Type: on-demand RoleArn: !GetAtt WorkerRole.Arn QFA: Type: AWS::Deadline::QueueFleetAssociation Properties: FarmId: !GetAtt Farm.FarmId FleetId: !GetAtt Fleet.FleetId QueueId: !GetAtt Queue.QueueId CondaQueueEnvironment: Type: AWS::Deadline::QueueEnvironment Properties: FarmId: !GetAtt Farm.FarmId Priority: 5 QueueId: !GetAtt Queue.QueueId TemplateType: YAML Template: | specificationVersion: 'environment-2023-09' parameterDefinitions: - name: CondaPackages type: STRING description: > This is a space-separated list of conda package match specifications to install for the job. E.g. "blender=3.6" for a job that renders frames in Blender 3.6. See https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications default: "" userInterface: control: LINE_EDIT label: Conda Packages - name: CondaChannels type: STRING description: > This is a space-separated list of conda channels from which to install packages. Deadline Cloud SMF packages are installed from the "deadline-cloud" channel that is configured by Deadline Cloud. Add "conda-forge" to get packages from the https://conda-forge.org/ community, and "defaults" to get packages from Anaconda Inc (make sure your usage complies with https://www.anaconda.com/terms-of-use). default: "deadline-cloud" userInterface: control: LINE_EDIT label: Conda Channels environment: name: Conda script: actions: onEnter: command: "conda-queue-env-enter" args: ["{{Session.WorkingDirectory}}/.env", "--packages", "{{Param.CondaPackages}}", "--channels", "{{Param.CondaChannels}}"] onExit: command: "conda-queue-env-exit" BYOLQueueEnvironment: Type: AWS::Deadline::QueueEnvironment Properties: FarmId: !GetAtt Farm.FarmId Priority: 10 QueueId: !GetAtt Queue.QueueId TemplateType: YAML Template: | specificationVersion: "environment-2023-09" parameterDefinitions: - name: LicenseInstanceId type: STRING description: > The Instance ID of the license server/proxy instance default: "" - name: LicenseInstanceRegion type: STRING description: > The region containing this farm default: "" - name: LicensePorts type: STRING description: > Comma-separated list of ports to be forwarded to the license server/proxy instance. Example: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" default: "2701,2702,7075,2703,6101,1715,1716,1717,7054,7055,30304" environment: name: BYOL License Forwarding variables: example_LICENSE: 2701@localhost script: actions: onEnter: command: bash args: [ "{{Env.File.Enter}}" ] onExit: command: bash args: [ "{{Env.File.Exit}}" ] embeddedFiles: - name: Enter type: TEXT runnable: True data: | curl https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm -Ls | rpm2cpio - | cpio -iv --to-stdout ./usr/local/sessionmanagerplugin/bin/session-manager-plugin > {{Session.WorkingDirectory}}/session-manager-plugin chmod +x {{Session.WorkingDirectory}}/session-manager-plugin conda activate python {{Env.File.StartSession}} {{Session.WorkingDirectory}}/session-manager-plugin - name: Exit type: TEXT runnable: True data: | echo Killing SSM Manager Plugin PIDs: $BYOL_SSM_PIDS for pid in ${BYOL_SSM_PIDS//,/ }; do kill $pid; done - name: StartSession type: TEXT data: | import boto3 import json import subprocess import sys import os import tempfile instance_id = "{{Param.LicenseInstanceId}}" region = "{{Param.LicenseInstanceRegion}}" license_ports_list = "{{Param.LicensePorts}}".split(",") ssm_client = boto3.client("ssm", region_name=region) pids = [] for port in license_ports_list: session_response = ssm_client.start_session( Target=instance_id, DocumentName="AWS-StartPortForwardingSession", Parameters={"portNumber": [port], "localPortNumber": [port]} ) cmd = [ sys.argv[1], json.dumps(session_response), region, "StartSession", "", json.dumps({"Target": instance_id}), f"https://ssm.{region}.amazonaws.com" ] process = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) pids.append(process.pid) print(f"SSM Port Forwarding Session started for port {port}") print(f"openjd_env: BYOL_SSM_PIDS={','.join(str(pid) for pid in pids)}") # Enabling UBL after the "bring your own license" (BYOL) has run out requires prepending the BYOL configuration to the existing license setup # Remove the sections that do not apply to your pipeline, or you do not want to use UBL after exhausting the BYOL licenses. # The port numbers used may not match what your license server is serving. # Arnold os.environ["ADSKFLEX_LICENSE_FILE"] = f"2701@localhost:{os.environ.get('ADSKFLEX_LICENSE_FILE', '')}" print(f"openjd_env: ADSKFLEX_LICENSE_FILE={os.environ['ADSKFLEX_LICENSE_FILE']}") # Nuke os.environ["foundry_LICENSE"] = f"6101@localhost:{os.environ.get('foundry_LICENSE', '')}" print(f"openjd_env: foundry_LICENSE={os.environ['foundry_LICENSE']}") # SideFX os.environ["SESI_LMHOST"] = f"localhost:1715;{os.environ.get('SESI_LMHOST', '')}" print(f"openjd_env: SESI_LMHOST={os.environ['SESI_LMHOST']}") # Redshift and Red Giant os.environ["redshift_LICENSE"] = f"7054@localhost:7055@localhost:{os.environ.get('redshift_LICENSE', '')}" print(f"openjd_env: redshift_LICENSE={os.environ['redshift_LICENSE']}") # V-Ray doesn't support multiple license servers in a single environment variable # See https://documentation.chaos.com/space/LIC5/125050770/Sharing+a+License+Configuration+in+a+Network vray_license = os.environ.get('VRAY_AUTH_CLIENT_SETTINGS', '') xml_content = """<VRLClient> <LicServer> <Host>localhost</Host> <Port>30304</Port>""" if vray_license and vray_license.startswith('licset://'): server_parts = vray_license.removeprefix('licset://').split(':') if len(server_parts) >= 2: xml_content += f""" <Host1>{server_parts[0]}</Host1> <Port1>{server_parts[1]}</Port1>""" xml_content += """ <User></User> <Pass></Pass> </LicServer> </VRLClient>""" temp_dir = tempfile.gettempdir() xml_path = os.path.join(temp_dir, 'vrlclient.xml') with open(xml_path, 'w') as f: f.write(xml_content) os.environ["VRAY_AUTH_CLIENT_FILE_PATH"] = temp_dir print(f"openjd_env: VRAY_AUTH_CLIENT_FILE_PATH={os.environ['VRAY_AUTH_CLIENT_FILE_PATH']}") # Clear the existing VRAY_AUTH_CLIENT_SETTINGS so only the vrlclient.xml file is used. os.environ["VRAY_AUTH_CLIENT_SETTINGS"] = '' print(f"openjd_env: VRAY_AUTH_CLIENT_SETTINGS={os.environ['VRAY_AUTH_CLIENT_SETTINGS']}") # Print out the created xml file's contents print(f"V-Ray configuration file: {xml_path}") with open(xml_path, 'r') as f: print(f"{f.read()}")
  3. Lorsque vous déployez le CloudFormation modèle, indiquez les paramètres suivants :

    • Mettez à jour l'LicenseInstanceID avec l'ID d'instance Amazon EC2 de votre serveur de licences ou de votre instance proxy

    • Mettez à jour le LicensePorts avec une liste de ports séparés par des virgules à transmettre au serveur de licences ou à l'instance proxy (par exemple 2700,2701)

    • Ajoutez les variables d'environnement de licence en les remplaçant example_LICENSE: 2700@localhost dans le modèle

  4. Déployez le modèle pour configurer votre ferme avec la fonctionnalité Bring Your Own License.