Skip to content

aws-samples/nimblestudio-auto-workstation-scheduler

Nimble Studio Automated Workstation Scheduler

Summary

This example deploys a complete stack which automates the launch of Nimble Studio streaming sessions on behalf of users.

  • The AWS CDK is used for infrastructure-as-code and deployment.
  • Streaming sessions will be launched for users within an AWS Nimble Studio

Prerequisites

Nimble Studio

This project requires that you have already have an AWS Nimble Studio created. The studio should have users and launch profiles active. Sessions for users and associated launch profiles will be configured to be launched automatically through deployment of this project.

Git

Python 3.x

AWS

Setup

First, clone the repository to a local working directory:

git clone https://github.com/aws-samples/nimblestudio-auto-workstation-scheduler.git

Navigate into the project directory:

cd nimblestudio-auto-workstation-scheduler

This project is set up like a standard Python project. The initialization process also creates a virtualenv within this project, stored under the .venv directory. To create the virtualenv it assumes that there is a python3 (or python for Windows) executable in your path with access to the venv package. If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv manually.

To manually create a virtualenv on MacOS and Linux:

$ python3 -m venv .venv

After the init process completes and the virtualenv is created, you can use the following step to activate your virtualenv.

$ source .venv/bin/activate

If you are a Windows platform, you would activate the virtualenv like this:

% .venv\Scripts\activate.bat

Once the virtualenv is activated, you can install the required dependencies.

$ pip install -r requirements.txt

Deploy

Terminal

All deployment commands must be executed inside the nimblestudio-auto-workstation-scheduler folder, navigate there if you haven't already done so.

cd nimblestudio-auto-workstation-scheduler

Set the environment variables for the app: CDK_DEFAULT_ACCOUNT, CDK_DEFAULT_REGION.

Example:

CDK_DEFAULT_ACCOUNT=123456789012
CDK_DEFAULT_REGION=us-west-2

CDK Bootstrap Environment

This sample uses features of the AWS CDK that require you to Bootstrap your environment (a combination of an AWS account and region). The sample is configured to use us-west-2 (Oregon), so you will just need to replace the placeholder in the below command with your AWS account number.

cdk bootstrap aws://ACCOUNT-NUMBER-1/us-west-2

NimbleStudioAutomatedWorkstation Stack

  1. Deploy the project using the following command in the root of the NimbleStudioAutomatedWorkstation folder
cdk deploy NimbleStudioAutoWorkstationSchedulerStack

Update Configuration

To update the Automated Workstation Launch Configuration, see the README located at scripts/README.md and utilize the included helper scripts.

Usage Notes

The Nimble Studio Automated Workstation Scheduler will attempt to launch sessions for studio users based on configuration.

Specific configuration can be disabled for users, which will prevent the scheduler from attempting to launch those sessions. Additionally, the auto launcher can be entirely disabled. See the README located at scripts/README.md for details on how to disable the scheduler or specific config.

It is recommended to disable the Nimble Studio Automated Workstation Scheduler before executing any Studio updates with Studio Builder.

Development

To add additional dependencies, for example other CDK libraries, just add them to your setup.py file and rerun the pip install -r requirements.txt command.

Useful commands

  • cdk ls list all stacks in the app
  • cdk synth emits the synthesized CloudFormation template
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk docs open CDK documentation

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Dependencies

About

Sample AWS CDK application for creating an automated streaming workstation launcher for Amazon Nimble Studio.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published