This project will deploy G4 EC2 windows instance. The instance is running NICEDCV server and is bootstrapped with following applications and drivers:
- NVIDIA gaming drivers for G4 instances
- Steam app
- Parsec app
- Google Chrome
- 7Zip
- AWSCLI
The following dependencies must be installed:
- awscli
- Python >=3.8 and pip (Local Development only)
- virtualenv (Local Development only)
As the solution is using Lambda
function, the code needs to be zipped and uploaded to S3 bucket. The Makefile
will install lambda libraries, package the template to S3 bucket and finally deploy the CloudFormation stack.
-
Set the env variables
BUCKET_NAME="" AWS_REGION="" KEY_PAIR_NAME=""
-
Create S3 bucket
aws s3 mb s3://${BUCKET_NAME} --region ${AWS_REGION}
-
Create Amazon EC2 key pair Specify the location where to store pem file after
>
aws ec2 create-key-pair --key-name ${KEY_PAIR_NAME} --query 'KeyMaterial' --output text > ~/Downloads/${KEY_PAIR_NAME}.pem --region ${AWS_REGION}
-
Set the permission of the
.pem
file to read onlychmod 400 ~/Downloads/${KEY_PAIR_NAME}.pem
-
Create a
.custom.mk
file and populate it with your own valuescp .custom.mk.example .custom.mk
Variable Label Example Description AWS_REGION eu-west-2 The AWS region to deploy the solution to BUCKET_NAME my-unique-bucket-name Use the same value from step above STACK_NAME GamingBox The name of the stack GAMING_BOX_INSTANCE_TYPE g4dn.xlarge The type of the instance from a G4 family KEY_PAIR MyKeyPair The name of the KeyPair created above ON_PREM_IP 0.0.0.0/0 CIDR annotation of your home IPv4 address -
Deploy the stack
make deploy
-
Go to AWS console and wait for the stack to complete
-
Navigate to the EC2 console, select the Gaming instance and click on Connect
-
Note down the Public DNS, User name and Password (you may have to wait a few minutes for the password to become available)
- Get NICE DCV Client from https://docs.aws.amazon.com/dcv/latest/userguide/client.html
- Connect via DCV client, providing login details noted above
[TODO]
- Architecture diagram
- Description how lambda will create snapshot and AMI
[TODO]
- start the game box using Launch Configuration and AMI created by lambda function
start-gaming-box -r eu-west-2 -l lt-0xxxxxxx -v 1 -i g4dn.xlarge
- parameters
start_server.sh [OPTION] -r; AWS Region (default: eu-west-1) -l; Set Launch Template ID (required) -v; Launch template version (default: 1) -i; Instance Type (default: gdn.4xlarge) -h; Help
This section details how to run the solution locally and deploy your code changes from the command line.
- Install the extra prerequisites for development.
- Follow the steps 1. to 5. from Deploy the CloudFormation Stack
- Initialize the local environment
make init
- Activate
virtualenv
environment.source venv/bin/activate
The following command will run pre-commit
tests. This should be run before every new commit.
make test
This command will delete the virtual environment and all installed packages install via make init
make clean
Below command will delete deployed stack
make delete