This README is designed for Cisco Live "Devnet Workshop - Mantl: How to use it" DEVNET-2030 session. In this workshop you will learn how to deploy micro-services applications and manage them on Cisco's Mantl platform. In this workshop we expect attendees have basic knowledge of containers, microservices architecture and REST APIs. This README is divided in following three sections.
- Application Overview - This section talks about the "My Hero" application, architecture and micro-services used to compose the application.
- Application Deployment - This section starts with Mantl UI walkthrough and covers application deployment on Mantl cluster.
- Application Management - This section covers how to manage application life cycle using Mantl UI and REST APIs.
In this workshop we will be using "MyHero App" application which is being developed with microservices paradigm to demonstrate Mantl capabilities. MyHero App is a simple application which allow users to vote for their favorite super hero and gather the voting results. The application is built in a microservice style wrapping each service in a docker container that can be deployed and run on Mantl. In its initial form the application has three services.
- myhero/data - This service stores all the data about candidates and votes cast.
- myhero/app - This service provides the basic logic layer for accessing and recording votes.
- myhero/web - This is the main user interface for casting votes.
Following are the prerequisites for the attendees.
- Linux operating system based laptop (Cygwin may also work for MS Windows users).
- CURL installed.
- Standard Web browser.
Open "https://mantlsandbox.cisco.com" on web browser and enter credentials as provided, this will open Mantl UI. On this page you will see different tiles for Mesos, Martahon, Consul and Traefik which are the core open source technologies used by Mantl. Please click on these tiles one by one to explore these technologies.
Open a web browser and paste "https://github.com/CiscoCloud/clus-my-hero-app/archive/master.zip", this will download the "clus-my-hero-app-master.zip" file. Extract the archive file, this will create "clus-my-hero-app-master" directory which will have all required files for my-hero-app.
Environment setup is the first step to interact with Mantl API, this will setup Mantl endpoints and credentials to sign in to the Mantl APIs.
Open a terminal/shell and move to "clus-my-hero-app-master" directory and run "source myhero_setup" to enter and record the deployment name, address, application domain, username, and password for your Mantl instance as non-persistent environment Variables.
Please do not close this terminal/shell otherwise you will need to run this command again.
Run ./myhero-install.sh to deploy all three services (data, app, web) to your Mantl cluster.
After running the install it will take a 2-5 minutes for all three services to fully deploy and become "healthy". You can monitor this in the Marathon Web GUI.
You should be able to reach the web interface for the application at http://DEPLOYMENTNAME-web.YOUR-DOMAIN where DEPLOYMENTNAME refers to the deployment name provided at setup and YOUR-DOMAIN refers to the wildcard domain configured for Traefik.
Application URL was give at the environment setup step.
Open "https://mantlsandbox.cisco.com" on web browser and enter credentials as provided, this will open Mantl UI. On this page you will see different tiles for Mesos, Martahon, Consul and Traefik which are the core open source technologies used by Mantl.
-
Click on the Mesos tile and look at the tasks, you will find tasks related to the application name you have give while setting up the environment.
-
Click on Marathon tile to open Marathon UI, here you can investigate individual services from the MyHero application. Click on the "Configuration" tab to explore about the service configuration. You can scale up/down the service from this tab as well.
####Note: Please ask help from the Cisco engineers if needed.
Mantl provide REST APIs to access its individual components (Mesos, Marathon etc...), REST APIs are good for integration purpose. To make this session easy we have created a CLI (command line interface) which uses Mantl REST APIs to interact with Mantl. To use the CLI you have to set CLI environment.
Run "source myhero-cmd.sh" from the same linux shell/terminal to setup the environment.
Run "myhero_list_apps" to list the application you have just deployed. This will return response in JSON format.
Run "myhero_get_app" command to get the details about application.
Run "myhero_scale_up_web" command to scale up the application, it will prompt to you current number of instance.
Run "myhero_scale_down_web" command to scale down the application.
In this steps we will destroy the application along with all micro-services from the Mantl cluster.
####How:
Run ./myhero-uninstall.sh to remove all three services from Marathon.
####Note:
You can verify the current state using REST API or using the Mantl UI.