When user receives an event from Amazon Cloud Watch that a node has high CPU usage (beyond a certain thresold) then this event can be seen within Slack messenger via the AWS Cloud Watch bot. But in order to remedy the situation user can add another node or scale out the node. To do any of this user will need to either use AWS console or AWS CLI from a terminal and leave the Slack messenger for that. That is where Amigo chatbot comes in.
What it does
Amigo chatbot enables user to execute any command that is supported by aws-cli from within slack.
How I built it
Amigo is designed to support multiple enterprise messengers and multiple cloud management. Amigo chatbot is a set of microservices deployed on a docker swarm cluster hosted on AWS. Amigo is written primarily in Java and uses Dropwizard framework and Quartz scheduler to implement the microservices. Each service is dockerized Java application that can be run within a Docker Swarm mode cluster. Following are the essential services:
- command-db Apache Kafka is the message queue that is used to hold the user messages for asynchronous processing. MongoDB is used for both user-db and command-db mentioned above.
Challenges I ran into
Debugging microservices when they run within a container orchestrator (like Docker Swarm) is painful. Docker logs will only show last all or N number of lines and don’t tail live. Running dockerized applications in debug mode requires extra tooling support from IDE so it can connect to the debugger agent on a container within the Swarm cluster.
We deployed the microservices running as separate processes on different ports on the local dev host to ease debugging.
Accomplishments that I'm proud of
Ability to execute all aws-cli commands from within Slack. Ability to easily upgrade the aws-cli docker image when a new version of aws-cli is available and that will automatically update all clients to support the new version of aws-cli without requiring any updates on the client or any change in code.
What I learned
Integration with enterprise messengers like Slack Developing microservices to run as docker containers Deployed in Docker swarm mode clusters Developing Mobile app using React Native Developing Web application using React.js Hosted in AWS public cloud
What's next for amigo-chatbot
Add support for other cloud providers: docker-cloud, gcloud, azure-cli Use Amazon Lex to write a wrapper bot thus extending Amigo’s features to several enterprise messengers. Add support for voice assistants like Amazon Alexa and Google Home.