text
stringlengths
0
1.8k
The other very cool feature is that open tracing is built in. So what that means is that you can see what does the span look like for a cached run, versus an uncached run. And all you have to do is to run Jaeger, and have an environment variable. By the way - all this code, all the integration is here. So if you look a...
So what we're seeing here is that this cached run - we can see it compiling the dependencies, and you can see that some of these steps run in parallel. So dep's compiled prod are still running, while the test cache already started here. Same thing image pod start here assets devs so on and so forth... And tests - the t...
So you can see what a cached run looks like. You can see that all these steps are really, really quick, the tests take the longest, and all in all, we're done in 47 seconds... 46.98. Let's be precise.
**Joel Longtine:** I think that's one of the beautiful things about Dagger and our use of BuildKit too, is that because we're describing at a very fine-grained level the relationships between these relatively fine-grained steps that might be within the context of an action, we can run many of those in parallel. So if y...
**Gerhard Lazu:** Yeah, exactly. What about the GitHub Actions integration? Well, this is a screenshot, this is what it looks like. We wanted to do like a point in time, and we can see how much quicker this is... But I would like to talk about this, and maybe Guillaume can run us through it, what does this look like. T...
**Guillaume de Rouville:** So it's like a normal GitHub Action. What I see here - you have environment variables, so a Docker host, the hotel to the Jaeger endpoint, and then you have a job, only one job, which is named ci. It runs on Ubuntu, so you just check out the code for the context of the changes. Then you use b...
**Gerhard Lazu:** A Dagger action, yeah...
**Guillaume de Rouville:** A Dagger action, exactly... And then you configure the Tailscale tunnel, I think it's for you, I believe...
**Gerhard Lazu:** Yeah. Because this Docker is remote, that's right. And it's the same Docker host which I use locally. I don't run Docker locally, I just have a Tailscale tunnel, which connects me to that host. And it's the same host that the CI uses. Now, there's an improvement to be made there, and we'll get to that...
**Guillaume de Rouville:** Basically, it's the step you do when you run it locally. You just do a Dagger rep and I presume you have specified an input, which is a local folder, and you don't have to specify it.
**Gerhard Lazu:** \[16:07\] That's right. So if you don't see the glue code, so the dagger op - you're right, it's just a step, which already takes some values that have been preconfigured. So those values are committed, including the secrets, by the way. Dagger is using this really cool thing called SOPS - you may hav...
So this is what the glue code looks like locally. So it's basically what puts everything together. It is a makefile, that's what we use. It just makes things easier. It just runs a bunch of commands. And what I would like to point out is, for example, the new CI package, it declares a new CI... This is a plan, is that ...
**Joel Longtine:** It's an environment in the current version, and we're transitioning to the name plan, or a dag, potentially.
**Gerhard Lazu:** Right. Oh, that's a good one. Dag this. It asks me to enter my username... This will be stored encrypted, by the way, because -- no, this was to be stored as text; nothing secret, it's Gerhard, you already guessed it... And then it asks me for my Docker Hub password, so that it can push the image. The...
Cool. So then the Docker host, which is the remote one, it knows how to connect to it... And then it runs the same command that you've seen in GitHub Actions. Docker -- sorry. Docker... That's like a Freudian slip. Dagger - Dagger Up, log-level debug, environment CI. And that's exactly the same thing.
The other part of this is obviously the CI queue. And this is like all the code that actually declares the pipeline. And what is this ci.queue? How would you describe it?
**Joel Longtine:** It's basically the description of those various stages that we were describing earlier. So there's the app image, you had the test container, or the test db container definition prior to that... And then -- let's see. This is some of the -- so deps is basically kind of helping copy the actual applica...
**Gerhard Lazu:** Yup.
**Joel Longtine:** We also do the same thing for Node modules... And then this \#depscompile is - we're using that basically as a way to describe a kind of structure, that we're then going to apply in a few other places. So you can see deps compiled test actually uses that definition and specializes it with args mix an...
**Gerhard Lazu:** Yeah. deps compiled name is right down here so the only difference you're right the the mix end the same definitition as deps compiled with something changed; actually, added... Because it appends stuff to it. Okay. And what is CUE?
**Guillaume de Rouville:** \[20:05\] CUE is a configuration language. It aims to be a better JSON and a better YAML. It stands for Configure, Unify and Execute. Basically, I think Joel will be able to continue after that... \[laughs\]
**Joel Longtine:** Yeah, so like Guillaume said, it's a configuration language, and one of the things that I think is really lovely about CUE is schema definition, data validation, and it basically allows you to create configurations that have types, so they can be type-checked, preferably, before you get to prod... \[...
I personally love that it is not white space-dependent, like YAML is. I've been bit so many times by that, with Helm and other various tools; Ansible comes to mind, too... There's lovely things about those tools, and I've found myself bitten by that bug and a number of them.
**Gerhard Lazu:** That's why YAML vaccine resonated with you, right? When I mentioned it, this is exactly what I meant, because you had the bug multiple times, and damn it, it's not fun.
**Joel Longtine:** Yeah. I've had production deploys fail because an engineer added an environment variable and used tabs instead of spaces in a Helm chart. I prefer not having those sorts of -- those sorts of problems are avoidable, and CUE is a really powerful tool for doing that.
Just to kind of dig into the schema definition stuff a little bit deeper, because I think it's useful to understand... You can basically define the shape of a particular configuration, including constraints on different fields. A good example of this might be like a Kubernetes deployment. So you can have a Kubernetes d...
And then when any configuration from a developer or an SRE comes into that, if it doesn't match that specification, then the compile of the CUE will fail. So it will allow you to fail at a much earlier stage, potentially even on a developer's local machine, rather than once it gets to production.
**Guillaume de Rouville:** That's exactly what we've been using. We've developed a serverless package to usually deploy serverless functions on AWS. That's basically what we used. So it's kind of useful... Sometimes you have -- the names, they are forbidden characters, and we just do it, we use these validations to fai...
**Gerhard Lazu:** Yeah. Okay. So yeah, there's a lot to explore here. I really, really like CUE, I have to say; there's so many great things about it... And it makes not having the right inputs, not having the right values - it just really helps. The compiler errors for CUE were really good, and they steer you in the r...
**Joel Longtine:** There's some rumblings in the CUE community around creating a language server as well.
**Gerhard Lazu:** Ooh... Wow. An LSP. I would love that. I would love that. Okay, right. So I'll definitely want to watch, for sure. So what comes next?
**Joel Longtine:** \[23:59\] I think one thing that occurs to me - at least as far as I remember, this is currently still using the docker build. So you're actually pushing out the contents of a bunch of those steps to the Docker Engine to actually then build the image... And with Europa and some of the improvements th...
**Gerhard Lazu:** Interesting. Okay, it sounds great. Anything to add, Guillaume, to that, or something else?
**Guillaume de Rouville:** Yeah, I think that with Europa, as Joel mentioned earlier, the DX will be far better. What we're trying to do at the moment - if the people watch the PR with Europa, it will be normal.
**Gerhard Lazu:** I think -- yeah, that makes a lot of sense. Europa will make this a lot simpler. And while we had to jump through a couple of hoops, it just made it obvious they shouldn't be there... So I'm really excited to adapt this to that new way. That will be great. And to see what improvements we can get. Beca...
Okay. Well, I'm gonna wish you both a Merry Christmas, even though this is weeks before Christmas... But by the time listeners will be listening to this, it'll be Christmas... And a happy new year!
**Joel Longtine:** Same to you, Gerhard. Thanks. It's been a lot of fun to work with you and Guillaume on this. It's been a nice opportunity to get to know you, and get to know Guillaume as well. Like you mentioned, I live in kind of the Boulder/Denver area, and Guillaume lives in France... And it was a good opportunit...
**Gerhard Lazu:** Definitely. Right back at you again. Same for me, so I'm glad that this worked the way it did. I also had a lot of fun. Thank you very much.
**Joel Longtine:** Thank you.
**Guillaume de Rouville:** Yeah, thank you.
**Gerhard Lazu:** Our second present to you this Christmas is sharing my way of understanding CPU time used by Kubernetes workloads. Think near real-time Flame Graphs, as well as being able to compare CPU profiles for the same process, at different points in time. If you're familiar with Brendan, Gregg's book Systems P...
**Frederic Branczyk:** Let me talk a little bit about why that's interesting and why that's useful. So profiling has kind of been in the developer toolbox ever since software engineering has existed, because we always needed to know "Why is my program executing, and how is it executing the way it is?"
So profiling has been around for a very long time. It's essentially us recording what the program is doing. You can literally think of it as we're recording the stack traces that are happening 100 times per second. That has kind of evolved over the years. Profiling used to be a very expensive operation to do, which is ...
\[28:10\] Sampling profiling kind of go a different strategy and say "Actually, we only need something that's statistically significant." So instead of recording everything that's happening, as I said earlier, we only look at the stack traces a hundred times per second. And that, we can do incredibly efficiently.
The reason why this is super-useful and why being able to record stack traces with statistical significance is useful is that now we can say "This is where my program is spending time." So that can be used to save money on your infrastructure, but also there are a lot of optimizations that you can only do if you have t...
One really cool conversation that I had yesterday - this perfectly translates in the serverless world, where you actually pay for basically every single CPU cycle that your serverless function is running, and any CPU second that you can cut off from that is money you're saving from your serverless bill. I think that's ...
**Gerhard Lazu:** So out of these three things - saving money (very important for some), improving performance... I love that. Shipping code fast - great. Making it better and improving it - I love that. And when things go wrong, understanding what exactly went wrong. What CPU, what disk, what network, where is the bot...
We're going to run it in our production Kubernetes setup. Just like that. Why not? Create a namespace, apply the server, and apply the agent. And as I do this in the background, what is the difference, Frederic, between the server and the agent?
**Frederic Branczyk:** The server is essentially the component that allows you to store and query profiling data, while the agent - the one and only purpose of the agent is to capture this data from your applications at super-low overhead. And one of the really exciting technologies that we're using here is eBPF. So be...
**Gerhard Lazu:** Okay. So we have the server and the agent... So let's port forward to the server, to the UI, and in our browser, local host 7070 - let's see what that looks like.