 Yes, you can hear me My name is Nikhil Vaze and you're here at the managing microservices at scale with open stack Docker So here's a little bit about me I am a software engineer on the electric cloud engineering team and you can find me on GitHub and Twitter over here So just a little bit about electric cloud to kind of frame the rest of the presentation They're just about just a couple of slides. We are a enterprise software company that Focuses on application delivery trying to get Software out faster for our customers and users Everything from when a developer commits all the way to production So that's just kind of our industry in our space specifically I Spend my time on our integrations and plugins. I'm the team lead for for this group and we You can think of all the different tools that exist Be it source control app servers issue tracking So we have to have plugins for all these different pieces so people can construct their delivery pipelines With using these these tools See so my general my experience about Docker is I'm ace the co-organizer for Docker Santa Clara. So this is in California in the United States and Took part of the Docker hackathon in 2014 2015 and In 2014 we was part of a team that did that did well So just humor me for a little bit of audience participation for me to gauge Who here is heard of Docker if you can keep your hands up, okay? If you've typed Docker run keep your hands up, okay, great If you use Docker and Dev and test keep your hands up Okay, if you use it in production keep your hands up. Okay, cool and The last one you've exported a Docker container and you've run it with system dns one. Okay, great. So You know, it's funny one year ago when I asked this question at the DevOps the the enterprise summit in 2014 in California the drop-off was everyone heard of Docker and then when it was come when it came time to Docker run everyone put their hand down and It's just remarkable to see kind of Pretty soon these these next slides. I won't really even need Because everyone will know these so I guess real quick because everyone is mostly familiar with with Docker You know, why are people excited about containers? So when we when we talk to our users? This number one, you know, it typically starts or how we're seeing it. It starts in dev and test So developers really pick it up and they're excited because now they can encapsulate their Software tool chain in a container. So to give an example If you want to do a maven build in the past You put what we did at least is we put maven on a network share then our build lanes would reference that maven the maven binary and If we wanted to upgrade maven or if we wanted to use Python We would have to go through a process where we took where we filed a ticket Got it to put something on the network share and now it would be available to our buildings now I think that's still there but nowadays people are putting the tool chain into the container and Distributing the container across the build agents. So this is just maybe from personal experience where that's where people start and You know the so the rest are you know just development production parody Container the startup times are really really fast if you've ever I guess you guys have Done everyone has done Docker run so I won't get it get into that and finally Microsoft is on board so you know the fact that typically I have a Windows laptop and My Windows experience with the Docker CLI is great It works and it almost worked from the first day you know and why that's a credit to Microsoft and the Microsoft engineers that made that possible and typically, you know with previous open-source tools like Vagrant it for example Windows support was kind of a Distant second, you know, maybe even third so it's just exciting to see to see Microsoft making these changes. So I don't know if there are any employees in the audience Okay, so real quick, you know docker. It's open source used to wrap LXC. It's really really fast I'm going this I'll just I'll explain this as if I were to explain to a co-worker What the value prop of Docker is, you know VMs? We're all we're all familiar with there's a hypervisor Take that away with containers. There's a little bit of kernel that's shared in between the host and guest all Docker is doing is Wrapping the core Linux primitives namespaces C groups and they've implemented this in go it used to be called lib container now It's called run C so on Linux all they're doing is wrapping the Linux kernel and go and on Windows They're going to be I guess doing the same for the Windows and nano server. So over here. You can kind of see the the Docker client that's the CLI it must be attached or talk to a Docker demon and typically that's always Linux now that's changing with Windows and Most of the times when I explain this Having kind of a diagram. I guess it's a little bit hard to see but Let's say we have this laptop. There's a CLI. I must point it. So this is a Mac laptop I must point it to a Linux box typically Running the Docker demon this way you get Docker installed on your host but really you're just controlling another it's like a remote control for a VM that is running a Docker demon and In the past, that's where I've seen some misunderstanding. So okay, great. We've Everyone is up to speed with Docker. So let's let's talk a little bit about microservices. So Docker in fact a Docker con I believe the t-shirt the back Kind of written in the back was like a monolith or container a day keeps the monolith away so hand-in-hand with Docker's popularity microservices have started to become popular and the reason these are the reasons why and Originally the CTO of Electra cloud kind of presented these I like them. So I grabbed a bit So I might be a little bit choppy here so, you know people are really excited about microservices because it provides I guess this two peds what Amazon calls like the two pizza teams, you know, you can grab teams segregate them and work on small pieces and then combine them together and Actually what I kind of Amazon says this because if you look at AWS, I know this is open stack But even actually similar to open stack, you know, there are each individual service that is independently managed released and typically has a rest API definitely an open stacks case and You know, you can group them together, but they're not necessarily coupled with each other So, you know, what are the good and bads about monolithic applications versus, you know, I guess with with monolithic apps? So, you know, it's when you have one code base. It's It's pretty well Testing is never easy, but it is easier than testing microservices app when you're starting out It's pretty easy to do one series of either vagrant files or or docker files to Create a consistent development environment and that's why people think it's it's sort of easier to develop and one thing is easier to Deploy than than many. So, you know, what are what are the what are the bads? So as an application grows it becomes harder to see where the delineations are from module to module or perhaps you didn't use any modules and it over time it becomes hard for onboarding harder to to to take different pieces out and put new pieces in and This this particular one about harder to adopt new technologies if you are Shipping the JVM and you have a JVM app It's harder to Take a go to adopt a service. That's or In, you know, within your product to adopt go lang or python So this is kind of where microservices really come in So, okay, great. What's what's so cool with with microservices? So now there's loose coupling and typically it is a rest rest API or the network if not rest then, you know MQTT or something asynchronous but usually the network and and With scaling and monoliths, you know, you have to scale everything or you have to you you have to scale the entire monolith Here you can scale individual services So the I guess what I It's kind of first-hand experience, you know, we chose Go lang for a new project because of the way it has statically compiled Binaries that's easy that are easy to distribute. So if they're so our use case we are typically a JV we use the JVM quite a bit but for a new project we want it to use go lang and Now people can use the so there there are two ways you can You can use the technology that you are most productive in so with teams think of acquisitions or A new team in a new geography, perhaps they don't want to be bound by the original technology stack or It I guess you get to choose. Yeah, you just get to choose the technology. That's best suited for your business problem So we've already talked about two person or sorry the two the two pizza teams. So okay, great So microservices monoliths Should I you know, should you use microservices? so what what we're trying to say here is There are a lot of prerequisites or things you should do before you just jump on the microservices bandwagon and kind of the bottom You know microservices are not a magic hammer. That'll make your other problems go away. So You must have CI if you think You know CI and good testing if you think managing one thing without automation is hard imagine 10 20 and Yeah, that's that's typically that's really the three bullet points here You know, what's difficult about about microservices? So when you start off in a later slide the the kind of the Guidances start off with a monolith and break it up into microservices. That's kind of the guidance But okay, you know, everyone is solving business problems. Where do pieces start and end that can be difficult When much like the the build automation piece when you Have one thing when you have a monolith and you have one thing to monitor it is perhaps easier than Monitoring 10 pieces and I guess not only is it it's more than just monitoring. It's you know logging Everything is on the network. So each of your services if they're logging a response that response should should agree on a format So it's called response like R ESP. Don't don't call it RSP or R You know, keep it consistent across all of your microservices. Otherwise, you're going to run into problems So, okay, am I am I ready for microservices? You know the so Martin Fowler the general guidance is no first start with a monolith then move to a microservice based architecture solve your like figure out your business problem and then go forward for model to microservice and You know automation and monitoring you need to be you need to those are prerequisites before you can jump into this So here was just a funny tweet that Marius Mars to see a scent which was if you don't this is a consequence of not keeping monitoring Doing monitoring correctly. So we replaced our monolith with microservices so that every outage could be more like a murder mystery Okay, so Great, we talked about Docker. We talked about microservices To combine the two Containers are a great way to ship your microservice. That's kind of implicit, but Now that you've had you have many now that you've broken up your monolith into different pieces Each piece can be a container. It can be it can be deployed And you can enforce some level of consistency with a Docker So let's talk about continuous delivery or you know delivery pipelines. Let's just let's just go with this so this is kind of the example of a pipeline back in the day that's a monolith and These are kind of the individual pieces. So, you know, you can see this is kind of a dated slide based on like subversion, but this is really what it takes for a commit either pre pre-commit or or really you check in all the way, you know to To check in time or really to where the The build artifact gets produced and published to an artifact repository. So over here, okay the codes that in subversion, you know over here the Let's say if it's if it's Java the the maven module gets published over here so okay, so source control and artifact repository the other thing I wanted to call out was chef or configuration management typically people would write or they still do they write Chef recipes or they write a blueprint of how you want your Middleware, how do you want your wild flight configured installed? How do you want Tomcat, etc? so as we move on to Containers that changes slightly or at least in my opinion changes slightly. So here's now a pipeline of a monolith but that that is containerized and the key differences are instead of a maven artifact that gets published now there's going to be a docker container that gets published to the docker registry and Because right the you know, I would be negligent to not mention Of course, we have we have open stack, right? So when you are When you want to spin up a integration environment and and perhaps if you want to deploy to production the kind of you know over over here You can spin up on-demand kind of per that scales as your dev organization scales and you can you can definitely use open stack for that and What's nice is you know once you've containerized things it actually it isn't make You get a little bit of cloud agnosticity, you know, you can sub in or sub out different different clouds Okay, so let's now go closer to a microservices pipeline and I promise this is leading somewhere So, you know, the first three are are these three are just Pipelines of individual microservices and I've kind of omitted, you know, the where open stack fits in you can imagine that perhaps It's after building and testing the container like where do you test it or perhaps? it's after you've aggregated all of the containers and you want to Deploy your application That's where you can also, you know deploy. Yeah, so over here deploy the integration environment, so I guess the the point I want to make is Some people call these upper three like lower and lower build environments or lower pipelines that are necessary to To deploy your application So you have least lower environments or lower pipelines that publish your code to a docker your docker containers to a registry and now your application is made up of five ten containers and The combination of all ten get deployed And that is your application. So all ten of them get tested together As kind of shown at the bottom over here Right, so okay. Yeah, so I wanted to do a before and after of hey, you know, we've talked about monoliths We've talked about micro microservices the assembly piece is actually kind of similar, you know the Palm files have dependencies of what what jars you should have you know maven So I've been taking a Java or I'm explaining this via Java terms because that's what I feel comfortable with But if you're a Ruby person or if you're a node person, you can probably mentally substitute Substitute in those those technologies. So all I'm trying to say is here is that the assembly piece bears some resemblance between monoliths and and micro services So, okay, I've given a lot of theory. I don't know if they're top gear fans in the audience But given all this theory, I was like, okay, how hard can it be? Let's see this in reality So what I'm about to show you is I'm gonna go step by step and talk about an application. Let's see Okay So we're all here because open stack. We love it. We use it, right? So how how are we gonna combine these pieces? There's open stack. There's containers. We just went over there's a monolithic app that's gonna get turned into a microservices app over here and How do we put these all together? Okay open stack is kind of you know the the substrate Now we have a lot of these different environments summer production summer test, but overall this is what we're going to do and The way we're gonna do this is via a or the application that I'm gonna take from a monolith to a microservice is a dashboard specifically a dashing dashboard and All of these will be you know this entire dashboard will be deployed on to an open stack cloud Historically, you know if you look when you think of microservices or one these these companies go up and they talk about it They they show Twitter and they show okay the ads or one service and the tweets are another or Spotify You know the recommended tunes so in this case Each individual city will be a microservice eventually so at first everything is a monolith and we're gonna split things apart Where each of these widgets or each of these tiles will be will be a microservice So here's the weather dashboard as as a monolith and I'm just kind of reinforcing these screenshots are from from electric flow And I'll give kind of a disclaimer In a bit, but here's just you know, I showed kind of the abstract. This is the practical of okay here's here's a pipeline and What's interesting is you know these days everything can be done or okay not everything But it's fun to put new things into containers and one thing that I did was the in the testing phase I used I used selenium inside of a docker container and that's not something I've I've done before and it was so I Think it as we talk about testing in parallel and testing one thing to testing ten things It'll it'll become relevant, but a shout out to Dave FP. He was the one who created the weather widget over here And I just kind of build on top of that So here is the weather dashboard As a deployment piece right so there here's our monolith There's one container that can that has everything and how okay great. We have this container What do we do to deploy it? We get an image we run the image and we create some links Okay, so that's the monolith and here's so Yeah, so I'll go through this via a video in a bit. I just want to I just want to run through these slides so Okay, so now a microservice right again kind of the three stages pretty similar and they're going to be 17 containers so selenium The fact that you were running selenium inside a container Okay, now we can scale up and down those tests that have to be done per service per microservice But there are still I I think there are still improvements to be made for for testing But I guess that it'll make sense in a little bit So the the one kind of caveat is Doing this implementation. I introduced a little bit of coupling so I think you can maybe see it here dashing at least out of the box there was no clean way for a Microservice or a component to show or share UI so there's this serialization at the top where it's I get The the dashboard that's just the layout and now each of these 16 different widgets run and These the 16 if something if something fails, that's okay one widget doesn't show up but if something happens at the very top that's a problem and I think as people go from a monolith to a microservice though Just as I ran into this they they will do So a few words before a demo You know everything can everything that I'm about to show you so you know, I'm an electric cloud employee There's a community addition. So everything I'm showing you can be shown here can be can be accessed here. However This is not a product pitch, right? So I am passionate about software delivery electric flow is sort of my canvas and it's easy for me to implement things there So if you have another orchestration tool of choice Whenever I say whenever I mentioned the kind of terminology in the in the product that I'm working on you can translate it So so I was going to do a demo a live demo actually, but I don't I don't have internet so Yeah, so we'll have to go with this video that I That I made but my timing is is is going to be off a little bit, but we'll have to Have to go with this, okay So over here, I'm just showing kind of the different applications so Relevant to our discussion for this talk are the monolith and the microservice so I didn't clean that this is a previous run. So I'm kind of five and six So let's see Okay, here is the you know, I show this in a screenshot here is one component It's a doctor container and it houses everything the front and the back end and The deployment piece. Okay. This is you know getting the image running the image and the links All right, so how do we kind of put this together in a pipeline? I'm gonna I'm what I'm doing here is I'm executing kind of the monolith pipeline so I showed kind of the definition and over here we're building the one container we're testing the one container and In particular what I want to show is the the selenium tests that get run So when you're advancing through a pipeline, I think it's it's important to show having automation That's great. You need to surface that to your users so it can be you so Okay, so So decisions can be made based on that automation. So over here. We see kind of a default selenium result And here's kind of the test suite. It's very I don't know if anyone has written selenium. This is a very very basic Very basic example, but you know, we can see the results and towards the end we've taken a screenshot So, okay, we see this and we're like, okay. Hey looks good You know the selenium tests have passed the application looks like it's in a good state Let's go ahead and publish this So I think in yeah in this example, I have two kind of manual approvals the publishing and then finally going to deployment and On my on my internet version. I took this out I just kind of combined the the tech the publish and deploy so over here. We're just shipping it and So now we've taken a monolith Built it test it put it on a registry and now we're deploying it and we can see over here, okay Was a little bit too fast Okay, we can see kind of the you know the widgets and So, you know, this is a global conference and so this one isn't in Fahrenheit because that Makes sense to me. I grew up with that. Don't worry. The next one will be in Celsius So we don't give anyone out So over here, I'm just doing a little bit of cleanup. I should have really edited this out I I reuse the same open stack environment. So what I'm doing here is I'm doing an undeploy. So I deploy the monolith I'm undeploying the monolith and then we're I'm going to run the the microservices application So, let's see. Okay. So the unemployment succeeded and Here we have Yeah, here's kind of the The layout and and one thing that that really comes up In my experience is the UI or any UI, right? When you are trying to figure out a problem space you eyes are great and they allow for experimentation at a certain point there is a Gap right where it's like, okay, I've done something as a proof of concept now I really need to implement this in production How do I go from one to to 16 or to a hundred typically central tools teams get run into this? Or if you try to do something for real So what I actually did was I use a DSL or I use a scripting mechanism, right? So you take one and You just put a loop around it and I think that At least the DSL aspect really saved me a lot of time on the demo But I think that as As we go and go into microservices even this actually can you imagine kind of like making this in the in a UI As we explode and deploy more and more things. I think it's inevitable that code Comes in to ops and into production where Yeah, you need to define your process as code Otherwise you will You'll have to kind of modify XMLs or use UIs and at least from as a dev I prefer it in code so here is Here's the microservices pipeline and it's it's it's pretty similar the one thing This is the assembly piece and how I modeled it So now great you have all these containers when it comes time to deploying How do you specify which containers to use? So I specified a JSON Lob kind of upfront saying what's the city and what version of the container I should use So again, you know, we retrieved all the microservices. Okay Now we're testing them and the difference now is each microservice So I stopped at three, but you can kind of imagine These going to 16 or 50 or however many you have Now you have all of these individual test results that you need to look at and make a decision on and Yeah, so over here. I'm just kind of showing the same the same kind of selenium test Okay, so Now that we you know the selenium test look good. Let's ship it and This deployment In a second we will see a A link to the to the dashboard and then I guess we'll see kind of the individual widgets Updating one at a time. So, okay, so here's the dashboard Okay, and yeah as the deployment is happening now the individual widgets are getting updated and Yeah, so that was that's okay, and it's Celsius so So no one's left out. All right, so I guess I'll at this point. I'll just kind of say some kind of concluding thoughts or As I was creating this or through my experience, you know, what were some some of my thoughts? so Selenium and Docker so okay before it was testing. Hey When you have a monolith, there's only one thing to test when you have microservices. There are tons of things and Selenium and Docker were actually kind of a natural fit even though that's kind of not That's where you run Selenium is independent on if you go through with microservices or not From from experience, I feel like a lot of organizations skip UI testing because it just takes too long You know, you can't run your entire test suite without bogging down the process I feel like this is just an area that for improvement, you know, sort of how do we tame this type of technology? and I know that you know Selenium has Selenium grid and all of that but That this middle piece is I maybe it's it's controversial to me or I argue with some people I'm still undecided about packing it all into one container. So what I mean by that is If you look at so the Docker container that I use for dashing was based on an open source version like I think FR VI slash dashing and There were volume mounts. So the idea was you take a container and then you volume mount in your code and you deploy that unit and What I did actually was I just packed it all in I removed the volume mounts because they don't Sorry, they don't they don't get versioned or if you commit them At least that's as of today. They don't get versioned. So I feel like the If you if you don't pack it all all in, you know, you have some interfaces or you lead It's easier to reason about what is going on in this container and why even though it gets harder to deploy in ops, but I'm still kind of I've done it both both ways and I'm flip-flopping a little bit The other part is There's just so much I showed it some pipelines, but I left out a ton, you know Deploying I deployed all the microservices. What happens if you want to only update one individual piece What happens if you want to do zero downtime or rolling rolling deploys or or rollbacks? And I think you know as your applications explode The the rollback becomes even more important or the rolling deployments become more important and So I think Mean time to recovery I think and mean time between failures. So this also kind of ties into selenium where You know You would like to have a robust unit a robust testing environment or testing practice within your organization, but practically You can only do so much between and business deadlines happen and you need to ship software, right? so As we increase complexity, we may have to consider changing our deployment practices such that It's easy to roll back and I think I've seen I've heard Facebook do this with with mobile apps actually where they seed their kind of most loyal or Staff or people who opt in for their alphas and they really instrument the data and they Take a look at Okay, let me back up because mobile devices are so so many and so frequent especially on Android That they basically said we can't test every single handset, you know So we'll release this into the wild we'll look at the the metrics and the people who opt in for bleeding versions will review their data before pushing out the actual application to the entire world and I think that piece in mobile. I think we're gonna have to to bring that in to kind of the back end or you know, this this microservices architecture and And and for what I did, you know with the weather application it was it was cheating a little bit, you know They all query the same back end a more representative or a more perfect example would have been querying different things or different endpoints and Not all of your services will be created equal. So that's just kind of the last the last piece So, okay, so resources right here's some resources Martin Fowler, of course the book the O'Reilly book. I believe building microservices Or or perhaps I I got the wrong one I think you know surprisingly for me at least D zone actually has a really good series of posts And with that Yeah, I guess I'd like to open it up for questions Sure, I don't know if you want to I can repeat the question or if you want to go to the mic You showed us is basically based on the traditional Application to develop a little life cycle see our life cycle But in reality, we have to manage there always and middle a part of the counter image Is there any good way to manage or send a middle a part of the image in conjunction with application layer? Yeah, so the question was that hey in the pipelines I focused on I glossed over the middleware aspect and what are some strategies, you know to To manage that so You know, there's some open-source tools like Packer for example that go from a blueprint and result in to a docker container I believe even the configuration management tools that they also Provide an ability to to build containers So yes, you're correct. I did I did leave that out so In that that would be just yet another pipeline or another piece of your application manifest, you know Hey, which which base image or where do I? It's another input Okay, yeah, so, you know I so I said earlier I I was part of the electric flow plugins team so we've written a Driver or sorry like a like a plug-in that calls the open stack API's So what we did is we so I? May actually have this week. I ran this on helium I don't know if anyone else is sad that helium is going away, but yeah, we provisioned these two these two images and Yeah, so we provisioned it via the rest API then we had a an agent actually running on this VM Sorry containers running on a VM running in a tent. Yes. Yeah No, it's this is just a new bun 2 image Yeah, it's all running on one VM Yeah, so that's another okay. I see where the question is All the microservices that I now that you see this this image, right? Yeah, I put them all on one one VM. So you can imagine so You know last week at At another talk I split things up into different VMs the problem or the problem I ran into was you need service registry or service discovery otherwise it becomes really hard and For this demo, you know, let's just we'll just minimize this No, it's In order for a complete example. Yeah You do need to put these into Individual or more than just one or two Yeah, so what I did I reused an open stack environment so instead of kind of the deploy and tear down Just like I had instructions on how to take an application and put it on I have the instructions on how to clean slate it So since everything's inside the container all I have to do is undeply the the oh, okay the containers So that's how I cleaned it up All right. Yeah, so I just got the notice that times up So thank you open stack for for inviting me, you know for this Thank you