0.1.67 • Published 8 years ago

cloud-blender v0.1.67

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Cloud Blender

A high level node library for cloud compute operations that abstracts away differences among multiple cloud providers.

Installing

Overview

Cloud Blender provides a unified way to work with multiple cloud vendor's compute service. Cloud Blender works in a real asynchronous manner by having the callbacks called only after all the operations of a single function are completed and not when they accepted. You provide generic inputs to every function regardless of the cloud provider. In addition, you can provide cloud specific inputs to use functionality provided by that cloud vendor. The output of the functions consists of unified result and the original raw result from the cloud provider (converted to JSON). This design ensures that if you are not passing specific inputs and not using the raw results, your code is 100% cross platform. You can still accomplish cross platform functionality if you use raw results and are passing vendor specific parameters, however, you must verify it.

Basic Use Case

Example of retrieving all the nodes in a region:

var cloud = require('cloud-blender'),
   settings = {
      // This is for demo purposes only! Your credentials should not 
      // be hard coded, instead consider loading them from your environment
      // or from a secured file.
      // Information on how to obtain hp access, secret, tenant id, region and az
      // can be found in https://blog.hpcloud.com/using-hp-cloud-identity-service
      regionContext: cloud.createRegionContext('hpcs_13_5', {
            "accessKey": "<your hpcs access key>", 
            "secretKey": "<your hpcs secret key>", 
            "tenantId": "<your hpcs tenant id>",
            "region": "region-a.geo-1", // hpcs uswest
            "availabilityZone": "az-2"  // hpcs uswest - az2
       })
   };

cloud.listNodes(settings, function(error, result) {
   if (error) {
      console.log('error in getting nodes list, details:', error);
   }
   else {
      //result.nodes will contain the same fields regardless the cloud provider
      //result.rawResult will contain the original result from the cloud provider
      console.log('successfully retrieved nodes list', result.nodes);
   }
});

Advanced Use Case

Example of creating multiple nodes with different configurations in the same provisioning request. Note that Cloud Blender allows the flexibility to create different configurations such as tags and different instance type in the same call. Note that the region post rate is non standard.

var cloud = require('cloud-blender'),
   settings = {
         
      // This is for demo purposes only! Your credentials should not 
      // be hard coded, instead consider load them from your envirenmet
      // or from a secured file.
      // Information on how to obtain aws access and secret can be found 
      // in:  http://docs.aws.amazon.com/fws/1.1/GettingStartedGuide/index.html?AWSCredentials.html
      regionContext: cloud.createRegionContext('aws', {
            "accessKey": "<your aws access key>", 
            "secretKey": "<your aws secret key>", 
            "region": "us-east-1", 
         }, { postRatePerMinute: 200}),
         nodes: [ // notice that we use multiple configurations in the same request
            {
               imageId: 'ami-d0f89fb9', // public ubuntu 12.04 i686 on aws east-1 
               instanceType: 't1.micro'
               tags: {
                  logicName: 'machine1'
               }
            },
            {
               imageId: 'ami-d0f89fb9', 
               instanceType: 'm1.large'
               tags: {
                  logicName: 'machine2'
               }
            }]
      };

   cloud.createNodes(settings, function(error, result) {
      if (error) {
         console.log('error in create nodes, details:', error);
      }
      else {
         //note that all nodes are currently in ACTIVE state
         //result.nodes will contain the same fields regardless the cloud provider
         //result.rawResult will contain the original result from the cloud provider
         console.log('successfully created nodes', result.nodes);
      }
   });

Current Cloud Providers Support

The current version supports HP Helion (both 12.12 and 13.5 versions), Rackspace, Azure and AWS-EC2.

Current Version Supported Operations

The current version supports the following operations:

Contributions Welcome

We welcome contributions from the community and are pleased to have them. For bugs, enhancement requests and comments please open us issues. For code contribution please fork and ask for pull request: Please make sure you follow our coding style and that the tests are green. Make sure not to include your tenant credentials in the source code.

Running Tests

There are two types of tests:

  • Remote: The majority of the validation tests are remote tests. These tests access real cloud services and you will incur a cost to run them.
  • Local: There are a few validation tests that are local test. These tests are free.

How to Run a Test

  • By default, only local test are running. If you want to enable remote tests set the EXEC_CLOUD_TESTS environment variable to true. You can also setup a proxy by setting the environment variable TUNNELING_PROXY to your proxy.
  • The tests are run on HPCS US-West-AZ2 and AWS-USEast-1. We hard coded certain properties of these regions. You will need to create two configuration files in which include your credentials.

    • ./examples/hpcs_uswest_az2.json for HPCS US-West-AZ2 credentials.
    • ./examples/aws_east_1.json for AWS US-EAST-1 credentials.

    These JSONs are used as inputs to the createRegionContext function. For example, ./examples/config_example.json Please also create a key pair on each region and hard code it in the test files, where keyName is used.

  • To run the acutual tests:

npm run test # Tests public API
npm run test-atomic-hpcs # Tests HPCS-Compute atomic module
npm run test-atomic-aws # Tests AWS-EC2 atomic lib

Additional Information

  • For the latest updates follow @CloudBlender (coming soon).
  • API reference
  • For issues or questions, please open an issue or ask in twitter.
0.1.67

8 years ago

0.1.66

8 years ago

0.1.65

8 years ago

0.1.64

8 years ago

0.1.63

8 years ago

0.1.62

8 years ago

0.1.61

8 years ago

0.1.60

8 years ago

0.1.59

8 years ago

0.1.58

8 years ago

0.1.57

8 years ago

0.1.56

8 years ago

0.1.55

8 years ago

0.1.54

8 years ago

0.1.53

8 years ago

0.1.52

8 years ago

0.1.51

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.99

8 years ago

0.0.98

8 years ago

0.0.97

8 years ago

0.0.96

8 years ago

0.0.95

8 years ago

0.0.94

8 years ago

0.0.93

8 years ago

0.0.92

8 years ago

0.0.91

8 years ago

0.0.90

8 years ago

0.0.89

8 years ago

0.0.88

8 years ago

0.0.87

8 years ago

0.0.85

8 years ago

0.0.82

8 years ago

0.0.81

8 years ago

0.0.80

8 years ago

0.0.79

9 years ago

0.0.78

9 years ago

0.0.77

9 years ago

0.0.76

9 years ago

0.0.75

9 years ago

0.0.74

9 years ago

0.0.73

9 years ago

0.0.72

9 years ago

0.0.71

9 years ago

0.0.70

9 years ago

0.0.69

9 years ago

0.0.68

9 years ago

0.0.67

9 years ago

0.0.66

9 years ago

0.0.65

9 years ago

0.0.64

9 years ago

0.0.63

9 years ago

0.0.62

9 years ago

0.0.61

9 years ago

0.0.60

9 years ago

0.0.59

9 years ago

0.0.58

9 years ago

0.0.57

9 years ago

0.0.56

9 years ago

0.0.55

9 years ago

0.0.54

9 years ago

0.0.53

9 years ago

0.0.52

9 years ago

0.0.51

9 years ago

0.0.50

9 years ago

0.0.49

9 years ago

0.0.48

9 years ago

0.0.46

9 years ago

0.0.45

9 years ago

0.0.44

9 years ago

0.0.43

9 years ago

0.0.42

9 years ago

0.0.41

9 years ago

0.0.40

9 years ago

0.0.39

9 years ago

0.0.38

9 years ago

0.0.37

9 years ago

0.0.36

9 years ago

0.0.35

9 years ago

0.0.34

9 years ago

0.0.33

9 years ago

0.0.32

9 years ago

0.0.31

9 years ago

0.0.30

9 years ago

0.0.29

9 years ago

0.0.28

9 years ago

0.0.27

9 years ago

0.0.26

9 years ago

0.0.25

9 years ago

0.0.24

9 years ago

0.0.23

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago