AMP Basics: Using AMP to deploy a Basho Riak KV Enterprise data fabric
Start your introduction to Cloudsoft AMP by walking through a successful deployment of a non-trivial Basho Riak KV Enterprise platform in a multi-data center configuration. That's a quick start!
Your course instructor will provide you with AWS credentials (to spin up a Riak KV Enterprise fabric).
An introduction to AMP
- The purpose of this module is to provide a very brief introduction to Cloudsoft AMP and to lead you through a successful deployment of a non-trivial Basho Riak KV Enterprise platform in a multi-data center configuration.
- This will allow you to see how Cloudsoft AMP can model, deploy and manage complex enterprise fabrics to support services that need to be globally available, scalable and resilient.
What is AMP?
AMP Pro is a 100% Open Source application management platform
that provides cloud agility and governance
without losing control
What if you could…
What are Blueprints?
A central concept in AMP is that of a blueprint
Blueprints are descriptors or patterns which describe how Cloudsoft AMP should deploy applications
What are Entities?
An entity is AMP’s representation of a software package or service which it can control or interact with
A blueprint is comprised of one or more entities
What does AMP do – and how?
live model of runtime application topology
sensors (metrics) on each entity
effectors (operations) on each entity
policies (management logic) on each entity
This very simple overview illustrates how your applications are 'blueprinted', deployed, monitored and managed in any location by Cloudsoft AMP.
Tell me more about blueprints
- A blueprint defines an application, using a YAML syntax
- A basic blueprint comprises a simple application
- e.g. a web-application server running a WAR file plus a data store
- Lets you deploy it to infrastructure
- Connects all the different components of an application
- e.g. so the web application knows where the database is
What are Sensors?
Sensors are properties which show the state of an entity - providing a real-time picture of an entity within an application
What are Effectors?
Effectors expose the operations you can perform (manually or programmatically) on your application and it’s components
What are the basic concepts of AMP?
Expose the operations you can perform (manually or programmatically) on your application and it’s components
Properties which show the state of an entity - providing a real-time picture of an entity within an application
Descriptors which describe how Cloudsoft AMP should deploy applications
AMP’s representation of a software package or service which it can control or interact with
An introduction to YAML
Why do you need to know YAML?
- YAML is a key component of AMP
- It is the language used to create blueprints
- It can be used as the glue to connect existing blueprints whether written in YAML or Java
What is YAML?
- YAML: YAML Ain't Markup Language
- YAML is a human friendly data serialization standard for all programming languages
- Its familiar indented outline and lean appearance make it especially suited for tasks where humans are likely to view or edit data structures, such as configuration files.
- The design goals for YAML are:
- is easily readable by humans
- data is portable between programming languages
- YAML matches the native data structures of agile languages
- has a consistent model to support generic tools
- is expressive and extensible
- is easy to implement and use
Common YAML mistakes
Only spaces, no tabs
- The indentations in a YAML configuration are done by using the space key and not the Tab key
- Any indentation made by using the Tab key will result in errors
- Indentations are extremely important in YAML configuration
- You must indent your properties and lists with 1 or more spaces
- The recommended way to write a blueprint is as a YAML file
- This is true both for building an application out of existing blueprints, and for building new integrations
- The use of Java is reserved for those use-cases where the provisioning or configuration logic is very complicated
- YAML files can be edited in any editor (even Notepad)
- The editor you use is personal preference
- It is recommended you use a YAML-aware editor
- Auto-complete (limited)
- Can collapse/expand sections
- Some options:
How do you create a blueprint?
- AMP Blueprints can only be written in YAML
- AMP Blueprints can only be written in Java
- AMP Blueprints can be written in YAML or Java
- AMP Blueprints can be written in JAML
Launch AMP and deploy the application
What are you going to do?
You will run Cloudsoft AMP locally on your computer
Cloudsoft AMP knows how to deploy and manage a Riak KV Fabric (via an existing Java blueprint)
You will run a YAML-blueprint that uses the existing blueprint to create an instance of the fabric in 3 geographies
The YAML-blueprint will also create a simple chat web application (in 1 location) that uses the fabric to store chat messages
Ways of interacting with AMP
- Cloudsoft AMP can be used to model, deploy and actively manage your applications via a combination of 3 interfaces - these are the web console, the REST API and the Command-Line Interface (CLI)
- In this training module, you use the AMP web console and REST API
- Contact email@example.com if you wish to use the CLI so that we can provide you with a download link and usage instructions
Overview of ways to use AMP
Configure and deploy
You will run another 'standlone' version of AMP on your server
- You can download a quick-launch version of Cloudsoft AMP from Github (~57MB compressed)
- Unzip the file
- Launch a Command Prompt / Terminal (in the directory you unzipped the download to) and run AMP:
Cloudsoft AMP is now running and available
Login to AMP
- View Cloudsoft AMP in your browser:
- You are presented with the AMP “Create Application” wizard
You will not use the wizard (as this training module will present and explain the complete YAML blueprint) – click “YAML Composer”
Download the blueprint
Before you add the YAML-blueprint to Cloudsoft AMP, you need to download and customize it
Let's download it first using this download link or copy it from below.
Copy/paste the content into your YAML editor.
Can you find the 5 sections you need to customize?
Add the blueprint to AMP
Once you have edited the blueprint, copy it to your clipboard and return to Cloudsoft AMP in your web browser. Do this by pasting the blueprint into the Blueprint Composer
Note: The screenshot purposely omits the AWS credentials
Run the blueprint
Cloudsoft AMP will now provision VMs in the following 3 AWS locations
Once provisioned, the Riak KV Enterprise fabric (and simple chat application) will be installed and configured
How does Cloudsoft AMP provision VMs?
For most cloud provisioning tasks, AMP uses Apache jclouds
jclouds is an open source
multi-platform toolkit for the Java platform