CI Showdown with Mike Hall and Ryan Gerry | SCMC 2019

• UGtastic Archive

CI Showdown with Mike Hall and Ryan Gerry | SCMC 2019

Loading this player connects your browser to Youtube.

Full Transcript Available
LIVE CC UGtastic Archive

Press play or click any turn in the transcript to start real-time synchronized playback...

Ryan Gerry compares TravisCI and CircleCI (00:00-51:09), followed by Mike Hall presenting GitLab CI/CD, runners, build charts, and self-hosting trade-offs (52:00-79:05) at Software Craftsmanship McHenry County in November 2019.
The Guest

Ryan Gerry

Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI)

The Guest

Mike Hall

Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD)

The Presentation


Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
All right, so let's talk about two CI systems. But first of all I want to talk about my background with CI just so you know where I'm coming from. So I started using it in 2007 with ThoughtWorks open source product called Cruise Control. Some of you may know of it. It had a web interface and it had a fun XML configuration system. This was back in the day where XML was considered to be like high art so that was how you configured it. And then in 2008-2010 I worked with different proprietary systems and then starting in 2011 I started working with self-hosted Jenkins. I was like blown away by how easy it was to configure at that point based on what I had seen in the past. And then in 2014 I started a new job and they were using CircleCI.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And again I was blown away by how easy it was. Like every time I came back to it every system was getting better. And then in 2018 my company started releasing various open source libraries and for that we decided to use TravisCI to try something else out and see if it maybe was a better fit. So I started using Travis. So the format of my talk is really going to be giving you some corporate background information and each of these companies and then majority of the time we're going to look at example projects and teach. And as a side note you're going to get a tour of some of the Blue Marble payroll open source packages.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Alright so start with Travis. So they were founded in Berlin in 2011. It was a little hard to find funding information for them. I couldn't find any evidence of like private capital being injected but I would imagine they had to have had some but I couldn't find any evidence of that. But in 2012 they did have a crowdfunding campaign where they raised $134,000. On their website they had 15 employees. Crunchbase says they have 51 to 100 but that gets a little bit more complicated and we'll get into that in a second. According to them they have 900,000 open source projects, 600,000 users and they have some you know knowable open source projects that are using them. Ruby on Rails and the Ruby language are two of the biggest.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
They have an active GitHub repo. If you go look there. In theory you could actually run your own Travis CI instance. I don't think many people do or at least there's not a lot of people writing about it online but I don't see why you couldn't if you if you had the desire to. The thing that I, the biggest thing I learned was they were actually acquired in January of this year by a Houston based company named Idara and there's actually some suspicion that they had some engineering layoffs after that acquisition. Yeah, that is kind of a corporate situation. So I, again I don't know if this like 50 to 100 employees is reflective of the new company or how that all works but that's what I'm basically aware of.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
In terms of the feature set, they support Linux, MacOS and Windows. They do both x86 and ARM CPUs for Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux. I think they only do x86 for the other two. You can bring your own custom Docker engine if you want to but you can't really do that with Linux.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
open sourced it called Dave Holliday's Reader. So I'm gonna do a demo of the Node module so you get a sense of what it does, but the Ruby wrapper is, I don't know if you like it. Okay, so this is the Node module. So it lists holidays for a ton of different countries. And so we're looking at Canada, and it looks like the UK. So it does different regions as well. So it's interesting to note that in Northern Ireland, they celebrate. - March, Wednesday. - Yeah, March, Wednesday, because apparently the Dutch invaded Ireland, I think, during the British Civil War, but I haven't gotten that far in the Revolution podcast, I'm not sure.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Pretty sure that's what happened. So anyway, this Node module, the way it works is that it actually defines a grammar that you can use to specify a holiday. So the dropdown for the year only goes out to 2026. For the year 3000, it would project it out. So it's support for Gregorian calendar, some Jewish calendars, Islamic calendars. So it has a lot of calendar support built in, so you can define the rules for the holidays using those different calendars. So that's the way it works.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So it's a pretty cool thing. I'm actually a co-maintainer, but I did not write the majority of it. So, but anyway, what I did write was the Ruby wrapper on top of that. So that's what we will be looking at for our example project. Alright, so here is our first sort of simple travesty I wrote. This is actually what's on master of that Ruby gem if you were to look at it now. So I'll break this down a little bit.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But both of these systems, do you want me to turn down the lights? Is that, I don't know if you can see it. - I think we need to dip 'em. - Yeah. - The video won't care. - Yeah, the video won't care, you will. Okay. - Both systems use YAML as their way to configure your build, essentially. So let's kind of walk through it. So the first part is saying this is a Ruby project and we're gonna cache the bundler dependencies and the YARN dependencies.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So bundler is Ruby's package manager. And since this project is a wrapper for a node module, that's why I'm using YARN 'cause I'm keeping track of the JavaScript dependencies with that. So that's YARN's package manager for node. And then I am running this against four different Ruby versions just to make sure that it works on all those. I mean, the gem spec, one of those gems is that it works with . So I'm testing all these versions. And then this is, before it runs it, it installs the bundler gem, which is, again, a package, a package manager, which doesn't ship with some of the older Rubys.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And then I have a setup script that does some node building stuff. And then the actual script of the test suite is to run regspec, which runs all my unit tests in Ruby, and then it also runs RuboCop, which is a static linting tool for Ruby, just to make sure I'm using good style and that sort of thing. That's pretty much it. So when you actually run it, this is what the UI looks like. And let's kind of zoom in a little bit here. So this is the top.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So we can get a bunch of metadata about the build. This is on the master branch. We see a commit message and the runtime, when it was run, commit shot, and boom, push the commit. And then actually below this, this is the job information. So it actually runs four separate jobs, one for each of those Ruby versions. And it just runs the entire suite on each of those instances to get the runtime. So you can drill into each of those and see the output of everything there.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So if we look at how this gem is set up right now in the master branch, it's actually not ideal. So it's not ideal because the gemfile.lock is checked. And some of you might be thinking, gemfile.what? So all this is is a file that-- it explicitly states the exact versions of all your dependencies and all their dependencies and so on. So it's a snapshot of your dependency graph. So if you're used to know, this is Ruby's version of the ARM. There's other things like this in other systems.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Now, normally, this is something you want to use. If you're an application, you want to check this in so that it's reproducible, so it's not just, it works on my machine, but not someone's machine. The problem about using it for a gem is that it's too much precision. I don't know, as the gem author, what someone else's application is going to have installed. I do have some minimum requirements of certain gems, so a certain gem that this library needs. But those might not be exactly what someone else has.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And they're really-- I'll just show you real quick so you get an idea of what the gem spec looks like. I think this is a little bit bigger here. OK. Here's the gem spec. So this is how a gem specifies its dependencies. It says, add dependency, and there's a gem name and the version number. And these are all development dependencies that I would need to develop it. But when you actually install this gem, it doesn't install any of these, right?
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But if you were to install this date holidays reader gem, it would actually install access hashable, caution, and OS. And I'm saying for-- access hashable needs to be roughly version-- at least version one. And OS needs to be at least version one. But version two doesn't work, for example. But I may have tested it with OS version 1.1, but someone else might be running 1.2, and it might break. And I might not know that as library author, because my gem file dot lock is too specific. The whole point is I want to kind of know what the range of possibilities are.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
OK. So-- So, yeah, too much precision. You generally don't want to check in the lock file for libraries. You do want to check in for applications. And if you're interested in more of a discussion around this, I have a link to a blog post that goes into more detail. But that's the gist of it. Basically, too much precision, so we don't want that in this case.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
OK. So here's my goals that I want to keep in mind as I remove this lock file, and specifically around my CI build. So I do want to discover, in the future, using CI, when a new version of one of my dependencies is released that breaks this library. And in theory, if everyone is following SemVer, that should never happen. But people make mistakes. That's all right. The point is to discover it sooner before users of this gen do.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I want to keep things reproducible, right? The lock file is great because it is reproducible. I know exactly what was there. It's great. And then it's handy because I still want the speed of my build. I don't want it to slow down by not caching. And I do want to clean it up, so I do want to remove it from Git. All right. So here's my solution. In order to discover dependency changes that could break things, I want to run a build monthly with the latest versions of everything.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And for reproducibility, I want to save it. I want to save that gen file.lock off so that if something does break, I can just pull it down from CI, try it on my machine, and be able to reproduce it there. And then for speed, we're going to continue caching the gen dependencies. And yeah, we're going to remove that file. So we're going to beat that cleanup goal. All right. So here's how we're going to do it in Travis CI. We're going to use the artifact add-on. We're going to put this at the bottom of our file.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And we're going to say that we are going to save the gen file.lock as an artifact. All right. Cool. And we're going to add the gen file.lock. We're going to delete the gen file.lock from the project and add it. So after we did that setup, we need to go into the Travis CI UI, go into the settings for the project. We need to give it some Amazon S3 details. So the way this whole artifact thing works is all it really does is just uploads your files to S3.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And if you don't know, S3 is just an Amazon service for storing files. All right. Cool. So give it the bucket, the S3 bucket, the region. And we give it some authentication secrets. And then after we do that, when we do our build, we can just kind of drill in at the end of it. And it says, OK, cool. We uploaded the gen file.lock to that location. So I can go back there and pull it down and reduce any issues.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
The other thing I can do is maybe a year from now, I'm developing this gem. And it isn't working locally, but it worked a lot of time. It builds on CI. So I can go back to CI and pull down that last working gem file.lock. So in general, that worked pretty well. The other thing I did is you could go into the UI and you can say, run this build every month. So it runs it every month automatically to go through this whole gem process. If you remember back to one of the first slides, there was a step where I said, please cache my bundler.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Or stop, which is all my gems. That cache expires after 28 days. So if I run it monthly, it should be good in terms of hopefully not hitting that cache. And I do get a fresh build that pulls down all my dependencies. So some pitfalls around this, though. I wasn't thrilled with it. It sort of worked. So there's no organization level variables in their UI. All the variables in terms of the S3, you have to specify it on every repo.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Which if you're just developing a few open source things on your own, probably not a big deal at all. But my company has 29 open source repos. So if we want to rotate our credentials, I'm going to have to write a script to do a lot of that. And then you have to do the AWS setup yourself, which isn't too bad. But I had to think of things like, OK, I probably want to auto kernel files. And the other bug with this currently is that that link that you saw, only I can go to that. Or people on my team can go to that.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Someone on the internet can't go to that S3 bucket because I haven't made it world readable yet. And I have to think that through carefully so that I only make that world readable and not my company's other buckets. So there's some work I need to do still in order to get that fully a good solution. But let's go to one of Travis's superpowers. And these are build matrices. So this is really easy to do in Travis. So in this example, we had a one-dimensional matrix or an array of rubies that we built on.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So it's pretty simple in terms of that. But sometimes you need more variation. So my company, we have a gem called db-active-record. And what this does is it's a plug-in to another gem, which is used to generate ad hoc SQL queries. And this gem supports ActiveRecords version 5 and 6, which makes the build interesting, as we'll see. So this is the build matrix we want to have. We want to support these four ruby versions. And on ActiveRecord 5, we can support all four ruby versions. But ActiveRecord 6 does not support 2.3 and 2.4.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So we really only want to build 2.5 and 2.6. So there's really six possibilities we want to build in this matrix. And Travis makes this surprisingly easy. So all we really need to do is-- if you add these environment variables after this ruby version section, it basically computes these times those, right? So you sort of get a cross product of these things. And then remember, we did want to exclude these two things. So then you can say, OK, then exclude these two things from the build matrix, and it just does it.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So really easily, you can build that out. And it just knows what to do, and when you set that up, you get all six combinations, which is pretty cool. And the way we handle the gem file is, I think there's a-- yeah, we have this AR version environment variable that gets passed to the build, and that's how it knows what to do. OK, so that's it for Travis for now, unless there's any questions about it. Does that mean you're limited to a two-dimensional matrix? As far as I know, yes, but I've never tried a cube. Yeah.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I actually have a question on your IDE. When you were showing different lines, it was like a git lane that was showing. Oh, yeah, yeah, yeah. What was that? Oh, yeah, so I'll go back to an example here. Well, here, I'll just go to it. Yes, it was. It was Visual Studio. Yeah, VS Code. There's a plug-in. I can't find it here.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
It's a good one, yeah, because you could just be on any line, and it'll-- not only does it give you the blame, but it has this little pop-up. So I can go to the commit or look at the changes. And it's something-- I'll find it real quick. Let's see. What is the package name? Here we go. Git lens. That's a good one. Yep, that's a good one.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
OK, any other Travis questions? OK, so we're going to be building on that. So we've done that with CircleCI. Just get to the right place. Oh, I have a question, actually. Yeah. So is it possible to limit which branches and things are built? I believe so, although I've never done that with Travis. I've done it with Circle, but I haven't had the need for Travis. I think in the UI you can specify that.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I'm pretty sure you can. OK, let's talk about CircleCI. OK, now let's talk about CircleCI. So my background with this, just to dig into it, started using it in 2014. It was really turnkey back then. But like I said earlier, it was the easiest CI system I had ever used. So I changed jobs. I'm now working at Blue Marble. So I got done with CircleCI in 2017. And that was around the time they were switching versions, which I'll get into more.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So about the company, they were founded in 2011, again. They're a VC-founded value company. They've had $115 and 1/2 million in investment. And about a year ago, my YouTube stream got started getting bombarded with their ads. And they were like high-quality, produced ads. And I thought, huh, they must have gotten some cash yet. So they have money to spare in terms of advertising budget, at least. They have 250-plus employees. And according to them, they have $2.5 million monthly open-source jobs.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Yeah, so I don't know how you compare that exactly to the projects thing. But that's what they're reporting anyway. So their feature set is bigger. So they support Linux, Windows, iOS, Android. I believe they also support Mac OS. I think that's-- I think that was an omission on my part. But unlike Travis, they only support x86, or technically N64, CPU architectures for Linux and Windows. You can bring your own Docker image.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Oh, and this is really a killer feature, especially when you're testing your own app using some full-stack framework. You can actually connect to the remote build machines. So you can actually-- you can just log in, you can forward an x window session if you want to see a browser-based test happening. So when you get into a complicated situation, it's very, very helpful to be able to do this. I don't have many demos of this, which is why I'm kind of playing it up now. But it's really a handy thing.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And the way it works is you can rebuild the job. And one of the options is rebuild with SSH. And then they give you connection information. And you have basically 10 minutes to connect to it. And you can stay on for longer than that. But that's kind of how it works. So you just accidentally press that, it eventually times out. Again, they have a free open source option, which I'll get into more detail on. They have this thing called Workflows, which allows you to combine different builds together.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And there's more on that later. And then they have a marketplace for open source orbs, which are essentially packages of common functionality. We'll dive deeper into that. They support both GitHub and Bitbucket. I think Travis only supports GitHub. They do have a command line plant that's really handy. And that command line plant allows you to do local builds. And they have native support for build artifacts. So pricing. Used to be really simple. It's a little bit more complicated now.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
It's not terrible. But when I was doing the research, I was a little overwhelmed. So the old pricing-- it was for October of this year. If I'd just given this presentation earlier, it would have been easier-- was based on containers. And the freemium was that you got one build container, and you have 2,500 minutes a month on that build container. So you didn't have any parallelization of your builds. And then for $50 more a month, you could get another Docker container.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
It just kind of went off that way. So if you were under this pricing model, you're still under it as of right now, so my company's still under this model. And in their new model, it's based on credits. And one of the advantages of the new model is that parallelism happens automatically, how you have your workflows configured. And I'll start with a free tier and work my way up. So in the free tier, you get 2,500 credits per week. And one credit gets you so many resources. So this is a snapshot of the table that explains that.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So it's kind of like you're getting AWS pricing here. So for example, if you have a small instance with one CPU and two gigs of memory, that would be five credits per minute. It just goes on up from there. I think that if you don't specify in your build, you get a medium. So it's basically 10 credits a minute. So I'm not going to go through this whole table, but you can see it on the website. And it's fairly complicated. But the basic idea is that more powerful machines, more credits per minute.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
They do have this feature called Docker caching, which I don't fully understand. But in order to use that, it's like 200 credits per use. So I think the idea there is that you can speed up your builds by caching things in different Docker layers. But I didn't go too deep into it. In the paid tier, so it's per seat, right? So $50 a month gives you three users. And $15 a month per user beyond that. That doesn't give you any credits, though. So you have to pay $15 per every 2,500 credits.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So if you have a small team of three people, you're paying $30 a month for the three users and the 2,500 credits. Credits do roll over for one year. And then for open source, it's more generous. So apparently you get 400,000 credits for Linux containers per month. And if you ask them-- they will give you 25,000 credits per month for macOS builds. So from what I have read, they seem-- if you need more than this or something special, they seem like they'd be willing to work with you.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But you have to talk to them. Interesting thing to note, my company's open source repos are not giving 400,000 credits per month. And before the presentation, I didn't want to go into the settings and change my billing preference. And fear that I would mess it up. But I think if I do that, or reach out to them, they'll-- I'm on the free tier right now. So I think if I ask them, they'll give me the 400,000. But I don't need it yet anyway. OK.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So version 2, I kind of touched on this a little bit. So when I first started, it was version 1. And the nice thing about version 1 was that they would take a look at your project. And they would say, oh, I see a gem file. I see these other files. This must be a Ruby project. Let me just configure this bill for you based on sensible defaults. And you can tweak it. But the nice thing about it was, you pointed it at your project, and it pretty much figured out what to do.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Version 2 is not that. But it is very flexible and powerful. But it is more complex. And they actually sunset its support for version 1 in the fall of 2018. So let's look at our first. Again, using that same Ruby gem. So we're using version 2. We talked about that. So we have a build job. And you have to specify the Docker image. So in this case, we're using a certain version of Ruby.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And it also has node there, because for this project, I need node as well. Buster, that refers to the version of Debian, which uses 20 story characters as the name. So you can go to their Wikipedia page. And figure out what that is. This is basically the latest version that's out. Notice that I'm using a CircleCI image. You don't have to. You can use your own image. They do provide convenience images for you, though. So it was convenient for me to use this combination.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So I did. So yeah, the steps are pretty straightforward. Check out my code. Install my gem dependencies. Or sorry, install bundler. Then install my gem dependencies. Then run RuboCop to make sure my source code is good. And then these next two steps in the Travis version, I had them rolled up in a script. But I blew them out here. So I need to run yarn to install my node dependencies. And then I need to actually build my project.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And then I run my unit tests. Just as a side note with this gem, the way it works is there's two modes you can run the gem in. You can run it in-- I have node installed, and I have the date, holidays gem, installed on my server. So just call into that directly. Otherwise, I ship a binary of that compiled for you. So if you don't have node installed on your server, it just calls into the binary that ships with the gem. So that's what's actually being built here. It's that binary of that node stuff.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
OK, so let's at least look at sort of a side by side. This is not an equal comparison. And the reason it's not equal is because the Travis does more because it's actually building on four different versions of Ruby. It's only building on 265. We'll get into how to do that on surface CI, but I want to point out that that's the one thing that's different. The other thing that's different is this surface CI build is not doing any caching of node modules or gem dependencies.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
All right, so what does the first build look like in UI? I'm actually going to go here. The screenshots are mostly internet broke. So what it looks like, there is a new UI that I'm not going to be showing tonight, but it's there. It's not quite baked, in my opinion. So again, you have your basic build metadata, and then it just shows you the specific steps. You can drill into the steps to see what the output is. Let's go to something a little bit more interesting. So here's my test output. And then if something fails, it'll be in red.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And it'll expand that step for you. We'll get into more of these tabs as we go on, but there's a lot that's going on there, too. So going back to this. Yeah, so we looked at that. All right, so let's dig into some of the features. So the local operations are super helpful. So there is a command line interface that you can install. So it's the CircleCI command. And so one of the things that's really handy is you can say, CircleCI config check. And if there's something wrong with your YAML file, you'll know before you push it up to the server and the build fails.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So it'll catch obvious syntax-type things. You can also run the entire build locally. So if you say CircleCI local execute, it'll actually go through the same exact steps that I showed you in the UI. So it can be handy as well. And it actually literally downloads Docker, images, runs every step. But the bad thing about this is that it doesn't ignore the cache. And I'll talk about the cache a little bit more later. But if you are using caching, these local builds are going to be slowly ignored.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I wish it didn't, but it does. Yeah, so speaking of caching, let's talk about that. So their caching system is fairly complex. It's all based on caching keys. So you can define your cache keys based on these things. So you can check some of the files. You can use the branch name. You can use the build number. You can use the revision from version control. There's a set of environment variables you can use. But these are only the CircleCI environment variables. You can't use an arbitrary environment variable, which is a little confusing.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
You can include build parameters in this, which I'll touch on more later, a timestamp, and then the system architecture, which is basically OS plus CPU type. So you can see that they want to be supporting some more CPU types, because they even mentioned it. But right now, they're just, at least for Linux, only x86. These cache entries do expire after 30 days. So it's basically a key and then a zipped up directory is the way these things work. So let's add caching to the Ruby gem dependencies for this build.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
The checkout is the same. What I'm doing in Linux 17 is I'm actually saving the Ruby version to a file. And I'm using t to print it out as well, so I can see it in the output of the build. Now, again, I can't just run an arbitrary shell command. Sorry, let's back up. So the first thing is we're going to try to restore the cache. If we find a hit with this key, then we'll try to download it. So the key is just a string with these special variables.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
All the things interpolated in. So I'm using sort of my own version. There's no way to delete cache keys, so they recommend they put some sort of versioning in them. So if you need to invalidate it, you'll just change this to 0.2. So I'm basically saying, let's look at the architecture. Let's do a checksum of the Ruby version and a checksum of the gem spec. And for this project, this should be sufficient to say that nothing has changed with the gem dependencies we shouldn't have to install them from scratch.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Now, one thing to point out here is if you're using an application, you would want to do a checksum of the gem file .lock, but we've talked about why we're not doing that for the library. OK, so you try to restore the cache if the key matches an existing entry. And then you always just try bundle install. If you do get a cache hit and it downloads the-- so take a step back. What this is doing is this bundle install is saying put all the gem dependencies in this vendor bundle directory.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So if there is a cache hit, it'll basically download the cache, unzip it into vendor bundle, and then this bundle install is basically going to say, yeah, everything's there, and it's going to happen really quickly. And then what you do at the end is you say, OK, we've gone through this work of building this stuff up, so now let's save it under this key, and let's upload everything under vendor bundle. Right? So that's kind of how it all lines up. So your first build would prime the cache.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So this is that first build. So if we look at the restoring cache step, it says no cache is found for this key. And you can see the key kind of exploded out there. And notice that this bundle install takes 16 seconds, right, because it's actually doing stuff. But then it saves the cache. Because it's new. Build number two, this time it has found a hit. So it downloads a 16-megabyte zip file. It expands it into vendor bundle. Now look at this bundle install.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
It only takes two seconds. So we can save some time. And it isn't going to save the cache, because it already knows that it exists at that key. So very much do it yourself. One thing to note about this is that-- is that you don't have to do this yourself every time. There are these open source that do this for you. I'm just really picky about this. And I don't-- I've looked at the ones that are there for Ruby caching. And they don't meet my specific needs.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
They do a decent job if you're just doing an application where you do have that gem file that lock. But for what I needed, I'm kind of ruling my own. I'm planning on putting this-- creating an open source org out of this. But I haven't done it yet. OK. So the build array. Remember, in the Travis CI version, we were building on three or four different versions of Ruby.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
We're going to do the same thing here. All right. So we need to take a little digression and talk about workflows in CircleCI, because that's how we're going to do this. So right now, up till now, we've just been dealing with one particular job. And on this image-- that would just be, like, one of these boxes. So workflows allow multiple jobs to run. They can be sequentially or parallel. Like, these two are parallel, obviously.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And if you want, you can even have a manual, like, human intervention approval step. So, like, if you wanted a human to actually press a button to deploy it, you could do that with workflows as well. I've never done it. I just know it exists. So here's a fairly complicated one from their documentation. OK. I'm going to use this for our multiple Ruby versions. And the way that we're going to do it is we're going to parameterize the Ruby version number in the job, and we're going to create a workflow to create three jobs in parallel.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
This is how we're going to do it. First step is we need to do the parameterization. So in our build job, we're going to say we have a parameter, and it's Ruby version, and it's a string. And then in our Docker-- line, where we install our Docker image, we're actually going to put that parameter in here. So it's just going to pull down whatever image is identified with this Ruby version. And then we're going to add a new section to the bottom of our YAML file, which is called workflows.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So we're basically going to say, OK, we're going to run three jobs, and we're going to-- I gave them names just so it's easier in UI to see. And all you're doing is just specifying what this parameter is going to have in it, right? These are just parameters into that new, modified build job. OK. So this is what it looks like. So yeah, they're stacked here, right? That's showing us they're running in parallel. And they all worked in this build, so cool. So this is kind of like, we're back up to where we were in Travis CI at this point.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Taking a step back, this could be further optimized, right? I could have done something more like this, where I just ran the tests in the three different Ruby versions, but I could have done the build steps in a separate job, just to make it a little bit more efficient. So I may do that later, but I just want to point out that, with workflows, something like that is possible. OK, this is where it gets fun. How does this actually work? So let's take a look.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So now that I've added the workflows, I actually have to tell it at the top of my file-- I should have included that here-- that I'm using version 2.1, not 2.0. So if I try a local execute, I'm going to get this nice error message. Can't do it under this version. You should try a CircleCI config process. So of course, I tried it, right? So yeah, you just give it the path to your CircleCI.eml file, and then you get a bunch of output that looks like this.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I'm going to try to make it a little smaller, just so we can sort of see them side by side. So on the left is my new config file, so version 2.1. I have my parameters in my job. I have my workflows defined at the bottom. This is the output of running that process command. So notice that version's 2, and everything's all static. I don't see any parameters here, so if we collapse these jobs down at a 2.4, 2.5, 2.6, and then my workflow section. So all it's really doing is just templatizing the YAML and just filling in parameters, and it knows to create these three static fields.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So you see the Ruby version statically there, the Ruby version statically there. So that's all it's really doing, right? It's just a macro system. So this is going to get a little bit more interesting as we build on this, but that's kind of the magic of the work plus. OK, so I did misspeak. We are not to the point where we're with Travis. We haven't dealt with the jump file lock yet. So just as a reminder, libraries should not check independency lock files.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
We have these goals with it, so this is how we're going to accomplish that in CircleCI. So for the discovery, we're going to run a monthly workflow with the latest dependencies. We're going to save the gem_plot_lock as an artifact. We're going to continue caching the gem_dependencies in the default workflow. And we're still going to be able to remove the prompt source control, which is good. So let's walk through that. So the first thing is we're going to create a new job parameter called use_bundler_cache.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
It's going to default to true. It's going to be Boolean. And we're going to make our caching more complex. So we're going to say only do this caching if use_bundler_cache is true. So in our monthly build, where I want to use the latest and greatest for everything and purposely not use the cache, this is going to be false. So it's basically not going to do anything with caching. Bundle install is going to get the latest and greatest from the internet. And oh, yeah, we need to save the gem_lock.lock.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So all you have to say is store artifacts. And there's a path to it. And this is our new-- so at the bottom of the workflows, we're creating another workflow called Monthly Gem Dependency Refresh Check. And it's triggered based on schedule. So using our crontab format, we're going to run this on the first of every month. And we're going to tell it not to use bundle_cache. And let's take a look at it. All right.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So here's our workflow. And again, it's only running in 2.6, so it's a little simpler. So if we zoom into it, now it's doing its thing. It's all green. That's good. Oh, notice there's no steps here about checking the cache. And the bundle install took 17 seconds. So it actually did stuff. It's installing stuff. Now, the nice thing is the artifacts-- you just go into this Artifacts tab.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
You can drill into this. And there's a gem_lock right there. So nice and easy to get here. And I think you can get to this on a public interface. Since this is an open source project, you might as well change the build as well. All right. So this is just what I showed you. OK. So let's talk about another feature that's kind of nice. You can get formatted test results. So let's break a test to see that it's working.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So we have a class called locale, which you can set the location of where you're at to figure out what holidays you want. So this test is saying that you can get holidays back in a specific blanket. It's a language. I've purposely broken it. It should say es. And I've broken it into en. So it's going to return New Year's instead of Año Nuevo. And then here's the result after I set this up. So we get this nice little thing at the top.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
I'll actually go over it in UI. We get this nice little summary at the top that has the test. And if we hit More, we can actually see what it expected and what it got. And then they actually have stats you get on your tests. So this test has failed three times in history. This is the speed of it. So some nice little analysis things are available, too. But the nice thing is this is in your face at the top. Otherwise, if you don't do this, you have to scroll down here and take a look at the build output, which for a larger project can get kind of cumbersome because this can get kind of big.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So a nice little feature. This is how we set it up. So our test suite needs to know how to store Jane in XML. And we need to let CircleCI know about that XML. And that's what it parses to show you that nice display. So the first thing we'll do for our Ruby project is pull in the RSpec, Jane, and formatter gem. RSpec is a testing assertion library. And we're going to modify how we run our tests to tell RSpec to produce this XML file. And then we need to tell CircleCI that, oh, by the way, the test results are in the test results directory.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And really, that's all there is to it. One thing that's annoying about Travis is that this was requested back in 2011. And if you go and look at the issue, it is closed. So on your face there. OK. Let's talk about orbs. So orbs are just an open source repository to kind of build stuff. So here's like-- you can search for them and see what's out there, the whole registry of them. What I'd like to show is something that I built.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
So I have a simple orb that-- it notifies Microsoft Teams of the build status, right? It sends a little message that says it's succeeded or failed. Microsoft Teams is Microsoft's answer to Slack. So this is what we need to do to incorporate this orb into our project. We need to configure security. We need to tell it how to connect to our Teams channel. We need to import the orb into our project. We need to call the steps that are supplied by the orb. And we need to include the security context.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
In our jobs, which I'll get to more in a bit. All right. So let's do the security part first. So if you go to your project settings in the CircleCI, there's a context thing. So I created one called orb global. And once you go in here, you can actually specify environment variables and secrets in this place. Very similar to how Previz did it, but it applies to any project that opts into it, right? So for all my 29 open source reports, when they get converted to this, when and if they do, we'll just all opt them into the security context if we need to rotate the MS Teams Webhook URL credential in one place.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
And as you can see, they're going to the enterprise. You can add members to groups. You can make it more complicated in terms of the setup there. You can even have different security contexts. So it's fairly complicated in terms of what you can do there. All right. So back to our code. So at the top, we're going to say, this is the orb we're going to use. We're going to use status MS Teams.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Here's where it's defined at and the version of it. And then at the end of our build, we're going to say, hey, report the build status. And by the way, here's my Webhook URL that we configured in that secret section. And then in the job to use it, we do need to tell it to use that for global context that we can find it. It's like the package for the secrets. And then there you go. So once we have it set up, we get this nice message in Teams that has a bunch of information about this build.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Oh, yeah. I do want to show you this example build, because this is kind of an interesting configuration. So remember the blown out version of the file, like this thing over here, where it was compiled down with all the macros applied? So you can actually get that in the UI. So if you go to Configuration, you can do the same thing. So our last version where this was all blown out was 72 lines of YAML. This is like 400. Because what it does is it literally inlines that orb into your test, which I'll show you in a minute.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But just to see the length, 418 lines of YAML. So it's doing a lot. Did I mention version 2 is more complex than 1? Anyway, so we take a look at this. Again, we have our Ruby 2.4, Ruby 2.5, Ruby 2.6. That is repeated three times. This stuff up here is pretty much what we had. We're dealing with some caching. We have some build steps. We have our RSpec stuff. But this is the orb, right? In our config, it looked like-- check out the right version.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
In our config, it looked like, make the call to the orb and pass in this secret. But when it actually does all the macro resolution to actually execute it on CircleCI, it just inlines the orb, right? So this is the source code that handles sending a message to MS Teams. And it goes on for like, what, 50 lines or something? So every one of these builds is now 103 lines long-ish. So it's complicated, but I guess if we look at the source code, it's a little bit higher level, at least, right?
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
We don't have to get down to this low level until we really want to. Yeah, so that's how the orb actually works. And thank you. Thank you, and if you live in McHenry County please take the broadband survey. That's the same thing, QR code form. So there is a non-profit that wants to bring community fiber to the county, so you can help them out by taking the survey. Any questions about CircleCI or any of that stuff? If you run local, does it use your credits? It does not use your credits if you run local.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
Which do you enjoy using more? I actually enjoy CircleCI more. I can customize it more. I mean over the years I've gone up the learning curve, so I've sort of taken a hit. But you know this example is a little funny because it's a simple gem. It has like three things to do. But if you're dealing with a production application, these things can be really handy. I think you know for me, if it's a production application, if I have full stack tests against it that are actually executing things in the browser, if I didn't have the ability to SSH into that, at certain times like I don't know what I'd do. Like you can with those systems like take screenshots and save off things, but there have been times where that has literally saved me a ton of time.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But you know if you have a simple, if you have a few open source repos, Travis CI is really the best game for me. So in my mind like Travis CI is a lot closer to what CircleCI version 1 was. Maybe a more basic question. Do you run this manually or is it triggered to run when you commit to master? Oh yeah, these are all, generally they're configured to run every commit to every branch. But you can change that. In both systems, right? In CircleCI you create a workflow that has a branch built in. So an example of that that I use is on our production application we run all the tests on every commit, but we only package it up for deployment on certain branches. So a workflow is like, most of the time people get one job to run, but some branches get two.
Ryan Gerry Co-founder, Software Craftsmanship McHenry County (TravisCI & CircleCI) ▶ Speaking
But Travis, they launched as a, they were like the first hosted provider that was explicitly created for open source projects. That's why you see like a matrix because it was about libraries that needed to test against multiple versions. There's no way of anything, but we did really well with the advances. They still do a good job with simple project names. Right.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
All right. Thank you very much. So, yeah. One of the very minimalist format. Has anybody heard of GitLab? Okay, most of you have heard of it. It's a, it's a, I shouldn't say direct competitor to GitHub, but it's a direct competitor to GitHub. But it's a full service platform. It isn't just CICD or just Git repo management, but it's also project management, scheduling, issue management, all of that. And it comes in a couple different flavors. You can have a, it has an enterprise edition version, which you can pay money and host it yourself on your own hardware. You also have a community edition. Same thing, except it's a little bit more pared down feature side.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
You can have a hosted solution, which also does include some CI capabilities. But mostly it's a, it's a, it's a complete solution for everything from doing the equivalent of CircleCI to managing your day-to-day project needs. But it's a lot more integrated. So there's my motorcycle signage. It's great. So they work through a couple different concepts. They have the concept of a pipeline, which is kind of like what you're seeing with the workflow in CircleCI. You're going to have a series of stops that result in an artifact being generated. Their term is pipeline, but it has a much deeper integration. You can use GitLab to just do the CI.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
So if you have, let's say, a GitHub repo, or you have some other internal projects, and you wanted to host your own, something like you should be able to do with Jenkins, you can do the same thing with GitLab, where it can, it can pull in and sync the projects in. So you can just do this, the CI builds. Configuration is stored in YAML. So if you looked at Travis, CircleCI, everybody does it now. You have the YAML configuration right inside of the repo. The point of that, though, is for keeping the build scripts in sync with your code. Back in the old days of Jenkins and things like that, you had to have all your configuration in some UI, or TeamRunner, or Cruise, Cruise Control.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
That would be an external configuration outside of the repo. So if your project changes significantly, well, now you've got to go over here and... Mess around with this script, but you want to keep, let's say, two versions of your project code. So now you have to have two versions of the script that you're maintaining over here, in two versions of the repo. By putting the YAML files inside of the projects, you can build off of different branches, or tags, or whatever, without having that... Actually, or having it juggling your projects. So, you described these...
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Pipelines with these YAML files, much like what you saw with Travis and CircleCI. Their term is "jobs." "Jobs" use a "runner." Runners are... You can think of them like docker images. They do have some docker image you can spin up, just like with CircleCI. While it's a runner, it's just basically an environment. It could be a macOS environment. It could be a Windows environment. It could be a Linux environment. I bet they have others for ARM and stuff like that.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Because it is an open source... One thing is GitLab is open source. So, if there's a need for it out there, then probably somebody is up for it. Here's an example of the UI. I kind of regret that I took screenshots from our real project, because I had to, kind of, at the last minute, realize, "You know, I got a lot of SHAs and things like that. I probably shouldn't leave those in there." This is an example of one of our projects, though. This is representing our main flagship product from the company I work for.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
And here, I'm looking at our pipelines for you. So, I'm inside of a project, looking at the pipelines. And we've had several jobs that were kicked off for one pipeline. You can see this one job has still got some... I mean, excuse me. This pipeline has got a few jobs still running. And each one of those jobs is defined in the list out there. You can actually just look and see the process on the state of each one of our jobs as they're running. Which I'll show this in real time in a few moments. Very similar output to what you see inside of Travis.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
I like CircleCI's breakdown. But this is more like Travis, where you're just going to see a full dump, just as if you ran the script locally from your machine. Here, you can see it's running with GitLab multi-runner, which is kind of a generic runner interface. And it's running our steps, calling in the repository, checking out the shop or the branch that we're working on. We don't need our sub-modules. So it's just going through the usual recipe of steps. Again, a lot of these CI tools use the same metaphors for dealing with everything.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
So if you've worked with Travis, the configuration might be a little bit different. But it's going to be the same basic end result, same thing with CircleCI. They ultimately do the same basic job. Just different UIs for managing that. Schedules. I didn't know CircleCI had that schedule process, so I was all excited about it. I even gave it its own slide, because I love it. Being able to generate things like your weekly snapshot for odds of a jar that you're sharing.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
You need to do some integration testing with an external team. You can have your latest artifacts generated from that. So this is really handy for not just being -- reactive to changes in your environment. Not just being reactive to somebody did a commit or somebody pushed some changes or manually kicked off. But letting some of your automation happen via the CI tools. Charts. Who doesn't love charts with lines and numbers and stuff? I just thought that was fun. This, though, what I want to point out is this was actually -- these charts actually are useful.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
We had a problem with our builds where they were taking an exceptionally long time to run. And it was getting -- we had done an upgrade on MySQL. And we had broken -- basically, it turned out there was a configuration change in MySQL that was causing our builds to go very slow. And we couldn't figure out what it was. We figured out and had our ops team do the optimization and fix the configuration. And you can see, for the same code, the build times go down dramatically.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
But that was very useful for us to be able to just get an idea of the health of the builds that we were doing for our project. And that's it for slides. I'm not going to spend too much time there. I'm going to pop over to some source code. And this I'm going to stop recording because I'm actually showing the source code for our work. This one's pretty simple, as you can see. I have a gitlab-ci.yml file. And it is basically the same thing you've seen with Travis in Circle.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
We have some before steps that we do to stop our environments. We have some specs that we run. But basically, the same thing. We're going to have a set of jobs that are going to be run and define our build output. And we're going to have a set of jobs that are going to be run and define our build output. And we're going to have a set of jobs that are going to be run and define our build output. And we're going to have a set of jobs that are going to be run and define our build output.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
So, one nice thing that I like about gitlab versus working with just CI and tools like CircleCI and Travis is that you have so many different places to go. One nice thing that I like about gitlab versus working with just CI and tools like CircleCI and Travis is that you have so many different places to go. If you want to see the state of my latest merge request, you can go to my website. If you want to see the state of my latest merge request, you can go to my website. If you want to see the state of my latest merge request, you can go to my website.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
latest merge request, they like to use merge requests, it's called pull request in GitHub. If I want to see, you know, how my build is going for my merge request, I don't have to go to another tool and another site. I hope that this provider has some kind of integration to show me some status. Because this is a kind of a one-stop-shop solution, I can see everything about the state of my project just by navigating into it.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
I can go into my repo. I can see some work that's been done. I can come down into my CI/CD build. I can go into a merge request. I can look at, let's see, some special logforces are coming up. There's nothing going to be in here that's going to be inappropriate to see. But I can see I have a merge request here. I have some checklists just like you would on GitHub. But down here is where it gets interesting, is I can start to see a request to merge. I can see the pipeline is passed with warnings. Come over here, I can click on this icon to see which of the jobs for the pipeline that's being executed for this merge request. I can drill into that.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
I can jump down. I can see, okay, this one failed with exit status one. We've been having some product problems with our Webpack configuration, but it's not a deal-breaker for this particular merge. So that way it was just marked as being passed with warnings. We're not going to stop this specific job. I can kick off, I'm not going to do it right now, but I can kick off other manual steps where if you wanted to push the development or staging, you can kick those off right from here and watch those as they process.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Come over, and I can see also all my history of the different jobs that have run for this project. I can see what's running right now. I can see what's passed, what's failed. They do have the ability to, if I have a running job that's failed, I can SSH it. I can SSH into that job, which is very handy. They have the same basic features of being able to cache artifacts, bundler, node, NPM cache, all that stuff. One thing that I've not dug into at all though, but we're hoping to do, we have our own cloud host that is provided, that we lease, that's called Mojo Host. They have OpenShift, and that's what we use to deploy and build out our VMs.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
But the one catch, so each runner has its own VM that we just basically true. So we have a pool of VMs that when a job kicks off, we just say, okay, what's the next free VM? Use that one. But in future versions of OpenShift, they're going to be able to support auto scaling. So one of the nice things is you can do kind of like with CircleCI where you can define the amount of parallelism. You can say, I have this Kubernetes cluster. Here's the image to clone, spin up a new Docker container for me and run my tests inside of that.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
But we're not able to leverage that, so I really can't speak much about it yet. But it's one of the big selling points. Coming down here, I also want to actually take a step and go back and show, inside of the merge request, one of the things that I do like the most is being able to see. So it doesn't have many things in the pipeline to show, but there, oops, okay, nothing in there. It's a much richer experience for dealing with diffs. I can see them side by side. So they have a very much more developer-friendly, I feel, close-knit integration between what I'm doing in automation of my code and being able to see the changes as I'm working with it, so there, that's all I really have to say.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Any questions? That morning thing is kind of nice because it's not just binary. Like, how do you define something as a warning? Let's go over to that is the webpack, a lot of failure. It's basically just a lot of failure. Oh, okay. Yeah. And you can define the pipeline to go, you know, much like a makefile, I can have next independence. You can type, or if you ever dealt with rake, or you can define that this rake task depends on another rake task we completed before in our makefile, or you can have that dependency graph.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
You can do the same thing. We don't really leverage that too much. Our builds are pretty shallow, but we do have some here in, say, build except on master. We're not going to. We're not going to run this when there's somebody pushing something up to master. Yeah, so that's, that's, that's that. You said this is open source? Oh, yeah, yeah, this is. So what are you running, what are you running this on? Well, we have a enterprise edition, so that's like the premium support, all that extra stuff, but we run daemons on our own hardware.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
They do have, you know, like a direct competitor to GitHub online. As a matter of fact, when GitHub got acquired by Microsoft, it was a massive migration. Yeah, and I did, this was a few months ago, but I set up a GitLab instance. It was a little bit pricey to do it manually in DigitalOcean because I had to have two servers, but what they want you to do is they say, if you're going to run your own GitLab, the bare minimum for the community edition is 8 megabytes, 8 gigabytes. It's 8 gigabytes with at least, I think it was four CPU units.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
I had that and then a, so that's for the GitLab repo itself, for the, you know, the primary interface, you know, you're on GitLab getting all of this. To do the runners, though, they suggested at least having one separate runner, which could be whatever you need for your specific project, but it got to be a little bit pricey to run that on hosted hardware. But if I was just running it in my own house, it's, well, it's free, and it was not hard to set up. It took me about a day to go through their configuration. That's one thing that I really like about GitLab, is they have fantastic documentation on how to set up, how the runners work.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Let's see, just go into this CI reference, you can see that it's very well documented. It's a little intimidating, but there are some more friendly startup guides. Before you dig into the bottles of configuration, but it's like the Emacs of online code management. It does everything, and that's one of their big goals, is to be a complete, full-stop, developer-oriented interface. I've been pretty happy, I mean, this, working at SK has been my first time using GitLab aside from my own personal experimentation. And it's just continually been impressive, and they're always pushing out patches.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
We actually have to kind of gateway our upgrades, because we were pushing too far too fast, and it was like every other day we were doing an update. So I don't know what version we're on right now, but we're just a few behind. It's, they also have a pretty interesting community. That you can complain to, and you can make, not just complaints, but you can contribute to. GitLab repo, I've gone in, like for one thing that I haven't, right, they have snippets. And snippets are great, I mean, we all use gists, right, gists are fantastic.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
But the thing about gists is you can have more than one file. So if I'm saying, oh, here's an example of something I'm doing, and it's got a SQL file, and a bash file, I might have that instead of one gist, but there's two files. Unfortunately with GitLab, they only support one file at a time. But after much nagging and pleading and complaining on their issue board, they finally agreed to make, to add multi-file gists to their, or multi-file snippets to their, to their, to their primary offering.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
So, yeah, it's, it's been a pretty easy, especially if you're used to GitHub, to transition over to GitLab. So the for money services are for GitLab.com? Well, you can pay for the Enterprise Edition, but like what we're looking at here is they're hosted, this is their managed, self-managed, this is what we use. So we have the premium, I think it is, so that you can see it's just $19.99, $19 per month. But where we make our savings is by running our own CI servers.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
We already have our own infrastructure, so we just run our own CI servers. We're not bound to how many instances, we already have more, capacity than we were using, so for us it was just much cheaper to go this way. But even if you do start off with their free edition, they do offer 2,000 pipeline minutes per month. So if you just wanted to get started, I don't think it matters if it's public or private at that point either. So, so the GitLab source code that's open source to get down on that, is that modular? Or do you just want to start with a repo and not have all the added features of a CI or CD?
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Like for me, all I did was I set up their instance, let's see, I think all I had to do was install Yeah, I ran this, this basically this script that bootstraps the environment for you. Let's see where that takes us. Let's see where the repo is. They probably have an installer that is in there somewhere. Yeah, they actually have it, it's bundled off through the app package. But, I'm sure their source code is somewhere out there, right? Yeah, here's their, it's a read-only mirror of GitLab with all the proprietary code.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
I'm not sure what's removed from the proprietary stuff. But this is our, this used to be out there, community edition. Our development has moved to here. Okay, yeah, so if you go to GitLab dashboard, GitLab, you can get to the lots and lots of source code. So, any other questions? Do you know, so a long time ago, back in 2009, I used an open source product, GitLab HQ, is that the same thing? I don't know. Okay. Probably, it's probably something that suits somebody.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Yeah, it looks like it. Looks like the mirror now. Yeah, it's community edition. Yeah, it's the same, they probably just rebranded it at some point, that's all. Yeah, it's... It's super easy to get started, but a little bit pricey, if you want to self-host, playing around with it in the free version is worth checking out. And they do have a migration, some might, I don't think I heard it, but they do have migration guides for if you want to get off of Microsoft GitHub and move to Freedom, or whatever fancy, fun, trendy thing and call it the States, I don't know.
Mike Hall Co-founder, Software Craftsmanship McHenry County (GitLab CI/CD) ▶ Speaking
Thank you.