Create an S3 bucket from https://s3.console.aws.amazon.com/s3/home?region=eu-west-1. We are using EU (Ireland) as our default region for this recipe. PNDA applications will be hosted in this bucket. Replace the pnda-apps with the name of your S3 bucket. Since the bucket names are shared across all the users in the region, you may not be able to use pnda-apps as your Bucket name as it would already have been used by someone:
# S3 container to use for PNDA application packages PNDA_APPS_CONTAINER: pnda-apps
Create a key from https://console.aws.amazon.com/iam/home?#/security_credential.
Don't forget to download the key (rootkey.csv):
Open the rootkey.csv and replace the following values in pnda_env.yaml. These values appear three times. Make sure to replace all of them accordingly:
AWS_ACCESS_KEY_ID: xxxx AWS_SECRET_ACCESS_KEY: xxxx
Replace the value of PNDA_ARCHIVE_CONTAINER to something else (more representative and long enough to be unique). However, this bucket will be auto-created.
Create an SSH Key pair name named key (https://eu-west-1.console.aws.amazon.com/ec2/v2/home?region=eu-west-1#KeyPairs:sort=keyName). Download and save the private key, key.pem.
Configure the dependencies and AWS templates:
$ sh 22_5_pnda_aws_setup.sh #!/bin/bash ############################################### # Python Network Programming Cookbook, Second Edition -- Chapter - 13 ############################################### # Clone the Platform Salt git clone https://github.com/pndaproject/platform-salt.git cd platform-salt git checkout release/3.4.1 cd .. # Clone the PNDA AWS Template latest release tag git clone [email protected]:pndaproject/pnda-aws-templates.git cd pnda-aws-templates git checkout release/3.4.1 # Copy the sample pnda_env.yaml to the project after modifying as in the recipe. cp ../pnda_env.yaml pnda_env.yaml # Install Dependencies cd cli sudo pip install -r requirements.txt
Now you can create PNDA distribution from the PNDA repository by following the scripts in the mirror directory. Execute these commands from your web server:
$ git clone [email protected]:pndaproject/pnda.git $ sudo su $ cd pnda/mirror $ ./create_mirror.sh
Once the mirror build is complete, move the built folders inside the mirror-dist folder (mirror_anaconda, mirror_cloudera, and mirror_misc) to a folder of your choice (we assume the folder name to be packages). Now you have mirrored PNDA to your web server location. Change the following URI to indicate this publicly accessible mirror from your site:
pnda_component_packages: # HTTP server containing the compiled binary packages for
the components # required to provision PNDA PACKAGES_SERVER_URI: http://x.x.x.x/packages
You may even host this inside an EC2 instance after installing a web server such as Apache2. In that case, you will have a packages server URI similar to, http://ec2-34-253-229-120.eu-west-1.compute.amazonaws.com/packages/.