Changes between Version 35 and Version 36 of CloudPlugin


Ignore:
Timestamp:
Apr 26, 2011, 1:06:19 AM (4 years ago)
Author:
robguttman
Comment:

added info on rds, commands, environments

Legend:

Unmodified
Added
Removed
Modified
  • CloudPlugin

    v35 v36  
    33= Orchestrates AWS cloud resources using boto and pychef =
    44
    5 ''This fairly new plugin is now being put through its paces at [http://www.juju.com juju.com].  I welcome others to try it out and submit tickets for bugs and new features. - robguttman, 7 Feb 2011''
    6 
    7 '' '''UPDATE:''' The latest version (0.2) now launches and bootstraps new instances in a separate, spawned process which survives Apache timeouts and restarts.  See below for more details and screenshot. - robguttman, 13 Mar 2011''
     5''This fairly new plugin is being put through its paces at [http://www.juju.com juju.com].  I welcome others to try it out and submit tickets for bugs and new features. - robguttman, 7 Feb 2011''
     6
     7'' '''UPDATE:''' Latest version supports RDS instances, executing remote commands, and push-button deployments.  More details in notes below. - robguttman, 25 Apr 2011''
    88
    99== Description ==
     
    1212 * Launch an ec2 instance, bootstrap it with chef and apply one or more chef roles
    1313 * Terminate ec2 instances and delete its chef node (and client)
     14 * Execute commands (e.g., deployments) to ec2 instances based on environment or role
    1415
    1516[[Image(instance-grid.png)]]
    1617
    17 There are additional features and quite possibly more to come, but my intention is to keep the scope down to what's needed to orchestrate between AWS and Chef (and not re-implement either the AWS Management Console or the Chef Server webui).
     18There are additional features and quite possibly more to come, but my intention is to keep the scope down to what's needed to orchestrate between AWS and Chef inclusive of managing ec2 instances based on environment or role (and not re-implement either the AWS Management Console or the Chef Server webui).
    1819
    1920This plugin is highly configurable but is opinionated in some ways.  Some of these opinions could be relaxed ([http://trac-hacks.org/newticket?component=CloudPlugin&owner=robguttman submit a ticket!]) but they currently are:
     
    5253    aws_keypair_pem = /path/to/keypair.pem
    5354    aws_username = <ec2-username>
     55    rds_username = <rds-master-username>
     56    rds_password = <rds-master-password>
    5457    chef_base_path = /path/to/.chef
     58    chef_boot_run_list = <list-of-roles-or-recipes>
    5559    }}}
    5660
    5761=== AWS access configuration ===
    58 The {{{aws_*}}} options (see example above) are for your AWS credentials and security information.  For more info, see [http://docs.amazonwebservices.com/AWSSimpleQueueService/2007-05-01/SQSDeveloperGuide/AWSCredentials.html here] and [http://docs.amazonwebservices.com/AWSSecurityCredentials/1.0/AboutAWSCredentials.html here].
     62The {{{aws_*}}} and {{{rds_*}}} options (see example above) are for your AWS credentials and security information.  For more info, see [http://docs.amazonwebservices.com/AWSSimpleQueueService/2007-05-01/SQSDeveloperGuide/AWSCredentials.html here] and [http://docs.amazonwebservices.com/AWSSecurityCredentials/1.0/AboutAWSCredentials.html here].
    5963
    6064=== Chef access configuration ===
     
    176180
    177181
     182=== RDS Instances ===
     183RDS instances can be created and deleted using this plugin.  The rds instance resource type is configured almost identically to ec2 instances (see above).  One important difference is that the list of rds instances and their attributes are saved in a chef data bag.  This makes their attributes available to chef recipes.  In order to ensure that this data is up-to-date, you can click on the "Audit" button in the grid view.
     184
     185=== Commands ===
     186To help manage many ec2 instances, you can define commands to be run on them in the "Commands" section.  The command resource type is configured similarly to ec2 and rds instances.  Their data is maintained in a chef data bag.  An example command may look this this:
     187{{{
     188/usr/bin/ssh -i %(keypair_pem)s root@%(host)s "service apache2 restart"
     189}}}
     190
     191The {{{%(keypair_pem)s}}} will get replaced with the {{{aws_keypair_pem}}} as defined in {{{trac.ini's [cloud]}}} section (see above).  Also, {{{%(host)s}}} will get replaced with the public DNS name of each host.  Hosts are selected by environment and/or role.
     192
     193=== Environments ===
     194With Chef 0.10 comes support for environments.  This plugin builds on this support by allowing (read: presuming) that AWS resources belong to one and only one environment.  For example, there's a default {{{environment}}} field that can get set when creating a new ec2 or rds instance.  The environment resource type also allows you to define and set attributes per environment via the plugin's webui.  For example, you can set different version control repo branch names and/or changesets per environment so that the right source code gets deployed to each environment.
     195
     196==== Deploy and Audit ====
     197There are two special commands that can be defined: "deploy" and "audit".  A command with a "deploy" ID will cause a "Deploy" button to appear in an environment's View along with widgets to select which role(s) should be used to identify the instances to which to deploy.  The 'deploy' script itself is left for you to define as such scripts often require significant logic specific to your environments.
     198
     199Similarly, if a command with an "audit" ID will cause an "Audit" button to appear in an environment's View along with widgets to select which role(s) should be used to identify the instances of which to audit.  The 'audit' script itself is left for you to define as such scripts often require significant logic specific to your environments.
     200
     201
    178202=== Progress views ===
    179 Launching or bootstrapping an ec2 instance can take a variably long time - usually longer than the default Apache timeouts (e.g., {{{FcgidIOTimeout}}}).  Instead of wrestling with Apache timeout configurations, this plugin now launches and bootstraps ec2 instances in a separate, spawned process (an orphaned daemon) that survives Apache timeouts and restarts.  Surviving Apache restarts is also helpful when Trac itself is chef-managed and may be restarted by the {{{chef-client}}} upon config changes.  Creating a new instance now brings up a new 'Progress' page that tracks the spawned process' progress:
     203Actions such as launching or bootstrapping an ec2 instance or deploying code to an environment can take a variably long time - usually longer than the default Apache timeouts (e.g., {{{FcgidIOTimeout}}}).  Instead of wrestling with Apache timeout configurations, this plugin executes each of these actions in a separate, spawned process (an orphaned daemon) that survives Apache timeouts and restarts.  Surviving Apache restarts is also helpful when Trac itself is chef-managed and may be restarted by the {{{chef-client}}} upon config changes.  Creating a new ec2 instance, executing remote commands, etc. now brings up a new 'Progress' page that tracks the spawned process' progress:
    180204
    181205[[Image(progress.png)]]
    182206
    183 As the instance id and public DNS become known, they're presented.
     207For launching ec2 instances, as the instance id and public DNS become known, they're presented.
    184208
    185209== Recent Changes ==