Devreal

Simplifying DevOps with SlackBots

Event: Scala by the Bay

scala.bythebay.io: Chalenge Masekera, Simplifying DevOps with SlackBots

Recording: scala.bythebay.io: Chalenge Masekera, Simplifying DevOps with SlackBots

you all right yeah so I'll be talking about like simplifying DevOps with slack pots so a bit about myself I do data science itself source Einstein and before that I'd done an information management and systems our master's degree at Berkeley so the agenda for the day I'll do a quick like sort of like intro into like what is Salesforce Einstein but those were curious then we'll do sort of like I should like how we can sort of like build a simple slack bot using Scala and also like I'll talk a bit of like why we've decided to go the route of using BOTS and DevOps with a few use cases so yes to set introduction to like social science line so the first thing for those are most of us who are like engineers or like we don't know what AI is I'll do like it simple like AI 101 so the sort of like an AI or machine learning there's three simple things that you need to that are sort of like the fundamental basics of everything the first one is like the response or label which is like what are you trying to predict whether it's somebody will like is likely to convert to a lead whether an email spam or like weather like a picture is a human or it's what you call it a car or something else then the second most important thing is like what are called features of predictors and these are the factors that you sort of like likely to predict the response idea that you want to try so let's say you want to predict whether somebody is a cell as who is a good sales lead it could be the industry the zip the zip code where they live or whatever company to work for then the third most important thing is like what it's called a model a model is like a that is calm a sort of like human world representation of which sort of like correlates or relates the features to the response that you're trying to predict so it can be very simple like a simple mathematical equation which is like y is equal to a plus B like a likelihood for this person to predict is a their age x 0.5 plus their salary x 0 point something oh it could be something very complex like I am sure like some of you have it like the buzz is like configurated neuron networks do plenty and stuff like that so what we are doing itself us and why we are excited about social science line is we want to build like the woods smart it's erm and so it is a big company with ears like a lot of use cases which is quite different from like most of our other companies that are around it because usually it's like you want to build an app for like a simple like a one use case let's say you want to recommend people products they should buy so with Celsius it's quite different we have like all these clouds or I totally different they have like different use cases and also inside of those use cases the customers themselves are very different so what we want to do is make sort of like in bed artificial intelligence to sell so that everybody even without the machine learning PhD can be able to what you call it leverage their data to make better relationships with their customers so for us to do this we had to build sort of like an automated like a machine learning services architecture which consists of like the interface that people talk to without the cell source then you're also like in terms of machine learning a bunch of steps that you need to do first you need to get the data which you like record data pooling then you do data preparation which is like you now have this data how do you make it into like the features and what you call it predicts us that I talked about then you also want to build do like the actual like what you called machine learning which is like sort of like building a predictive model and actually making the predictions which is called scoring then also like having a way to sort of like surface your predictions back to the customers and all this you need to do it in a very smart way with some like model management and scheduling and also some monitoring services so this sort of like enough like some of these tools that we are using and I think no surprises what we have skala day so for us to scale this imagine like our for Salesforce that architecture we want we have hundred thousands of customers just to go back so we are sort of like building like simple like sort of a hundred thousands of like simple architectures for each and every one of their customers so we want to be able to scale this so for us to do that we have to add to think of ways to really do smart ways first likes smart allocation of resources we can't just likes pool our resources willy nilly we have to think about with the customer what is their use case how much data do they have and like what sort of like the impact if to their own system if we deployed this service then you also have to like sort of we did it to a couple ways like a generic like sort of just like grouping Mumbai like big small or medium but also thought of like we are data sciences would be smarter we could also build models that predict usage of like resources and what you can and allocated basically based on sort of like build another predictive model then on top of that like if you're at DevOps over if you're into DevOps there are two things is sort of like what you call it system administration and agile development but in terms of all of this what's important is you want self healing processes you don't want anybody waking up in the middle of the night to fix stuff so we had to sort of like I think of like what's the best ways to do so clearly whether it's like if it fails we increase resources how do we notify people or like what's the simplest way for people to like what you can't fix stuff so we thought like boats would be sort of like a simple way in like very efficient for what we're trying to do so now I'm going to sort of like so like what sort of like building a simple slack port into using Scala so the basic pieces like one of them is like we use acha for those I'm we don't so like what is a Kazakh is a simple tool kit that allows us to build highly concurrently distributed and resilient message driven applications I think the key word is like message driven so it consists of like act as and logically which allow a synchronous non-blocking operations and also it's very lightweight and event-driven and also like one or another thing the next thing is like four tolerances it allows like us to sort of like crush if one actor fails and but still like not affect the whole system then also they at that point that the dead part is like the aqha HTTP which allows us to expose this actors to to the web because like if you have multiple like a sort of like services you're gonna have to talk with them / AP ice and akka HTTP is like a very simple and like efficient way of doing this then also then another basic pieces like a lot of like what of services you gonna talk to is going to be through API so you need very intelligent what you can all very functional Jason passes to like receive data from across multiple services because you're not working probably with 17 you need to be able to pass data from whatever service or whatever it is that you're gonna do then sort of like the Lots sort of like final pieces but the most important is like we use the sky like a logical it skala see in like the scalar C module for slack and slack boats why did we use the sky lasyone it's very easy to set up as I offshore then also it's a cup base then why did we choose slack I think if you've used like it has like multiple rich integrations from across mail to the services from whatever you can think of you can you can almost certainly find the integration with it then also it's a real-time API then other than just like it being great for building bots it's also a great communication channel for the team as a whole so you can sort of like River age spots inside them but also be able to use it for you normal day-to-day processes so building using a skeleton the skeleton Seymour it's very simple like the first thing you what you need you define it or what you call it sort of like a main module which is a poor tryna which you sort of like initiate why'd you call it the app and it causes like as you can see like the system where you initialize what you call it the actor system then in event pass then you create the boat using what you call it the skull aboard Ada and what's called a boat's bundle which are shown next then like if you're gonna use a what you call it out an actor system you also need to think of like a you also in need to implement a shutdown hook so that like after it done something you need to shut down and close their illogical director then the next company is what I talked about is their boats bundle where you define I think as I said like you're trying to integrate multiple things so with the boss vandal just like define which applications and so that you can sort of like separate them across whatever you're trying to do so we can have one board for AWS you can have another board for sumo logic another one for chef or another one for just chat so that like if you decide to add integration it's very easy if you decide to take one off it's just like stop calling that and you don't have to like a sort of like read it changes to zoom in a lot of weight so so example of like this say you want to build a chef board like I using the skela see quite easy what you only need to do is like implement two things which is one sort of like the hell method which will like sort of like like if you're going to explore something to users they want to know like what that thing is doing so they help what you call it a method will sort of things where you define what the bottoms are not doing like what are the expected actions and what is what are the expected responses then the second thing that you're going to need to define is the Act which is an actor which you would tell the system like which defines the behavior that it's supposed to do when you to receive the command so like sort of like implementing our continuing implementing our chef board so let's say I want to do let's say chef's knife job list which is sort of like list the jobs that are there for chef you can is using like what you call it pattern matching you can easily do that then sort of like implement using the get job list which is like the matter which you do whatever you need to do and we can do it for another combine let's say using against pattern matching you can do case coma and chef jobs that in et Cie for like multiple jobs then the last method is I said like that the deaf which would define like what you call it what sort of like will give the user the expected in protiv of how the one I use the system and we can do this also for what you call it for GF for jira create another board define a bunch of actions and whatever what you need to do and you can also go more adventurous i think is one of the stuff that we've been using is like a we can we've implemented so that you can do like reviews within like the same channels that you're using so I let's say I want to push a code review which is usually for trivial it's a my code day again just like within the same sort of channel that people communicate I can ask for a code review and people without having to like send them emails they can like and easily they can sort of like look at it and sort of Bath's respond to the boat and say or looks good to me this then the code review number then it would continue acting until like somebody says with a minimum number of requirements I said then my court is reviewing this gets pushed into production so like and then we also have implemented to the boats for like multiple other things from chef storm Azkaban jira data Chronos sumo logic or even like Katrina lens and like food catering so probably another question that you might be wondering like why slag ports in terms of offices like no more scripts cause like I'm sure like every like their verb or like every engineer you have the ultimate goal is to automate things and probably have scripts for this but so why is the why you slack boards business just like having script I think for us like one of the biggest things that have scenes like we have a single source of information you don't have to check multiple emails like we did the same night communications channels that you're using with people is where you'll get like you can interact with potent automatically do your actions or like run jobs from there without having to like either log onto a laptop or log on to the service itself then also are what's cool about it's like actionable insights you get a message saying something is broken and you can act on its in the same channel which is different from like having it like say you get a page of duty notification then you have to like move away from then you have to like you log on to something then also in terms of like since we have like multiple companies multiple systems that we are running mobility is a key issue people can run jobs from the train people can fix stuff from wherever in the plane or at home which makes us which makes our sort of like our life easier but we sort of like helps us be more productive then also in terms of visibility in the same channel we can sort of see who s than white or like what needs to be done so that like it's sort of like it helps everybody you know just like a one person who's dedicated for let's say for a week in terms of tips of fixing things and also like our another good thing another like important point boats are very cool so yeah try it yeah so sort of like just to wrap it I want to live a couple of minutes for sort of like key takeaways yes automates steps as much as possible and figure out like what's the best way to like sort of spool up software in resources and I think what we have seen using slack boards I what you call it for us is like a we have moved from having sort of like I'm a data scientist but like I'm now able to do some of the dev of operations that I was previously not able to do so it moves away from having deep thoughts as a dedicated team but sort of layers a culture for the team like across data scientists so what you can software engineers then also like if you design for reuse you can also like I sort of just simply move one button just like change the actions for what you call it to implement another X another another functionality then one last thought is good from this guy alexandra if the depth of this dead long live death of but like I think the point here being we devil should not be like sort of like a function function dedicated to people but also like trying how we figure out like what's the way we can use like it like what are BOTS so that we can a sort of like helps pull our resources and also be agile in terms of our operations with that if you are curious this is also sign sign from well we have some of the things that were working across like a Roku prediction I oh and meta mind and if you're interested as you recruiting not like get send an email to Einstein recruiting at salesforce.com and with that thank you I'll liver if I'll be open for questions can you yeah yeah yeah definitely I think it's because we sort of like it's our what you can't slack users sort of like embedded with a logical with an active directory we can easily like see like with this with the person is and like what are the some of the privilege is starting to have so before we sort of like send it to a service we can check against the white chocolate our active director or in terms of like the permissions that they have cool all right thank you [Applause]