text
stringlengths
0
1.8k
[548.88 --> 550.02] How would you describe these?
[550.26 --> 550.72] What are they?
[551.08 --> 552.36] These are, I think it's actions.
[552.98 --> 556.62] And so an action, it represents a step.
[557.08 --> 560.02] So in general, it lies inside a definition in Dagger.
[560.46 --> 564.38] And so how do you build a Dagger pipeline?
[564.68 --> 567.60] You just assemble actions in and all together.
[568.00 --> 570.84] And at runtime, we build a DAG.
[571.72 --> 576.78] A little above, that's how you have like parallel dependency builds.
[577.12 --> 577.38] Okay.
[577.56 --> 578.34] What is an action?
[578.46 --> 580.78] If you had to describe it, Joel, how would you describe an action?
[581.24 --> 585.04] An action typically would be like a collection of build kit steps.
[585.04 --> 587.52] So the people familiar with Docker,
[587.96 --> 591.54] like a specific commands within a Docker file,
[591.88 --> 597.96] like a copy or an exec, you know, an env, those sorts of things.
[598.82 --> 603.42] They basically represent a stage within build kit.
[603.42 --> 608.30] And typically one of these actions is going to be a set of those steps.
[608.88 --> 612.60] So it might be a number of runs within a container, you know,
[612.72 --> 615.86] execing a shell script or something along those lines,
[615.86 --> 619.12] and then getting the kind of resulting file system state.
[619.12 --> 621.48] They all run in the context of container, right?
[621.56 --> 625.28] So when you think of a step, there is a container which gets created,
[625.54 --> 628.86] that step runs, and there are some inputs and outputs for that one step.
[629.24 --> 629.78] Is that correct?
[630.32 --> 630.58] Yeah.
[630.72 --> 632.48] Yeah, that's a great way of describing it.
[632.58 --> 634.50] So you have a set of inputs.
[634.78 --> 636.04] That could be a file system state.
[636.14 --> 638.00] That could be a volume mount.
[638.08 --> 639.64] It could be secret mounts as well.
[639.64 --> 643.70] This is something that's a piece of build kit
[643.70 --> 648.48] and some of the new features that Docker build got as a result of build kit.
[648.68 --> 651.04] So you have all these inputs coming into this node,
[651.26 --> 654.68] which is that file system state plus some action.
[655.76 --> 659.16] And then something results from that.
[659.46 --> 664.10] You know, if you're doing an echo hello to world.txt,
[664.48 --> 667.86] then that new file system state has that new file on top of it.
[667.98 --> 668.18] Right.
[668.56 --> 668.74] Yeah.
[668.74 --> 672.20] So if you can see here, these steps, I mean, there's no cache, right?
[672.26 --> 674.72] If you remember the Docker file, if you think about that,
[675.02 --> 677.86] and how some of those commands could be cached,
[677.96 --> 678.74] and then they're really quick.
[678.80 --> 680.16] Like, for example, here, app image.
[680.54 --> 683.66] You can think of it almost like, you know, like a command in the Docker file.
[683.78 --> 686.02] So that is cached and takes 0.9 seconds.
[686.36 --> 688.22] It just has to verify where it is in the cache.
[688.42 --> 689.52] Now, these run in parallel,
[689.66 --> 691.44] and we'll do a run for you to see what they look like.
[691.90 --> 695.14] But this whole pipeline as a whole, even though it looks flat,
[695.42 --> 698.46] it runs in parallel, and it takes 190 seconds.
[698.46 --> 702.68] So it's a slight improvement over the three minutes and 38 seconds,
[702.76 --> 703.40] which we had here.
[704.00 --> 708.10] But you have to realize that these three minutes and 38 seconds will always be just that.
[708.52 --> 709.08] It doesn't matter.
[709.54 --> 710.56] I mean, this is using caching.
[711.48 --> 715.28] But Dagger, if it does use the caching, if everything is cached,
[715.52 --> 718.48] if it doesn't have to compile anything, it just has to run the tests themselves,
[718.80 --> 720.30] it's five times quicker.
[721.08 --> 722.54] And that is a huge speedup.
[723.00 --> 726.62] So this pipeline run, all of it took 45 seconds,
[726.74 --> 728.80] and the test took the longest 42 seconds,
[729.26 --> 731.36] versus three minutes and 38.
[731.98 --> 733.80] So much, much quicker.
[733.80 --> 736.52] And by the way, this will run against any Docker daemon.
[736.66 --> 737.70] That's the only requirement.
[737.84 --> 738.48] You need BuildKit.
[739.02 --> 741.54] And the easiest way of getting BuildKit is just in your Docker.
[741.64 --> 742.38] It already has it.
[742.94 --> 745.50] So there's no special CI setup required.
[745.60 --> 748.44] You can run this anywhere, whether it runs the same way,
[748.60 --> 749.80] whether it runs in GitHub Actions,
[750.50 --> 752.20] CircleCI, or your local machine,
[752.36 --> 753.18] which is really cool.
[754.12 --> 757.48] The other very cool feature is that OpenTracing is built in.
[758.10 --> 759.80] So what it means is that you can see
[759.80 --> 762.40] what does the span look like
[762.40 --> 766.14] for a cached run versus an uncached run.
[766.20 --> 767.92] And all you have to do is run Jaeger
[767.92 --> 770.24] and have an environment variable.
[770.32 --> 772.68] By the way, all this code, all integration is here.
[773.12 --> 775.32] So if you look at pullRequest395, you can see all of it.
[775.92 --> 777.80] So what we're seeing here is that this cached run,
[777.86 --> 779.50] we can see compiling the dependencies,
[779.50 --> 782.36] and you can see that some of these steps run in parallel.
[782.36 --> 784.78] So devs compiled prod are still running
[784.78 --> 788.54] while the test cache already started here.
[789.46 --> 791.26] Same thing, image prod cache started here,
[791.36 --> 792.72] assets, devs, so on and so forth,
[792.78 --> 793.74] and tests, right?
[793.76 --> 794.46] The tests are running,
[794.58 --> 795.56] and we are already,
[796.52 --> 798.22] we started building the production image.
[798.88 --> 800.96] And that is the beauty of the pipeline, right?
[800.98 --> 803.62] Like you want to run as many things as you can in parallel,
[804.44 --> 807.14] and I do like optimistic branching, it's called in CPUs.
[807.28 --> 809.20] And then when you get to the end of it,
[809.32 --> 810.32] it's just like last step.
[810.44 --> 811.94] You know, you assume that everything will just work.