Merge lp://qastaging/~chad.smith/charms/precise/block-storage-broker/bsb-ec2-boto into lp://qastaging/charms/block-storage-broker

Proposed by Chad Smith
Status: Merged
Approved by: David Britton
Approved revision: 66
Merged at revision: 55
Proposed branch: lp://qastaging/~chad.smith/charms/precise/block-storage-broker/bsb-ec2-boto
Merge into: lp://qastaging/charms/block-storage-broker
Diff against target: 1436 lines (+487/-421)
4 files modified
hooks/hooks.py (+12/-6)
hooks/test_hooks.py (+46/-18)
hooks/test_util.py (+327/-327)
hooks/util.py (+102/-70)
To merge this branch: bzr merge lp://qastaging/~chad.smith/charms/precise/block-storage-broker/bsb-ec2-boto
Reviewer Review Type Date Requested Status
David Britton (community) Approve
Fernando Correa Neto (community) Approve
Review via email: mp+231275@code.qastaging.launchpad.net

Description of the change

This branch moves block-storage-broker's EC2-specific methods from euca2ools to AWS' python SDK (python-boto).

The reason for this change is to avoid significant incompatibilities in euca2ools libraries that have been introduced across euca2ools major releases. By consuming python-boto instead of internal euca2ools libraries, we access a more stable API supported by Amazon that will remain more stable across releases than internal euca libs. As written this code currently also has been tested on trusty and will be used as well as the trusty release of this charm.

This can be quickly tested on AWS either using precise or trusty by changing the postgresql-storage-bundle.cfg:
  - change all mention of precise to trusty
  - change postgresql-9.1-debversion to postgresql-9.3.debversion

Test procedure is something like the following:

1. Create postgresql-storage-bundle.cfg as exemplified below, replacing the EC2_* values with valid credentials and endpoints.

2. juju-bootstrap -e your-ec2-environment
# to deploy block-storage-broker, storage subordinate and postgresql and create and attach a volume.
3. juju-deployer -c postgresql-storage-bundle.cfg doit-no-volume

----- postgresql-storage-bundle.cfg -----
common:
    services:
        postgresql:
            branch: lp:~charmers/charms/precise/postgresql/trunk
            constraints: mem=2048
            options:
                extra-packages: python-apt postgresql-contrib postgresql-9.1-debversion
                max_connections: 500
        block-storage-broker:
            branch: lp:~chad.smith/charms/precise/block-storage-broker/bsb-ec2-boto
            options:
                provider: ec2
                key: <your EC2_ACCESS_KEY>
                endpoint: <your EC2_URL>
                secret: <your EC2_SECRET_KEY>

doit-no-volume:
    inherits: common
    series: precise
    services:
        storage:
            branch: lp:~charmers/charms/precise/storage/trunk
            options:
                provider: block-storage-broker
                volume_size: 9
    relations:
        - [postgresql, storage]
        - [storage, block-storage-broker]

doit-with-volume-map:
    inherits: common
    series: precise
    services:
        storage:
            branch: lp:~charmers/charms/precise/storage/trunk
            options:
                provider: block-storage-broker
                volume_size: 9
                volume_map: "{postgresql/0: YOUR-EXISTING-EUCA-VOLUME-ID}"

    relations:
        - [postgresql, storage]
        - [storage, block-storage-broker]

To post a comment you must log in.
60. By Chad Smith

mocker assert cloud-archive:havana is not added on trusty or later

61. By Chad Smith

fcorrea review comment. docstring update

Revision history for this message
Fernando Correa Neto (fcorrea) wrote :

Hey Chad, overall it looks great.

Just a few points inline.

review: Needs Fixing
Revision history for this message
Chad Smith (chad.smith) wrote :

Good deal Fernando thanks. I'll fix those comments right here with the exception of the isolation of ec2 from nova comment. We can handle that as a separate bug.

Revision history for this message
Dean Henrichsmeyer (dean) wrote :

Yeah, let's not do the re-factoring for now. I'd prefer to focus on product priorities and circle back to this another time.

62. By Chad Smith

add apt_install and add_source params to install hook for testing

63. By Chad Smith

pull ec2_url regex parsing and connect_to_region calls out of try/except block to simplify error handling

64. By Chad Smith

unit test updates to use add_source apt_update testing params. add unit test for installing python-boto for ec2 provider provider

65. By Chad Smith

unit test rename for whitebox testing

Revision history for this message
Chad Smith (chad.smith) wrote :

Fernando, I addressed your review comments on this branch with the exception of the re-factor. If you can create a bug/card for that we can work it when we have time after audit/history tasks

Revision history for this message
Fernando Correa Neto (fcorrea) wrote :

+1, Chad.
I filed a bug about the refactoring. Also, if you want to address the tests cleanup in a separate branch, I'm fine as it's really a cleanup.

review: Approve
66. By Chad Smith

consolidation of environment setup in a class method _set_environment_vars

Revision history for this message
David Britton (dpb) wrote :

Hi Chad -- Thanks for submitting this, I tested successfully on both precise and trusty, appreciate your attention to detail on it. Since this test already has unit tests will submit to both precise and trusty.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: