Voice is changing how we interact with technology because the interaction is simple, frictionless, and streamlined. For me, voice is an easier way to control Jenkins and retrieve results about my deployments without having to touch a keyboard. In this use case, voice is another access point for data and is a way to further automate the process of building, testing, and deploying a Java project to the cloud, improving efficiency.
Continuous Integration and Continuous Delivery (CI/CD)
If you’re working with DevOps, you understand the need for Continuous Integration and Continuous Delivery (CI/CD) to automate the software delivery pipeline in a reproducible way.
CI/CD is the practice of continuously building, testing, and deploying code once it’s committed to version control. DevOps and CI/CD provides software engineering teams with confidence in the code being pushed to production and shorter development lifecycles, which in the end produces happier users, clients, and customers.
DevOps Pal Overview and Architecture
DevOps Pal is an Alexa for Business skill that is used to kick off a Jenkins pipeline job. Once DevOps Pal invokes the job, the pipeline status displays in real time via the Blue Ocean Pipeline Run Details View Page.
I used several components and tools to create DevOps Pal. Let’s review the architecture in detail.
The flow begins by saying, “Alexa, open DevOps Pal and deploy my code,” to the Alexa-enabled device.
First, the Alexa-enabled device detects the wake word (e.g. Alexa, Echo, Computer, or Amazon). Once the wake word is detected, what I say is recorded and securely sent to the Alexa voice service, which uses speech-to-text and natural language understanding (NLU) to identify my intent. My intent is sent to DevOps Pal; the skill acts accordingly by kicking off the Jenkins job and sending a response back using text-to-speech synthesis (TTS), which makes the response natural sounding.
Let’s explore each component in more detail:
- Alexa Voice Service - I often refer to the Alexa voice service as the “Alexa brain that runs in the cloud.” The Alexa voice service is a suite of services built around voice-controlled AI. The voice service is flexible enough to allow third parties to add intelligent voice capabilities to any connected product that has a microphone and speaker, so Alexa is not limited to just Amazon Echo devices.
- Alexa Skills Kit (ASK) - ASK is the “SDK” (Software Development Kit) that allows developers to build custom skills for Alexa. Skills helps Alexa become smarter by extending her functionality.
- Alexa Developer Console - An Alexa skill includes a voice user interface, or VUI, to understand customer intents, and a back-end cloud service to process intents by telling Alexa how to respond. The VUI and the integration with the back-end service is setup and configured through the Alexa Developer Console.
- AWS Lambda - A chunk of code that runs in the cloud. Developers can run their code without having to provision or manage servers. Applications created with AWS Lambda are considered to be serverless. Lambda supports several popular languages like Python, Java, Node.js, Go, C#, etc.
- GitHub - A version control system for the Java project source code.
- Jenkins on EC2 - Jenkins is an automation server that allows for the setup of a continuous integration or continuous delivery environment for almost any combination of languages and source code repositories, using pipelines. In this project, I use Jenkins to build, test, and deploy my Java Application Programming Interface (API). Elastic Cloud Computer (EC2) is the virtual server where Jenkins is installed. Jenkins works alongside several other tools:
- Maven - A build automation tool for Java projects.
- Junit - A testing framework for Java projects.
- AWS Command-Line Interface (CLI) - This is a command line tool that allows developers to access their Amazon Web Services (AWS) account.
- Blue Ocean - This is a plugin for Jenkins that provides an easy to use interface to create and monitor Jenkins pipelines. It is more user friendly than the traditional Jenkins user interface.
- AWS Elastic Beanstalk - This is an orchestration service that allows developers to deploy and manage web applications in the AWS cloud.
- Postman - This is an HTTP client for testing APIs and web services.
Jenkins Classic UI
The Jenkins job, ‘alexa-cicd’, is the job invoked from DevOps Pal. Although, the Jenkins Classic User Interface (UI) is functional, I prefer the Blue Ocean interface because it rethinks the user experience of Jenkins by making it visually intuitive. Blue Ocean is easily enabled via a plugin and leaves the option to continue using the Jenkins Classic UI should you so choose.
Blue Ocean Pipeline Run Details View Page
After Alexa kicks off the ‘alexa-cicd’ job, I navigate to the Pipeline Run Details View Page, which allows me to watch the job status in real-time. This job has four stages: Initialize, Build, Test, and Deploy. The final stage, Deploy, uses the AWS Command Line Interface (CLI) on the Jenkins server to copy the artifact to Amazon Simple Storage Service (S3) and create a new Elastic Beanstalk application version based on the artifact located on S3.
Why Choose Alexa for Business
DevOps Pal is a published Alexa skill; however, it is not available in the Alexa Skills Store. In fact, DevOps Pal didn’t even go through the traditional certification process. DevOps Pal is considered to be a private skill that is only available to approved organizations via Alexa for Business. Alexa for Business, currently only available in the US, allows developers to use the Alexa Skills Kit (ASK) to publish private skills meant for workplace empowerment. Alexa for Business also provides tools to help organizations configure private skills that boost employees’ productivity, manage Alexa devices across an organization, and enroll employees along with their own personal devices. I knew Alexa for Business was the perfect way to distribute DevOps Pal, privately, to select organizations.
Alexa Developer Console
Through the Alexa Developer Console, I am able to control which organizations have access to DevOps Pal. This level of control is perfect because there is organization specific configuration that should occur before an organization can make use of the skill.
Organization’s Alexa for Business Console
The Alexa for Business Console is used by an organization to enable and manage the DevOps Pal skill once I’ve provided access.
What's Next for the Skill
The initial release of DevOps Pal is just the beginning. I spent a weekend proving that deploying code via voice was possible, and I have several enhancements in the pipeline:
- DevOps Pal will be updated to prompt the user for the specific Jenkins pipeline job name. This adds a level of flexibility that will really empower DevOps teams.
- Alexa Notifications will be integrated with DevOps Pal to send a notification to the Alexa-enabled device when the Jenkins job is finished or when it fails. If the job fails, more information about where the job failed and exactly why will be provided. This will prove useful for long running jobs or for getting timely updates regarding the job status.
- DevOps Pal will be updated to answer direct questions about the real-time status of a specific job.
I hope you’ve enjoyed learning more about the architecture of DevOps Pal and deploying code to the cloud using voice. For more detailed steps, I’ve collaborated with Cloud Academy to author a course on the subject. Click here to learn more about the course and sign up to be notified when it’s available. Reach out to me on Twitter at @KeshaWillz.
More Stories from the Alexa Developer Community