text
stringlengths
0
2.67k
**Jon Johnson:** This was in the middle of kind of the drama around TerraForm relicensing stuff... And so I ended up sending a PR to Open Tofu. I think it was called something else at the time, but I sent them a PR, and I was like "Cool. We just have to wait for them to release it." And then that took a while... So I e...
this work I did for like two weeks to fix this problem, because I found a workaround. But it is in Open Tofu now, so you should not run into these problems if you end up building several thousand containers with TerraForm with state marshalling.
**Autumn Nash:** Playing it forward.
**Jon Johnson:** Yes.
**Justin Garrison:** As you just pointed out, there's multiple ways to fix that problem, right? Essentially, you can make the marshaling and unmarshaling faster or better, or you can just like speed up your disk, essentially, to put it in memory; make it the fastest disk possible, and just say "It's gonna be in memory....
What other benefits -- like, could you do this in a different language that is better at marshalling? Like, if TerraForm wasn't in Go, and you were doing it in another language that had better JSON handling, would that also --
**Autumn Nash:** Is Terraform written in Go?
**Jon Johnson:** It is, yes. I think probably because -- I mean, you may be familiar with the fact that the JSON package in the standard library is going through a v2 design phase right now... But there's not like any way to do random access of stuff with JSON in Go... And so I think if you had something like this, you...
**Justin Garrison:** \[26:25\] Yeah. And I remember a long time ago there was a service that they did a comparison between -- they're rewriting it from probably Scala, or something, and they're like "Oh, we want to rewrite it, and we're gonna go with Go, because it's fast. It compiles fast, and everything." And then th...
**Autumn Nash:** I'm just happy we're talking about Java right now...
**Justin Garrison:** \[unintelligible 00:27:03.06\] Because Java is really good at handling JSON.
**Autumn Nash:** And it has gotten considerably faster, you know? \[unintelligible 00:27:10.15\]
**Justin Garrison:** But again, back to that "How do you solve this problem?" - just having the fastest disk possible is.
**Autumn Nash:** Also, I think it's interesting just to point out that it's funny that there's so many ways to solve the same problems in tech, and there's so many different tools that are made to do it, and then sometimes it's still the legacy thing that we've had for 40 years... Even though everybody wants to do the ...
**Justin Garrison:** But then how are they going to put that on their resume?
**Autumn Nash:** You're not wrong. Somebody wants to write some sort of doc to propose it some way, but...
**Justin Garrison:** So setting the record straight...
**Jon Johnson:** Yes. Apologies for the digression.
**Justin Garrison:** No, it's fine.
**Jon Johnson:** It also, I think, is relevant, kind of, to the rest of this. So I got into thinking about Gzip deeply for a lot of reasons, but one of them is performance.
**Autumn Nash:** So it's when you go down that rabbit hole, when you start googling stuff, and like looking at eight different projects, and you're like "Three hours later..."
**Jon Johnson:** Yeah, I --
**Autumn Nash:** That's my life. I feel you.
**Jon Johnson:** Yeah... I know that I'm doing like real interesting work when I'm reading RFC, the text format, and it's like "Okay... I feel like maybe software engineer isn't a made-up term. I feel like this is actual work." The RFC 1951, it's a good one.
**Autumn Nash:** Highly recommended.
**Justin Garrison:** We'll put it in the show notes.
**Jon Johnson:** So I don't know... Should I take you back to why I started caring about Gzip at all, or should we segue through containers?
**Autumn Nash:** I'm just sad that podcast people can't see the faces that have been made, and this emotional roller coaster of like Terraform... Justin has made several great faces, Jon has made some great faces, and I'm just sad that they are being lost on the audience right now...
**Jon Johnson:** Well, we can make some shorts...
**Justin Garrison:** Yeah. They'll show up somewhere. But yeah, start with -- what are you doing Gzips? Why was this important to solve the next problem?
**Jon Johnson:** Sure. Okay, so there are two places in my life where my caring about Gzip is actually useful, and not just some weird thing that happened to me... Going back to three tars in a trench coat - I don't know how you came up with that. Maybe I -- surely I didn't... But it's obscenely accurate as a descripti...
**Autumn Nash:** \[30:10\] He's not wrong.
**Jon Johnson:** Yeah. It was surprising to me that like all of the stuff I have learned about Gzip and tarballs for container reasons is like directly applicable to now my day job... And so I kind of double-dipped on this weird obsession that I have, which was very useful for a lot of reasons. But for the purposes of ...
So you have a bunch of packages, you want to put them in a container image... It's actually really straightforward to turn gzipped tarballs into another gzipped tarball without going through disk in the middle. So when I was tasked with this performance work on our image release process, the first thing I did was look ...
And so lots of optimizing, lots of profiling \[unintelligible 00:31:31.21\] where it's like "Okay, we don't write every single file out to disk anymore, and it's way, way faster." So the build I was using as a test case went from 30 seconds to like two seconds. And that was huge for our build times. It turns out it did...
I don't know why we're talking about this anymore, but... Yeah, this kind of like insight, of like "Oh, there's actually something here with Gzip and performance" is why I wanted to talk to you, because it's like "Oh, other people should know. This is interesting, actually. I care about it. You should, too."
**Justin Garrison:** One of the things I wanted to talk about too was about -- like, we take all these gzips, and APKs, or containers, or whatever you want to call them, and then we put them in on a website. And we call that a registry, or a repo, or something that is just a form of a collection of tars or gzips with s...
**Jon Johnson:** Yes.
**Justin Garrison:** Except for, I guess, yum packages, which should be cpios, right?
**Jon Johnson:** I actually don't know what that format is... If I come across it --
**Justin Garrison:** It's old... \[laughs\]
**Jon Johnson:** It looks almost like tar, but it's not. I don't understand --
**Justin Garrison:** It was before tar. Cpios are very ancient, and they ran all of yum.
**Jon Johnson:** Terrifying.
**Justin Garrison:** But - so yeah, we have all these things, and then we throw them in websites, and then just everyone downloads them from there. And we say "Okay, we have a website, you can download all the tars you want... Here's how you discover which tar you want", whether that's an APK file for installing a pack...
**Jon Johnson:** Right. So my introduction, I think, to all of this Gzip nonsense was Stargz. So a while ago - I don't know how long ago - Brad Fitzpatrick, who was at Google at the time working on the Go build system, trying to make the Go builds faster, ran into the reality that polling was really slow.
\[33:54\] So they had packaged up in their Go-based images for testing, many, many gigabytes. I think tens, or hundreds of gigabytes of stuff... Very little of which was actually accessed on each build. So he came up with this thing which he called Crfs, which is a container registry file system that used Fuse to mount...
So what he ended up doing is effectively rewriting the container image layers to be more like a zip file, instead of a gzipped tarball, which maybe is a good digression to talk about the difference...
**Justin Garrison:** Yeah, why would that be a benefit?
**Jon Johnson:** So zip files are essentially a bunch of individually-compressed files. And then at the end, there is a directory for those files. So when you open a zip file, if you want to look at the contents, your software's going to seek to the end of the file, find an offset that says how far back to seek, it's g...