Latest / Talk Python To Me / #296: Python in F1 racing
Transcript
- 0:00Quick, name the three most advanced engineering organizations you can think of.
- 0:04Maybe an aerospace company such as SpaceX or Boeing came to mind.
- 0:08Maybe you thought about CERN and the LHC.
- 0:10But in terms of bespoke engineering capabilities, you should certainly put the F1 race teams on your list.
- 0:16These organizations appear as 20 or 30 people on a race day shown on TV.
- 0:21But in fact, the number of people back at the home base doing the engineering work can be well over 500 employees.
- 0:26Almost every tiny part you see on these cars, as well as the tools to maintain them, are custom built.
- 0:32The engineering problems solved are immense.
- 0:34Would it surprise you to know that Python is playing a major role here?
- 0:37On this episode, you'll meet Joe Borg, who helped pioneer Python's adoption at several F1 teams.
- 0:43This is Talk Python To Me, episode 296, recorded November 16th, 2020.
- 0:49Wait, wait, wait, wait.
- 0:52Normally, I'd play a little guitar riff right here to kick off the episode.
- 0:56But this episode is about racing and race cars.
- 0:59So let's kick it off with a different kind of instrument and note.
- 1:02Let's jump into a 2017 Indy Pro Mazda.
- 1:05The furlap around the storied Brands Hatch circuit.
- 1:08And let the engine notes be the music.
- 1:10The furlap around the storied Brands Hatch circuit.
- 1:13The furlap around the storied Brands Hatch circuit.
- 1:14The furlap around the storied Brands Hatch circuit.
- 1:15The furlap around the storied Brands Hatch circuit.
- 1:17The furlap around the storied Brands Hatch circuit.
- 1:19The furlap around the storied Brands Hatch circuit.
- 1:19The furlap around the storied Brands Hatch circuit.
- 1:20The furlap around the storied Brands Hatch circuit.
- 1:21The furlap around the storied Brands Hatch circuit.
- 1:22The furlap around the storied Brands Hatch circuit.
- 1:23The furlap around the storied Brands Hatch circuit.
- 1:24The furlap around the storied Brands Hatch circuit.
- 1:25The furlap around the storied Brands Hatch circuit.
- 1:26The furlap around the storied Brands Hatch circuit.
- 1:43Welcome to Talk Python To Me.
- 1:44A weekly podcast on Python.
- 1:46The language, the libraries, the ecosystem, and the personalities.
- 1:49This is your host, Michael Kennedy.
- 1:51Follow me on Twitter where I'm @mkennedy.
- 1:53And keep up with the show and listen to past episodes at
- 1:55Talk Python.fm and follow the show on Twitter via @talkpython.
- 2:00This episode is brought to you by Linode and Talk Python Training.
- 2:04Please check out the offers during their segments.
- 2:05It really helps support the show.
- 2:08At Talk Python, we run a bunch of web apps and web APIs.
- 2:12These power the training courses as well as the mobile apps on iOS and Android.
- 2:16If I had to build these from scratch again today, there's no doubt which framework I would use.
- 2:21It's FastAPI.
- 2:23To me, FastAPI is the embodiment of modern Python and modern APIs.
- 2:27You have beautiful usage of type annotations.
- 2:29You have model binding and validation with Pydantic.
- 2:32And you have first class async and await support.
- 2:35If you're building or rebuilding a web app, you owe it to yourself to check out our newest course.
- 2:40modern APIs with FastAPI over at Talk Python Training.
- 2:45You have a first course in a series we're building on FastAPI.
- 2:47And for just $39, it'll take you from interested to production with FastAPI.
- 2:52To learn more and get started today, just visit talkpython.fm/fastapi or click the link in your podcast player show notes.
- 3:00Joe, welcome to Talk Python To Me.
- 3:01Joe, welcome to Talk Python To Me.
- 3:02Joe Pyshko: Thank you.
- 3:03Nice to be here.
- 3:04Nice to be here.
- 3:05Oh, man.
- 3:05It's exciting to have you here.
- 3:06I get to come back to one of my favorite topics, racing, which is always cool.
- 3:10And we're going to hit the peak of racing and engineering, I think, with F1 here.
- 3:16Joe Pyshko: I think so.
- 3:17I probably shouldn't admit this is an F1 guy, but I've always kind of preferred WEC.
- 3:22But F1 certainly up there with the high performance.
- 3:26Joe Pyshko: Sating.
- 3:27So the world endurance champion cars, yeah, like Ferraris and stuff like that, right?
- 3:31Joe Pyshko: Exactly.
- 3:32All the Porsches, Toyota, I think are the biggest one-store racing in it.
- 3:35Joe Pyshko: Yeah, yeah.
- 3:36Well, now that you've stepped away, I got a little distance between F1, but you work for
- 3:41two different F1 teams doing some really neat stuff with Python, and we're going to dig into
- 3:45that.
- 3:46And I'm super excited about it.
- 3:47Before we get to that, though, let's just start with your story.
- 3:50How did you get into programming and what brought you to Python?
- 3:52Joe Pyshko: I've always been kind of a techie guy since I was a young,
- 3:56young kid.
- 3:57And my dad was doing a university course when I was like five or six, just about young enough
- 4:01to remember.
- 4:02He got a computer as part of the course and sort of, I was introduced at quite a young age.
- 4:08It was just, it wasn't anything special at that point.
- 4:11It was Windows 95 or whatever.
- 4:13Showing my age there, I guess.
- 4:14I don't know which way.
- 4:15Joe Pyshko: Windows 95 was kind of special.
- 4:17Joe Pyshko: Yeah.
- 4:18Joe Pyshko: I think Windows 95, like it was the first operating system that really felt like
- 4:22welcoming and good.
- 4:23Joe Pyshko: I mean, I think you could debate about some of the early Mac ones, but the
- 4:26early Mac ones were like super bizarre in some ways.
- 4:29And Windows 3, one, like that was a neat time actually.
- 4:32Joe Pyshko: Yeah.
- 4:33Oddly, I was introduced to Windows 3.1 after 95 because of school, which seems like a weird
- 4:38order to do it in.
- 4:39Joe Pyshko: What is this thing?
- 4:41Joe Pyshko: I sort of vaguely remember that though with my dad choosing the themes because
- 4:46I think it came with plus or whatever it was called, the big theme pack on Windows 95.
- 4:50And we spent more time doing that than about anything else.
- 4:53But then he started showing me how Excel works and how you can do not just the kind of conditions
- 4:57on each cell, but then into VB and stuff like that.
- 5:01So that's how the seed kind of got planted.
- 5:03Joe Pyshko: I never went to university, but I did an apprenticeship with British Telecom,
- 5:07quite big in the UK with that kind of thing.
- 5:09And I actually did network engineering for a few years there and got my qualification.
- 5:14I think that would be an associate's degree in the US.
- 5:16Joe Pyshko: Yeah.
- 5:17At that time, there's probably not a lot of programming in the network engineering, but
- 5:21there's a lot of scripting and automation.
- 5:23So it's like on the cusp of programming, right?
- 5:25Joe Pyshko: Exactly.
- 5:26Joe Pyshko: Okay.
- 5:27Joe Pyshko: So I much preferred that to sit manually subnetting stuff for tests, et cetera.
- 5:31Like it was much nicer to be doing mostly like it was just scripts for provisioning routers
- 5:36and things like that.
- 5:37And we had a few systems internally that were, that we wrote because the commercial stuff just
- 5:41wasn't very suited for us.
- 5:43And then I got quite a lucky break with my, the first team I worked for.
- 5:48Dropped in for an interview, which took several hours, which I kind of assume was a good thing.
- 5:52Joe Pyshko: And they haven't kicked me out yet.
- 5:55Maybe I'm here.
- 5:56Joe Pyshko: Exactly.
- 5:57Which was, it wasn't really a technical interview at all.
- 6:00It was more, how would you approach this on a high level?
- 6:03And I think at the time there wasn't really a developer focus for especially the aerodynamics
- 6:09side in Formula One.
- 6:10So literally just saying, you know, I'd have a web front end for all of the users and I'd
- 6:15store stuff in a database and I'd save things on a, on a network file share, et cetera.
- 6:20That was enough to, to pique an interest.
- 6:23Joe Pyshko: Cool.
- 6:24And did you learn Python there?
- 6:26Joe Pyshko: Yeah.
- 6:27So it was, I think I had a few months in between interviewing there and then actually starting
- 6:32the job.
- 6:32So I started learning at home.
- 6:35I was already a Linux user.
- 6:37In my high school, we had a Linux user group, which especially in the UK, I think was a very
- 6:42rare thing.
- 6:43It just so happened that one of the IT guys was into it and a couple of the six formers
- 6:47were into it.
- 6:49It was Fedora Core One.
- 6:50I think at that time had just come out.
- 6:52Yeah.
- 6:52And that's what we were all in.
- 6:54We'd found some old computers that might be being dropped or whatever.
- 6:58And we were allowed to reprovision them with, with Fedora Core One and get them a new lease
- 7:03of life as it were.
- 7:04So I'd, I'd kind of got...
- 7:06Yeah.
- 7:07They were probably blazing.
- 7:08They probably had thrown away because they were too slow to run.
- 7:09Exactly.
- 7:10And they were blazing, right?
- 7:11Joe Pyshko: Yeah.
- 7:12It was nice.
- 7:13We did a couple of like LAN parties.
- 7:15I can't remember what game.
- 7:16Probably some terrible free game that no one actually played in real life.
- 7:20But just to prove that we could get them running on the network.
- 7:23I had a bit of background of sort of scripting and like provisioning, especially Linux nodes
- 7:27at that point.
- 7:28So the biggest thing was learning Python.
- 7:30And so I literally sat down with Python for dummies at that point and just started basically.
- 7:35Yeah.
- 7:36Cool.
- 7:37Neat place to like start this new venture and you can learn this new language and kind
- 7:40of like grow into this whole tech world that you were jumping into, right?
- 7:45Like sort of, we'll start with almost IT, but like, let's go farther.
- 7:48Exactly.
- 7:49I'd always sort of wanted to be a software developer.
- 7:52I just needed that kind of prod, I think, to focus on that rather than networking and IT.
- 7:58Yeah.
- 7:59I had a similar experience.
- 8:00You know, I feel like in the abstract, before you get there, like being a software developer
- 8:05is this big daunting thing and it's, there's like so much to know and you don't really know
- 8:09where to go with it.
- 8:10But then someone comes to you and says, could you do this one thing?
- 8:13Could you make this happen with programming?
- 8:15Like, I could do that one thing.
- 8:16Sure.
- 8:17I can do that.
- 8:18I'm not a programmer, but that I can do.
- 8:19Let me work on that for a while.
- 8:20And like, eventually you're like, wait a minute, I could do a lot of stuff.
- 8:23I'm a programmer.
- 8:24How do I get here?
- 8:25Especially with the first job was mostly converting to start with anyway, the first kind of six
- 8:30months was converting existing stuff into Python, mostly Bash at the time.
- 8:34So you've already got at that point, you're not focused massively on sort of architectural.
- 8:40Right, right.
- 8:41Side of things more just getting comfortable with Python, trying to do everything in a
- 8:45Pythonic way.
- 8:46So obviously with Bash, there's going to be a lot of repeated code when you're trying
- 8:49to modularize that.
- 8:51And yeah, that was a really nice way to kind of settle in, I think.
- 8:55Yeah.
- 8:56Cool.
- 8:57So I mentioned you had stepped a little bit away from F1 these days.
- 8:59So what are you doing now?
- 9:00So now I work for Canonical.
- 9:02People, if they don't know the company Canonical, probably have heard of Ubuntu.
- 9:06So Canonical are the kind of corporation that back Ubuntu.
- 9:09And yeah, I'm working for the Kubernetes team.
- 9:12We work on a couple of projects.
- 9:14One is what we call charm Kubernetes, which is a kind of very modular Kubernetes distribution.
- 9:20You can sort of pick and choose how you want your cluster to look and you're pick and choose
- 9:25out all the different components of how you want to put it together.
- 9:28That's all done in Python.
- 9:29So we have these, the individual components in our distribution are called charms and they're
- 9:33literally blocks of Python code to define what to do.
- 9:36what to do if it bumps into another component.
- 9:39If one of those components go away, how to react to that, et cetera.
- 9:42So imagine something like Terraform, but with a constant controller that's watching over the
- 9:48infrastructure.
- 9:49Yeah.
- 9:50That sounds super cool.
- 9:51It is nice.
- 9:52We're currently working on a new revision of the actual Python framework that's written
- 9:56in to basically make it more Pythonic.
- 9:58It was perhaps a bit more kind of scripty before.
- 10:01So that's, we're quite excited about that.
- 10:02I think that's going to be releasing in a few months.
- 10:04Nice.
- 10:05What's the relationship of that and OpenStack?
- 10:07Is there any?
- 10:08I used to work for the OpenStack team as a field software engineer.
- 10:11So at that time I was sort of going to customers and helping them either decide to go down the
- 10:16OpenStack route or not.
- 10:18OpenStack as well through Canonical is delivered in the same way through what we call charms.
- 10:22So all the individual components of OpenStack basically defined in Python and then connected
- 10:28together with what we call interfaces, which again is sort of Python defined functions of
- 10:33executed at the time that your infrastructure comes up and then mutates.
- 10:37Nice.
- 10:38So a lot of people listening out there, I would imagine everyone has heard of Kubernetes.
- 10:42Yeah.
- 10:43And probably Docker as well.
- 10:44Maybe less degree OpenStack.
- 10:46Yeah.
- 10:47You know, I've had some guys from OpenStack on before, Flavio.
- 10:50Mm-hmm.
- 10:51But maybe just give us the elevator pitch of like Kubernetes, Docker, and then what this thing
- 10:57that you guys are building, like why is that better than just like random Kubernetes or your
- 11:01Docker compose or something like that?
- 11:03Sure.
- 11:04So a kind of on a single machine level, you have Docker and Docker is basically just there
- 11:09to run containers.
- 11:10You can have either a single executable in that container or multiple, but obviously there's
- 11:15an amount of isolation that goes on with that container, namely network resource and disk
- 11:21base.
- 11:22If you want to orchestrate something a bit bigger and especially across several nodes, perhaps even
- 11:27several networks, you would use Kubernetes.
- 11:29Kubernetes is basically just there to decide when and where to place your Docker, in this
- 11:35case containers, it can be others, but we'll keep it Docker at this point.
- 11:38And then also what to do if there's any issue in either provisioning those or once they've
- 11:43started running.
- 11:44So it's just Kubernetes is sat there to basically ensure that what you've asked for remains the
- 11:49case.
- 11:50So if you've asked for five Nginx servers inside Docker to keep them running and if one of them
- 11:54fails to replace it with a new one.
- 11:57Yeah.
- 11:58And Kubernetes is pretty good for like rolling out new versions, right?
- 12:00It can do basically zero downtime deployments.
- 12:02Yeah, exactly.
- 12:03So for example, if I had like a web app, I'll have the actual, let's say in this case, the
- 12:07Django app and I release a new version of that.
- 12:10I can actually use Kubernetes even to start rolling out the new version of Django app and then get
- 12:17the, for example, Nginx load balancer to start firing 10% of the traffic at the new instance of our web app.
- 12:25And if there's a problem, it can just remove that part of our Nginx application.
- 12:30Sorry, our Django application and then continue how it used to be.
- 12:34Or indeed, if it's successful, we can keep changing that 10% to 100 in time.
- 12:38So it's very flexible like that.
- 12:39So you've kind of come back to the software side of where you started with like network engineering, right?
- 12:44Yes.
- 12:45Yes.
- 12:46There's definitely been quite a few instances where I've had to sit and remember how to work out subnets by hand again, which is something that I was hoping never to use again.
- 12:56But certainly, certainly appreciating that I had to before.
- 13:00Yeah, absolutely.
- 13:01All right.
- 13:02So let's talk about this, your Python journey through a couple of F1 teams.
- 13:07But I do want to set the stage just by setting the, giving people a sense of the scale, because when I learned about F1, it seemed to me like, okay, well, here's a, there's like a race organization and you watch it on TV or you watch it somehow.
- 13:23You'll see like, there's a team of 20 people in the little pit garage and the pit wall there.
- 13:28And you're like, okay, well, these are the people that do the racing and the race car.
- 13:32And they talk about engineering.
- 13:33But then as you pay more attention, you're like, oh, and then this is where they actually went back and redesigned the carbon fiber tub so that they could like change some setting.
- 13:43And then they redid this, you know, like you start to realize like there's a huge engineering, like super advanced engineering organization that looks almost like an aerospace company, maybe.
- 13:53Yeah, these days, aerodynamics is very much the biggest factor in Formula One.
- 13:58And as you say, you watch the Formula One on the television, you maybe see, as you say, 20 engineers and mechanics sat either on the pit wall itself or in the garage ready to service the car.
- 14:09But in reality, there's another 400 people, 500 people back at base who have been working on the tiniest details on that car to make sure that every bit of performance possible is being extracted.
- 14:23These days, it's not uncommon to see aerodynamic departments alone with 100 people working in it, which, you know, is a large user base, you know, even for a fairly modest software company, I'd say.
- 14:36Yeah, yeah, that's quite an incredible thing to realize just that many people are working on, you know, like you said, just the aerodynamics.
- 14:44And that was the part that you were associated with most, right?
- 14:47That's right. So I was a aerodynamic software engineer slash aerodynamic systems engineer, depending on who was giving me the title at the time.
- 14:54So effectively, I was the main person writing software and sort of ensuring the quality of it for these aerodynamic departments.
- 15:02It did bleed and especially in the second team into the vehicle dynamics department as well, because obviously what you're simulating, it's like shock springs, that kind of stuff.
- 15:14Is that what that would be?
- 15:15Exactly. Even usually nowadays, all of that is driven mostly by aero.
- 15:19So even the suspension on the Formula One car isn't about having this.
- 15:23It never was about having the smoothest ride, but it's mostly about keeping the car in the correct attitude for to exploit the aerodynamics.
- 15:29So you'll see an F1. Yeah. And I guess it's probably worth also putting out, like you said aerodynamics are important.
- 15:35It's an important part. It's it's an insanely important part.
- 15:38And like you watch those cars go and it looks like slot cars, like those toy cars that had like literally a little peg that would stick them to the track.
- 15:45Right. They just zoom, zoom, zoom, zoom. And it seems like impossible.
- 15:48And that's because of all the aerodynamic force.
- 15:50And you listen to them talk about it's like multiple times the weight of the car in aerodynamic force. Right.
- 15:57Yeah. I would need to double check this, but I'm pretty sure around the time that I was there, you're talking 4000 kilos.
- 16:03So four metric tons at the kind of 200 mile an hour mark.
- 16:07I know I'm mixing metric and imperial, but at that kind of speed, it's in that ballpark of downforce.
- 16:13So it's multiple times, maybe not quite an order of magnitude, but not far off in downforce.
- 16:18Yeah. And obviously it's not too difficult to just do that in downforce, but you need to do that without adding a huge amount of drag to the car as well.
- 16:24So the real research is right. No drag, no, no, no extra weight, not much extra weight, all those kinds of things. Yeah, it's exactly.
- 16:32That's where you could just have a huge wing. Yes. Like a 747 on it. Right. It'd be fine.
- 16:38Exactly. Massive angle of attack. It's something else worse.
- 16:42And then it could only do. Yeah. And I get, yeah, there's also like some interesting history in Formula One.
- 16:46Like one of the very, very cars didn't used to have these aerodynamics.
- 16:50And in the early days, one of the first ones was called a fan car.
- 16:55And it was this bizarre car where they put like a rubber skirt on the car and literally put a fan that just sucked the air out and just like it was like a vacuum to the surface.
- 17:03And that that was around for a little while. So it was banned.
- 17:06Yeah. But it was they actually withdrew it before it was officially banned.
- 17:10There was some odd politics going on. Interestingly, the guy that designed that has just come out with a road car with the same system in place.
- 17:16So if you want to, if you want to buy the experience that you can buy it now.
- 17:20Amazing.
- 17:22This portion of Talk Python To Me is sponsored by Linode.
- 17:26Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
- 17:30Develop, deploy and scale your modern applications faster and easier.
- 17:34Whether you're developing a personal project or managing large workloads, you deserve simple, affordable and expensive.
- 17:39Cloud computing solutions. As listeners of Talk Python To Me, you'll get a $100 free credit.
- 17:46You can find all the details at talkpython.fm/linode.
- 17:50Linode has data centers around the world with the same simple and consistent pricing, regardless of location.
- 17:56Just choose the data center that's nearest to your users.
- 17:59You'll also receive 24/7/365 human support with no tiers or handoffs, regardless of your plan size.
- 18:05You can choose shared and dedicated compute instances, or you can use your $100 in credit on S3 compatible object storage, managed Kubernetes clusters, and more.
- 18:16If it runs on Linux, it runs on Linode.
- 18:18If it runs on Linux, visit talkpython.fm/linode or click the link in your show notes, then click that create free account button to get started.
- 18:25All right. So it's in this context of working in these really intense aerodynamic requirements that the cars have today that you started working in the first team that you work for.
- 18:36At the time you were working for it, it was called Forced India.
- 18:39That's right.
- 18:40And now it's called Racing Point.
- 18:42Yep.
- 18:43If people listen to this episode next year, it's going to be called Austin Martin, I believe.
- 18:48That's right.
- 18:49Is that right?
- 18:50Yeah.
- 18:51Yeah. Okay.
- 18:52So that group, and at least so far, has always been the pink car.
- 18:55So that makes it pretty obvious, right?
- 18:57All right.
- 18:58So yeah, you said you started there and you had that interview.
- 19:01Tell us about like, you showed up, there's a bunch of bash scripts.
- 19:04Yeah.
- 19:05Then what?
- 19:06So then basically, the first job I had was to sit down and to convert as much of that into Python.
- 19:11There was an aerodynamicist who had since moved on, who was kind of also interested in Python.
- 19:16I'm not sure how he got interested in Python.
- 19:18So he'd done a small amount of work, like a sort of proof of concept, as it were.
- 19:23Yeah. Before we get too much of the details, let's take a step back and just like, what kind of problems were you solving?
- 19:28Because I know a lot of people probably don't know like the standard workflow of aerodynamicists and so on, right?
- 19:32Sure.
- 19:33So effectively, the name of the game there is to allow aerodynamicists to draw parts CAD and then within a certain amount of time, be told whether that was a good thing or a bad thing.
- 19:44So obviously, we can do that with a physical wind tunnel, which is how Formula One teams have been doing it for decades.
- 19:51And then more recently, as technology has caught up, we can do that with simulations, which are called computational fluid dynamic simulations.
- 19:58So when I think back to my math experiences, like basically the hardest math seemed to be around fluid dynamics.
- 20:04So that sounds like there's a lot of computation.
- 20:07There's a lot of a lot of things going on there.
- 20:10It's not easy to do that kind of stuff, right?
- 20:12Sure.
- 20:13So like laminar flow, very basic flow is fairly easy to model.
- 20:16It's when you start talking about the turbulence that goes around the car, which is what a lot of teams exploit, what all the teams exploit to really get a lot of that downforce.
- 20:25And that's when you sort of get away from realized sort of mathematics into more sort of guesswork.
- 20:31I guess it's come from lots of years of getting as close as possible to having something that's real, but it's still a bit of guesswork.
- 20:39Right, right.
- 20:40Okay.
- 20:41So in this context, you showed up and you're working.
- 20:43There's a bunch of bash scripts that like piece together like the CFD computational fluid dynamics pools and maybe data coming out of the wind tunnels.
- 20:50And you're like bash scripts.
- 20:52Come on.
- 20:53Exactly.
- 20:54Which is, it was very common.
- 20:56Most of the guys that set the stuff up from university and that's how they did their projects at university.
- 21:01Right.
- 21:02Probably didn't come as developers, but probably came out of engineering disciplines.
- 21:05Exactly.
- 21:06Yeah.
- 21:06So they had the same attitude from university, which was, we just need to get this done.
- 21:09We know bash, which is perfectly fair enough.
- 21:12The goals really were to get something that was a bit more reliable because you obviously you change a line in bash and you've got no real accountability for that change.
- 21:21It could, if one part of this sort of pipeline fails, then the whole thing would fail.
- 21:26So it needs to be made more robust.
- 21:29And we wanted to start sharing code because it was, there was these mammoth bash files for each sort of discrete part of the process.
- 21:36And can imagine trying to debug those things.
- 21:39Or if you want to change something, you're like, oh, we really don't want to touch that part.
- 21:42That part's bad.
- 21:43There were days where we'd sit there just staring at thousands of lines of bash, trying to, trying to find, you know, very, very small problems.
- 21:51Is there a debugger for bash?
- 21:53I don't think, not that I've ever heard of.
- 21:55So we were using Eclipse at the time, the IDE.
- 21:58You had the theme, the bash theme, which helped a lot.
- 22:01Yeah.
- 22:02Just, just even for counting brackets.
- 22:04It's syntactically correct.
- 22:05It's sort of.
- 22:06Yeah.
- 22:07Exactly.
- 22:08But I don't think there was specifically a debugger.
- 22:09Yeah.
- 22:10Yeah.
- 22:10And not that I'm sure someone will send us a message in the show notes.
- 22:13Like here's the debugger, but yeah, that it's not easy to work through those things.
- 22:16Yeah.
- 22:17We've done stuff with minus X, obviously to get a step-by-step printout of what was going on, which we had to resort to quite often.
- 22:23But the level of, verbosity that you'd get back would be far too much for what you really needed that, you know, it would have just been a variable that hadn't been set correctly.
- 22:30And yeah.
- 22:31Yeah.
- 22:32That take a day to debug.
- 22:33Okay.
- 22:34So you're going to convert these over into Python and you also wanted to share more code, started using databases, things like that.
- 22:39Yep.
- 22:40So there was already some use of a, SQL, my SQL in the first instance database that was being written to in order for an existing web app to be able to display mostly headline numbers could then be drilled down into.
- 22:53So once you sort of change the part on the car, it would tell you the kind of effects that that had.
- 22:58And so, yeah, it was about really getting more into the database than just, you know, summary, as it were things like we would need to produce images.
- 23:08And that was all file name based to begin with, which is fine until you suddenly have a new variable, for example, on the, in the image.
- 23:16And then suddenly your whole naming convention falls apart.
- 23:19So it was basically just lots of little bringing it up to some grade of sort of, I guess, enterprise grade rather than the kind of university thesis grade that it was at.
- 23:30Sure.
- 23:31How did people interact with it?
- 23:32It was basically like a website or some kind of GUI app or what was it?
- 23:36Yeah, the biggest kind of the front page as it were, was a web app at the first company was all written in PHP.
- 23:41And there was, there was an existing site when I started work there and sort of ended up doing quite a lot of modifications to that.
- 23:49It was all static pages when I first started.
- 23:52So trying to make them more interactive so that people didn't have to keep hitting refresh every sort of two minutes.
- 23:58And there's a lot of image manipulation because you're talking about an entire car.
- 24:02So we would make thousands of images per car, per simulation.
- 24:07And to be able to browse those, you know, statically was not nice either.
- 24:11You're literally loading a full image each time you click next or up or down or however you're trying to navigate.
- 24:17So yeah, that was the kind of main entry point for someone.
- 24:21If they wanted to drill down at that point, they would usually open some specialized application where you can basically open the 3D model of the car plus all of the simulation data.
- 24:31So, you know, I'm sure people have seen like a picture, like a 3D model of a car in CAD.
- 24:36Now imagine the actual aerodynamic simulation data on top of that and that you can turn on and off and choose how that's being depicted, etc.
- 24:44Yeah.
- 24:45And that just required quite a lot of hardware to do.
- 24:47So that was, that was something that was sort of saved for when you really needed to drill down.
- 24:52Yeah, it's still, it sounds like a really empowering thing, right?
- 24:56I mean, instead of doing physical testing and building physical parts, plugging them into a wind tunnel.
- 25:01Exactly.
- 25:02All right.
- 25:03You can piece these tools together and dream them up.
- 25:06See what the math says.
- 25:08Exactly.
- 25:09And look at them, right?
- 25:10It really streamlined.
- 25:11You know, if you think about it for the wind tunnel, the part would have to be designed in CAD.
- 25:15It would then have to be effectively 3D printed, not in the way that your home 3D printer would do, but it's a similar concept that would then have to go and be finished.
- 25:24Because if it was the home printer, like the 150 mile an hour wind would just blow it apart, right?
- 25:28Yeah.
- 25:29And all the kind of small defects you get kind of render anything you've done useless as well, sadly.
- 25:34Okay.
- 25:35And then these model parts have to be finished by hand as well.
- 25:38So they were a team of probably 10 or 20 people literally just finishing small plastic-ish parts.
- 25:43And then the aerodynamicists would have to convince their team leader that this warranted some time in the wind tunnel.
- 25:50So then that part would be physically has to then be affixed to the model in the wind tunnel.
- 25:54That run is then performed.
- 25:56And then you get the data from that.
- 25:58Whereas with the CFD approach, computer simulation approach, at that point, just making a change in CAD and then getting the result back, it would still take a few hours to run.
- 26:08But in comparison for the time and labor that goes into the physical parts, it's very empowering.
- 26:13As you say, it's a much quicker.
- 26:15It's way better.
- 26:16Yeah.
- 26:17What kind of compute did you guys have?
- 26:18Just like machines you could send it off to?
- 26:20Or did you have like grid computing or like high end clusters or?
- 26:23So the Formula One teams tend to be quite, I say, paranoid is probably the word that comes to mind when it comes to compute.
- 26:30So there is no cloud computing done, which I think is a shame because we could really exploit that.
- 26:36So the teams have physical clusters on site due to a quirk in the rules.
- 26:42Teams had very specific clusters at the time as well.
- 26:45So there were limits on how many floating point operations we could perform within a time.
- 26:50No way.
- 26:51So I mean, I'm sure a lot of people don't know.
- 26:53There's actual limits on how much time you're allowed to do all sorts of testing.
- 26:57How much wind tunnel time are you allowed to spend per year?
- 27:00How much time on a test track?
- 27:02That's right.
- 27:03All these different things are highly, highly regulated, but down to the down to the floating point operation?
- 27:08Literally.
- 27:09And as I'm sure some people are aware, like my gosh, modern CPUs tend to do multiple floating point operations per clock cycle.
- 27:17But the simulation code that we were using, which most teams use because it was written quite a while ago, will only exploit a single.
- 27:26Some I think would exploit two.
- 27:28But it meant that the number that you were giving to the regulating body, it had to be pegged to the CPU.
- 27:34If your CPUs were performing eight floating point operations per cycle, that's what you had to tell the governing body.
- 27:42So the most important thing wasn't necessarily the speed.
- 27:45It was like your resource was number of CPU operations in a sense.
- 27:49Yeah, exactly.
- 27:50And like, how do you minimize that?
- 27:52Okay.
- 27:53And literally AMD sponsored one of the teams in the early days of this rule.
- 27:58And they pulled an old, I can't remember which, I think it was called the bulldozer spec at the time.
- 28:04If I recall, it was an old Opteron, I think.
- 28:06And literally.
- 28:07Yeah, yeah.
- 28:08It was one of the old server, server things from AMD server CPUs.
- 28:12Uh huh.
- 28:13So nothing special at all off the shelf.
- 28:14It would be almost free because they were trying to get rid of them.
- 28:17And they basically sort of through hardware killed off all but one of those floating point operations per cycle.
- 28:24And then went, oh, we've got a perfect Formula One chip here.
- 28:27And then sold it for obscene amounts of money to the teams.
- 28:30So most teams were running, we're running with those for a while.
- 28:34That's since been rectified, which is good to see.
- 28:36But yeah, it was, I'm trying to recall how many, we probably had several thousand cores.
- 28:41Each job would run on a few hundred cores spread across several machines, several hundred gigabytes of memory, if not getting into the terabytes of memory per simulation.
- 28:50Yeah.
- 28:51So yeah, they were quite hefty, quite hefty jobs.
- 28:54And they would take anything between four to eight hours to process depending on the size of the, of the model that you were using.
- 29:01I'm just still like blown away that that's the metric you got to worry about is like the number of CPU operations.
- 29:07Yes.
- 29:08It really just must drive a lot of non-intuitive or non-obvious decisions or choices or trade-offs, right?
- 29:15Like, oh, this part, we could probably do this part in Python.
- 29:18Oh, but there's a lot of operations there.
- 29:20We're going to write that in assembly or something weird like that, right?
- 29:22So we were quite lucky in that sense because the actual simulation software itself, we bought in.
- 29:28And so at that point we just said, this is what it says on the box.
- 29:32So we'll assume this is correct.
- 29:34All right.
- 29:35Although things like any like time loading the data in was a big cost because that was on the clock effectively.
- 29:41As soon as the job started, the clock's running.
- 29:44So the actual kind of the software itself, how many can some, how many clock cycles it was consuming?
- 29:51Wasn't a big issue.
- 29:52It was just about getting stuff done as quickly as possible.
- 29:54Like the isn't simulation time.
- 29:57So, right.
- 29:58You know, if, if you have a bit of Python sat there loading some artifact that's taking five minutes, that's a big problem.
- 30:05So anything that was blocking, we had to pay real special attention to.
- 30:09Oh, how interesting.
- 30:10That's such an interesting constraint.
- 30:12Maybe give us a sense of some of like the,
- 30:13some of the libraries and stuff that you were using there.
- 30:16I mean, before you answer, I just, one of the things that never, and you know, never ends to blow me away.
- 30:23Blown away by, I guess I should get it out that way is on one hand, things feel so different.
- 30:30So I think that's a high-end custom engineering company that is a high-end custom engineering company that is F1 racing teams compared to like a grocery store, a software team that optimizes like what offers do we send to people?
- 30:42You look at the tools, you look at some of the programming.
- 30:43You look at some of the programming.
- 30:45It sounds real similar a lot of the times, right?
- 30:47Yeah.
- 30:48Even though like the special sauce is absolutely different.
- 30:51Internally, it looks a lot of similar.
- 30:52All we were really doing was gluing bits of existing software together and then trying to kind of optimize around that.
- 31:00So we use like NumPy, for example, for handling all of these, all the numerical data that comes in after the simulation and just trying to, for example, average over it.
- 31:09So these would...
- 31:10One thing that is really, I was wondering about when I saw you sort of make a note of this was if you had terabytes of data.
- 31:17Yeah.
- 31:18How do you load that up?
- 31:19Right?
- 31:20Like, where does that go?
- 31:21We're using some sort of distributed computing or like processing it in little parts.
- 31:25I mean, Dask might make it work, right?
- 31:28Across different machines.
- 31:29But what was the story there?
- 31:30So we had dedicated infrastructure for loading the cases.
- 31:34So these things would have around a terabyte of RAM each.
- 31:39And so we would load, obviously, the jobs that had come off the distributed, like actual compute side of the cluster.
- 31:46It would then write out a, let's say, terabyte file.
- 31:50They then were loaded on to another node, which isn't on the regulation clock, as it were, because we finished the actual compute part, the actual simulation part.
- 31:59And then we can start actually decimating this data and getting what we want out of it.
- 32:04So this bit can take a bit longer.
- 32:05We obviously still want it to be performant because we don't want stuff waiting in the queue.
- 32:10So these were huge nodes, the really fancy Nvidia graphics cards in them, pretty big CPUs as well.
- 32:17But the RAM was the big thing.
- 32:18I mean, especially back in the early 2010s, like a terabyte of RAM was pretty serious.
- 32:23And, you know, far bigger than the hard disk space.
- 32:27And the power supply for all these computers, right?
- 32:30Like there must have been like a big, huge power system.
- 32:34Even though the cooling in what was a fairly small server room was huge because these things are just lit up all the time.
- 32:40Okay.
- 32:41So you had machines that were like heavy enough that could just basically load it up anyway.
- 32:44Yeah.
- 32:45All onto one node.
- 32:46And then we would use a mixture of some open source applications that are designed to load in these sort of big files.
- 32:53PowerView is the kind of main one.
- 32:56We replaced some commercial software with PowerView because PowerView was free and open source.
- 33:00So we could actually a develop against it and be not have to pay for the commercial side of it.
- 33:06And we did actually pay them for support, which ended up being really nice, actually.
- 33:10And so, yeah, we would use software like that as well as some Python libraries like NumPy and Matplotlib and use these two in combination to make lots of images of the car, lots of plots.
- 33:21Because, of course, we need to see as many plots as possible.
- 33:24Yeah.
- 33:25And sort of try and average out a lot of the data into something meaningful because no one can sit back and look at a terabyte of data.
- 33:32We need to pull out a kind of headlines from that, but be average over a lot of that data just to get meaningful numbers.
- 33:39Well, it sounds like a really interesting thing that you guys put together there.
- 33:43So you did that for a couple of years or five years and then you moved on to another team who decides to change its name.
- 33:50Yes.
- 33:51Because that's your history, apparently.
- 33:53To Scuderia Toro Rosso, which is now AlphaTauri.
- 33:59Yes, that's right.
- 34:00Is that right?
- 34:01So it's the Red Bull sister team.
- 34:02Exactly.
- 34:03So Toro Rosso is just Red Bull in Italian, which was nice because I got to go to Italy quite a lot.
- 34:08So, yeah, I spent quite a few years at Force India and we did some great work there.
- 34:14I worked with some really, really good people.
- 34:16And we spent a long time converting what was there into a much more sort of streamlined and enterprise.
- 34:23I keep using that word process.
- 34:25Did you look back at that time and just have like a lot of pride and like look at that transition?
- 34:29Yes.
- 34:30We helped them on the technical side of engineering there.
- 34:33Definitely.
- 34:34I think that there's still a great team there that are carrying that on.
- 34:37You know, it wasn't a case of me leaving and it all stopped.
- 34:40It's still very much all continuing.
- 34:42They're still making big strides with stuff there.
- 34:44So that's really nice to see.
- 34:46And in fact, I think they've done a few of the rewrites that I was hoping to do there,
- 34:49which is why I ended up going to Toro Rosso is because rewrote a lot of the bash into Python.
- 34:54I really wanted to rewrite that PHP web app because kind of I've done as much as I could by slapping a kind of single page application on the top of an existing PHP site.
- 35:05And I really wanted to actually use Django.
- 35:08I'd made the proposal there to replace it with Django because we were already very invested with Python at that point.
- 35:14So, yeah, the I got a phone call one night from someone at Toro Rosso.
- 35:18So it's amazing how this works in Formula One.
- 35:20Like there's a lot of churn between the teams.
- 35:22So I got a call saying, oh, we heard that you've translated a lot of stuff from bash to Python.
- 35:27We're looking to replace our processes as well.
- 35:30Would you be interested?
- 35:31I sort of said, well, yeah, I've been waiting for a while to get the go ahead to do this at Force India.
- 35:37So I'll come and I'll try it here instead.
- 35:40So, yeah.
- 35:41Yeah, that's really cool.
- 35:42What I think is really interesting about that transition is like you've got to bump up against all the challenges.
- 35:48And, you know, you made a lot of progress at the first company, but it was still stuck in the kind of the way it was before.
- 35:55And here's a chance to say, all right, if I could reinvent that world and do it the way I now know it should be done.
- 36:03Exactly.
- 36:03Like that was your chance here.
- 36:04Right.
- 36:05Which most people, I don't really think, get a chance to kind of put those two things side by side.
- 36:09So what was that like?
- 36:10Yeah, I agree.
- 36:11I mean, I fully appreciate why Force India didn't just want to start everything from scratch because everything's much better than it was four years ago.
- 36:17So why do we need to keep going?
- 36:19So, yeah, it was it was really a good opportunity.
- 36:22I really had been that sort of planning how I might do it from scratch in my head, especially facilitating Django.
- 36:29Like at the time Django was becoming quite popular.
- 36:31And I'd kind of got fed up with writing inline SQL in Python and PHP at that point.
- 36:38It's not really great either in any place.
- 36:40No, luckily it's everything's fairly sort of secure and tied down in that environment.
- 36:46Very much air gapped.
- 36:47There's no there's no Internet connectivity.
- 36:49So no little Bobby tables.
- 36:50Exactly.
- 36:51Do you know that?
- 36:52Yeah, exactly.
- 36:53Yeah, yeah.
- 36:54It would have to be an aerodynamicist doing it.
- 36:56It would be interesting to see if they could put SQL injection into a CAD model.
- 36:59That would be quite a feat.
- 37:01Indeed.
- 37:02So tell us about like when you had this perspective, this chance to kind of redo things.
- 37:05Tell us tell us about that journey.
- 37:07So, yeah, my main goal really was to kind of bring together both the web app side and the side that was running all of the simulation side.
- 37:16So as we've said at 14 year, it was very much you had a bunch of code that was running these discrete steps through the cluster and then spat out some data at the end, which was then picked up by the web front end.
- 37:27What I really wanted to do was make that much more of a single application, probably behemoth.
- 37:32And to leverage a lot of the stuff that Django gave you like the ORM, for example, is a real interest from my perspective.
- 37:40You know, having your database written out in code.
- 37:43Yeah.
- 37:43Or sometimes get a bad rap.
- 37:44I did a bad rap, but I feel like 80% of the time it's absolutely like no, no contest.
- 37:49Like it should just obviously be the thing used.
- 37:51And every now and then it maybe it's not the right answer, but that's not the main case.
- 37:55It's so nice to work with those things.
- 37:57I agree.
- 37:58Especially when you have a lot of relational data like we would have.
- 38:02So, of course, we have an overarching object, which is the simulation you just run.
- 38:06And that's connected to hundreds of discrete fields and rows all over different tables, which to manage in your mind, something that's not committable, as it were, is not nice.
- 38:17Having it all nicely laid out in Python.
- 38:20And of course, your Python linter can check that what you're doing is saying passing objects around on the face of it.
- 38:26So, yeah, it makes that not just easier, but in my mind, a lot, a lot safer as well.
- 38:31Yeah, there was some, I don't know where they got the data, if it's like some internal research or just internal keeping a record of how many bugs there were.
- 38:41When I talked to Lucas Lange from his time at Facebook and Instagram, and they converted a whole bunch of stuff to have type hints, basically so the system could know what's going on.
- 38:50And they said they dropped the number of bugs that they run into quite a bit down by just having that kind of how does this hang together type of analysis in there like you're talking about.
- 39:00Yeah, I can definitely see that. Like the moment that type hinting became a first class citizen in Python, I was straight on it.
- 39:07Because it does just, as you say, all the silly things that people do it.
- 39:11I mean, not all of them, but it gets rid of a lot of the silly mistakes you make a lot more than you first think as well.
- 39:16Yeah, many of them. Yeah, for sure. Yeah, I'm with you. It's fantastic.
- 39:21Yeah, and the ORM is doing that for you on a database level. And it just means you don't have to keep creating DB connections in code all over the place.
- 39:30If you've got part of your application that needs to access the database, it's just an object to Python's view.
- 39:36So it just to me, it simplifies so much of that environment that I was very happy to use it.
- 39:41Nice. So you rebuilt a lot of that workflow over that PHP sort of static site thing.
- 39:46Exactly.
- 39:47In Django. And that sounds like it was a really good experience, right? Like what was the contrast between like a PHP site and Django?
- 39:55To me, I think PHP has moved on quite a lot now. At the time when I was using it, it was mostly just a templating language, or at least we were using it as such.
- 40:04Right. In 2010, it probably was already not brand new at that point, right? It probably had been...
- 40:09Exactly.
- 40:10...around for a little while. So we're talking like 2005 PHP or something along those lines, right?
- 40:14Probably, yes. So it...
- 40:16Yeah, okay.
- 40:17It was a massive difference. So it was all of the front end was defined effectively in PHP.
- 40:22I then slapped on a bunch of JavaScript to try and make it a bit more of an SPA, but it never...
- 40:28Obviously, that's... there's a limit to that.
- 40:30I wanted to make this new sort of management site completely first class SPA, because when you're dealing with so many different objects on your webpage,
- 40:41being updated constantly, the simulation is spitting out new data every few seconds.
- 40:45And if you want to track that, you don't want to be sat there refreshing the page every couple of minutes.
- 40:50Right. Yeah, it sounds super cool.
- 40:52What JavaScript framework did you pick?
- 40:54In the end, Durandal, which isn't that well known. The guy who wrote it now works at Microsoft and has...
- 41:00I've heard of it, but I've never used it. Yeah.
- 41:02So it's now... it's been sort of superseded by Aurelia.
- 41:05I think of the guy's name. I think it's Eisenberg is that name?
- 41:09Mm-hmm.
- 41:10But just look up Aurelia.
- 41:11Rob Eisenberg. Is that right?
- 41:12That's the one. Yeah, exactly.
- 41:14Yeah.
- 41:14And the reason why I liked it is because it's not very intrusive. If you know JavaScript, you'll get along very well with Aurelia or Durandal, because it just looks like JavaScript.
- 41:24You're just making observable variables effectively. Whereas we played around with Angular for a bit when it just felt like I was writing something completely new and didn't really want to spend time learning completely new world effectively.
- 41:38Yeah, for sure. I had the same sort of feeling about Angular.
- 41:41Yeah. So it was like, especially for what we were doing, I found it a great front end toolkit, honestly. And all the stuff I'd done at Force India, I'd written pretty much from scratch.
- 41:52A lot of jQuery to Polyfill because we had a mix of Internet Explorer on the Windows machines and Firefox on all the Linux machines. But mostly it was all from scratch, which I didn't want to do again, because again, that has limitations pretty quickly.
- 42:06Of course.
- 42:07So we didn't use much of the Django templating itself. So we weren't creating that many static pages with Django. We were mostly using the views as an API server, and we would just serve up this SPA on first.
- 42:20Right, just basically teach the views to return JSON and you're good.
- 42:23Exactly.
- 42:24Something like that.
- 42:25Yeah.
- 42:25Okay.
- 42:26So one thing that you put in the notes here that I think is super interesting is that you had some of the views were like performance critical, and they were backed by CPI object.
- 42:35Yes.
- 42:36So what is this?
- 42:37What is this?
- 42:37Tell me about this.
- 42:38So I'm trying to think precisely what it was doing.
- 42:40It was basically just collecting a bunch of numbers and then either multiplying them together or doing some function on a bunch of numbers.
- 42:47And yeah, that was taking too long for Python to do on its own. So we ended up basically writing that in C using py object. And then obviously, you can just import that.
- 42:58Right, exactly.
- 42:59You can use the code to do on your Django view, which is really, really nice. And it sped up the function massively. And that was a function that was called multiple times in a page load, which isn't the nicest thing to do, but it had to be done.
- 43:10So like the page load speed was improved dramatically.
- 43:13Absolutely.
- 43:14I think that's a really interesting escape hatch because Python is so nice for so many things. But there are certain things where it's just kind of slow out, right? And a lot of the libraries that get used in those places like NumPy and whatnot, they actually just fall back to C.
- 43:26Exactly.
- 43:27Internally, you just don't have to think about it, right? But this ability to say, Oh, I'm going to rewrite this in C or in Rust or something just for this little tiny bit, like you don't have to write the whole thing in it. Just this, you know, 10 lines or 20 lines or whatever it is.
- 43:40Yeah, and that's all it was. I think we wrote it once, piled it, shipped it. And then I think there's one alteration done a month later. And that was it. It just sat there for years. And we never touched it again.
- 43:50Beautiful. Yeah, the reason it's so interesting to me is because I often think about this in the terms of like a data science computation, right around those tools. Sure, they would do but like in terms of Django, it's just interesting to see it there. It's cool.
- 44:02Yeah, because we were using Django for pretty much everything except the actual driving of the simulations themselves. So we used Celery quite extensively for queuing and running micro tasks. So the simulations at this point, we're actually kicking off a bunch of Celery tasks to go and extract data, etc, etc.
- 44:19etc, etc. So it was we had two very big, not quite as big as the nodes that I'd mentioned before, but two very big nodes running this Django app across the two of them. And just having Django manage all of that with the fact that we can just import the ORM to dump data into the database was really, really nice.
- 44:36Sounds super cool. Another thing this time sounds like you got to displace was a little bit of MATLAB.
- 44:41Yeah, so that's the sort of small work I did with the vehicle science side of things. Basically, I think any software developers job in F1 is either replacing Bash, Excel or MATLAB, because
- 44:53Yeah, one of the people can replace one of the three pick one, right?
- 44:56I did. Yeah, I managed to do all three, actually. Believe it or not, quite a few teams as of recently were running wind tunnels off out of Excel, which is I still whoever wrote the VB to make that work is insane and a genius at the same time.
- 45:12Like it's a mad genius.
- 45:14It's on the line for sure between the two.
- 45:17Yeah, I was I interviewed Kane Replical from Richard Childress Racing, the NASCAR team and talked about the stuff he was doing with wind tunnels there as well. And yeah, it was like an insane amount of Excel they are doing over there in NASCAR as well.
- 45:31Like, yeah, I mean, if you have the tool, and you don't really know programming that well, but like, if we put it here, we can like, ease it together. I could see how you kind of put yourself into that corner of like, well, it works over here. But exactly.
- 45:43Oh my gosh, is it slow and hard, right?
- 45:44Again, it was when you had people who'd only ever used Excel, who were starting the teams, or at least coming into the teams when technology was picking up, you know, this is what they picked, that's what they knew.
- 45:54Yeah.
- 45:54And you soon outpace that. I mean, you know, obviously, Excel gets quite flaky when you put this level of data in. But then also you have the problems, you've got one instance that you can open, and that's it. So you had the situation where someone in the office next door would open your Excel sheet, and then the wind tunnel would stop
- 46:12adding data to the sheet because someone else had opened it.
- 46:16Because Excel took a lock on that file, and that can't be written to or something like that, right? Yeah.
- 46:20Oh, gosh.
- 46:20Exactly. It works while it worked. And then we were very happy to overwrite it.
- 46:25I mean, as much fun as it is to like make fun of Excel, and there's like all these examples of minor Excel errors leading to really catastrophic decisions, like large investments that were very bad and all sorts of stuff. But it's also I think it's also worth just admiring, like you said, okay, these people came from here, and they just knew Excel.
- 46:42Yeah.
- 46:43But they built this, this simulation thing, when they didn't really know programming or programming language, and they still did it like that's pretty awesome.
- 46:51Yeah, no, I agree. And you know, that applies to the bash stuff as well. I don't think I've met many developers that could sit down and write 10,000 lines of bash.
- 46:59You know, and I don't know I could do it. I might quit before I got to 10,000.
- 47:03And it worked pretty well for five or 10 years. It's certainly impressive in its own right.
- 47:10Yeah. So a lot of these things are both Yeah, like a lot of these are both like, triumphs, but also it's like time to move on, right?
- 47:17Exactly.
- 47:17Yeah.
- 47:18So I think Matt,
- 47:19I'm so sorry, I sort of derailed you from this MATLAB thing. So tell me about it.
- 47:22No, no, that's good.
- 47:24I'd say that the MATLAB side, unlike the other two, we wanted to replace bash and XL because of the obvious limitations. But the reason that we wanted to replace MATLAB was, I mean, purely the cost and the cost for what you gain from MATLAB.
- 47:38You know, MATLAB can be very good when you're doing very complex things. It can simulate discrete or even bits of electronics if you want it to. So we have people that will make a model for how a tire deforms.
- 47:50And then that becomes a component in MATLAB. And, you know, it's nice that you can then share that with other people in the company.
- 47:55Right.
- 47:56But a lot of the stuff they, you know, do is just analyzing the how many times a tire heats up and cools down during a lap and what window of temperature it sits in. And you just don't need to be paying several thousand dollars a year to do to work that out.
- 48:11Well, and it also gets harder to run in situations like, say, with Docker or other stuff, right?
- 48:16Like, yeah, if you want to put it on a server or scale it out, all of a sudden you're like, well, we got to get approval to run it on 10 machines instead of one.
- 48:23It's not even necessarily a cost. It's just like, why is this friction here?
- 48:27Yes.
- 48:28If I can just as equally do it somewhere else.
- 48:30Yeah, exactly. And you had times where race engineer might drop their laptop and get a new one set up at a race weekend.
- 48:37But their MATLAB license was tied to the old laptop, so they couldn't get that immediately.
- 48:41So that was a problem.
- 48:43So the job was basically just to work with the vehicle science department to make a few Python scripts.
- 48:50Effectively, they were just, you know, it weren't much more than just scripts to replace as much of MATLAB as we could.
- 48:54And really, it was just me teaching them the basics of sort of NumPy, Matplotlib.
- 48:58And then they just took it and ran with it.
- 49:01Yeah, beautiful.
- 49:01And you can do, there's so much of NumPy that replaces Matplotlib.
- 49:06And as you say, not only is it something that they can do on any laptop, you can then start actually scheduling it as well.
- 49:12So rather than having to manually run it every lap or whatever, they can just schedule it to do that.
- 49:16Yeah. So you replace MATLAB with NumPy and Excel with Pandas and you're kind of good, right?
- 49:22Exactly. You're at the races, quite literally.
- 49:25You're off to the races. Beautiful.
- 49:27Yeah. So that sounds like a really fun project you did for like three or four years to just go, okay, what if we started over?
- 49:34What if we really built what we wanted instead of what we were able to do?
- 49:38And yeah, how did people in your department and at the team react to seeing that sort of transform?
- 49:44So it was a good mix.
- 49:46One of the things I really enjoyed about working in F1 is you're sat next to your customers, which I know might sound off-putting, but honestly, it was great.
- 49:53No, it's super cool.
- 49:54If somebody came over and like, this is beautiful what you built, but if you could just do it slightly just like this, instead of, you know, well, next release, like, okay, give me five minutes.
- 50:03Yeah.
- 50:03Let me make that tweak.
- 50:05And then they're like, yeah, this is fantastic.
- 50:07Exactly.
- 50:07Right. That's a cool experience.
- 50:08I've had that too.
- 50:09And just seeing someone's face light up when you've gone from a very static web page where you're, you know, having to load literally an x-axis by x-axis of plots to being able to literally just add a click of a button, change the variable on one axis, change what position in the car that plot is looking at, then say, save that, add another one to the page, compare the two, you know, overlay them, etc.
- 50:33It's great to sit and see that, you know, everyone in Formula One is under a lot of pressure.
- 50:37So anything, anything that you can do to help take that pressure off people, they're going to appreciate it very quickly.
- 50:43Yeah.
- 50:43And anything that helps them find performance because then they look good.
- 50:46Sadly, I'm not that they're getting a pat on the back for someone designing a great new bit of aero that's adding time to the car.
- 50:53But it is nice to know that the processes I've put in place has enabled them to do it.
- 50:58Yeah, super cool.
- 50:59Are you still a fan of F1?
- 51:00Do you watch it these days?
- 51:02Not as much as I just found out, but I have, I think it's ESPN in the US.
- 51:06So I moved to the US recently.
- 51:08So I'm still getting my bearings on how to find various TV shows and things I want to watch.
- 51:14So I watched Imola and Portuguese Grand Prix, mainly because they're two very exciting tracks for me.
- 51:21The Toroso factory is very close to Imola.
- 51:25All right.
- 51:26So I've walked the track quite a few times.
- 51:28I've been to coffee outside the track many times.
- 51:31Or I always wanted to do a track day there.
- 51:33And sadly, the stars never aligned.
- 51:35That would have been fun.
- 51:36But it would have been.
- 51:37I probably would have got a bit too excited and ended up crashing.
- 51:40But it was a particularly nice track.
- 51:44So one that I was very keen to get some time on.
- 51:46There's still hope.
- 51:47I still have friends that live near there.
- 51:49So maybe I'll pay and do a proper track day.
- 51:52You might make it back there and get there.
- 51:54Yeah.
- 51:55Yeah.
- 51:55I've been back since leaving.
- 51:57I've been back there a couple of times, actually, for sort of mini holidays and things.
- 52:01And you can go and rent budget race cars there to do a few laps in, which I might do hopefully after the pandemic clears up.
- 52:08Yeah.
- 52:09That sounds fantastic.
- 52:09I'd love to do that, too.
- 52:10All right.
- 52:11So one final question.
- 52:12I kind of want to put all these pieces together and get your thoughts on it.
- 52:16So this racing world, my sense is like, it's pretty high pressure.
- 52:20It's high stress.
- 52:21It demands a lot of your time.
- 52:22And you talked about these events, right?
- 52:24Like the software has to be ready to deliver on a date.
- 52:28And it's not like, well, we'll push the release a week.
- 52:30Right.
- 52:31It's got to be there for that thing.
- 52:32Right.
- 52:33And now you're working for a tech company building almost like an operating system layer for deployment.
- 52:40Yeah.
- 52:41What's that comparison look like?
- 52:43Like if people are in one and they want to think about the other, like what your two worlds look like in those times.
- 52:48So certainly my work life balance has shifted towards life quite a lot, which is nice.
- 52:54I mean, it was a great seven odd years that I spent.
- 52:58I learned a lot.
- 52:59And the pressure was a good thing to learn a lot.
- 53:01It was the right amount to help there.
- 53:02But it's the kind of the any way I can think to describe it was move fast, but don't break things, basically.
- 53:09So we had to anything that went wrong, we had to fix quick.
- 53:12Right.
- 53:13We weren't towards the latter time at Toroso.
- 53:16We tried to get some sort of like real sprint planning going forward rather than just kind of picking stuff that was being shouted at the loudest or shouted for the loudest.
- 53:27So we tried to get some more calm and some stability.
- 53:31But ultimately, if something's broken, unfortunately, the things that would break wouldn't usually be our tools.
- 53:37It would be maybe the company that we'd paid to write the simulation software.
- 53:40Something would change in that.
- 53:42And we had to rewrite the function that read data from it.
- 53:45So that stuff had to obviously happen very quickly when it does go wrong because you just can't waste a minute.
- 53:51Or if there's, you know, a node goes down because there's a problem in the data center or something, we have to mitigate that really, really fast, as well as delivering all of these fancy new toys that we've promised.
- 54:01And they can't break either.
- 54:04So it is nice.
- 54:05Oddly, we did barely any integration testing.
- 54:08It was never really on our agenda.
- 54:10It was more sort of get as many features out as possible.
- 54:14And I have to admit, I do much prefer now being somewhere where testing is mandatory, you know.
- 54:20A little more of a safety net.
- 54:23Exactly.
- 54:24It's a lot more reassuring to hit the release button when it's been through at least some agreed upon tests rather than just being like, well, I've tested this on my laptop.
- 54:31You know, my work laptop.
- 54:33Hopefully it will work on everyone else's.
- 54:34Exactly.
- 54:35It works on my machine.
- 54:36We're good.
- 54:37Exactly.
- 54:37Chip it.
- 54:38Nice.
- 54:39Cool.
- 54:40Yeah, if anyone's thinking about going into, you know, that industry, then it's going to be intense for sure.
- 54:47If you can thrive off that environment, then you're going to love it.
- 54:50I think a lot of people are in the kind of mindset that they can thrive on it for a while and then they just need to have a bit of a break for a while.
- 54:57Some people have put up with it for 20, 30 years.
- 55:00You know, I've worked with some people who have been in F1 for that kind of length of time and we're still loving it, which is great to see.
- 55:07Yeah, good for them, right?
- 55:08I'm a big believer that careers go in sort of seasons, right?
- 55:13There's part of your life where you might be young and energetic and you don't have a large family time commitment and something like this would just be perfect.
- 55:21But then that same person 10 years later might actually hate it, right?
- 55:25They don't want to be away from the family.
- 55:26They don't want to be away from a home or like there's just...
- 55:30It depends where you are, not just who you are, I think.
- 55:32Like where you are in your career, yeah.
- 55:34Exactly.
- 55:35And it's been nice working with different things.
- 55:37So we never really exploited Kubernetes in either of the teams that I work for.
- 55:41It was something that we were starting to look at, but most of our provisioning was bare metal provisioning.
- 55:46So to have a software layer on top of that, we were talking earlier about the operations per cycle limits, like having a bunch of virtual networks that Kubernetes put together on top of that is just going to suck cycles away.
- 55:58Right.
- 55:58So we were thinking about doing that with the Django app, actually, to put that in a Kubernetes cluster across those two nodes.
- 56:04But, you know, in the end, Docker Swarm was plenty for that.
- 56:08There's no need to complicate that further.
- 56:09Right.
- 56:10There's always the opportunity to, but...
- 56:12That's right.
- 56:13There is.
- 56:13Well, that's a super interesting look inside of your time in F1 and the Python.
- 56:19It sounds like Python played a super significant role there.
- 56:21Yeah, definitely.
- 56:22I'm fairly confident that the majority of teams are pretty deep into Python now, purely because it works great.
- 56:30It's the kind of blue code that you need to be driving these kind of commercial softwares that are used for each stage of simulation.
- 56:37You can then, with the same bit of code, start making a bunch of images and plots.
- 56:42You can have your web server running in it.
- 56:44It's so kind of diverse in that sense and fairly easy to pick up.
- 56:49I should mention that although I was the kind of primary software engineer at both teams, for the aerodynamics department at least, you know, I had a lot of input from people who trained as aerodynamicists but wanted to learn Python.
- 57:01And, you know, for the most part, found it quite easy.
- 57:03What is this magic that you're wielding over here?
- 57:06Exactly.
- 57:09For example, if you wanted a certain picture to be made that we weren't currently making, an aerodynamicist could just sit down, change a few lines of code, push it into a Git branch, and we could have that running in a couple of hours, which is really powerful.
- 57:22To give someone the ability just to say, right, I want this to be added to this big chain of steps, and it just works.
- 57:31Yeah.
- 57:31Super cool.
- 57:33All right.
- 57:33Well, I think we're out of time, but it's definitely a neat look inside.
- 57:36Now, before I let you hire you, though, I've got to ask you the two questions that go at the end, of course.
- 57:40Sure.
- 57:41If you're going to write some Python code, what editor do you use?
- 57:44So now I use VS Code.
- 57:45I'll admit that I used PyCharm through my whole F1 career.
- 57:48Yeah.
- 57:49All right.
- 57:49And I've been pulled over to the VS Code side.
- 57:52Interesting.
- 57:53Yeah.
- 57:53And I think it's down to those two these days.
- 57:55Like, those are the most popular answers.
- 57:57It used to be a lot more variety when I started the show, but now it seems to be settling into those two camps.
- 58:02So, yeah.
- 58:03And then a notable PyPI package, something that's cool that you've run across that maybe people should know about.
- 58:08Yeah.
- 58:09So I've been writing some tests recently, and I had a function that I didn't really that would run a part of this code.
- 58:16And basically, it would take a while for the application running behind it to settle.
- 58:21And I didn't really want to put a bunch of sleeps in there.
- 58:23That just seemed bad.
- 58:25And I didn't want to write my own back off loop.
- 58:27So basically, I found that there's a package called back off.
- 58:30And you could just decorate methods or functions that you want to be backed off and then provide a bunch of parameters, like how many times you want it to try.
- 58:38How long you want it to wait before the next attempt.
- 58:41It was really nice.
- 58:42You just literally put the one decorator around your function and it's done.
- 58:46Yeah, that's really cool.
- 58:47And you can do things like back off on exception of these types of exceptions, then just slow down and try it again.
- 58:53And so on.
- 58:54Yeah, it's really nice.
- 58:55Especially for writing tests.
- 58:57Some kind of like too many requests.
- 58:59You know, what is that?
- 59:01Some 400 error, right?
- 59:02Like there's someone that says too many requests.
- 59:04That one, let's just slow it down a little.
- 59:06Yeah, so if anyone's dealt with the AWS API and has got that, the rate limiter from there, this is a great library for that.
- 59:12Okay, cool.
- 59:12Yeah, it's a great one.
- 59:13And I hadn't heard of that before.
- 59:14Very neat.
- 59:14All right, final call to action.
- 59:16I'll give you two angles here.
- 59:18One, if people want to get into some kind of racing career with software development skills, what should they do?
- 59:23And then maybe getting started with your Kubernetes charms, charmed Kubernetes stuff.
- 59:28Sure.
- 59:29So if someone wants to get into, I mean, the Formula One software development side, there's really two approaches.
- 59:35I think most of the aerodynamic and the sort of wind tunnel, well, both the CFD and the wind tunnel side will be Python these days.
- 59:44A lot of C# is being used in Formula One now as well.
- 59:47So if there's anyone who's got a taste for C#, anything that's done on Windows will be written in C# now.
- 59:53So for example, the driver in the loop simulators, you know, the actual simulators the drivers sit in will be all written in C#.
- 1:00:00So yeah, you don't even really have to be that big into F1.
- 1:00:04I happen to be because I've been racing since a kid, since I was a kid.
- 1:00:07But yeah, as long as you've got some sort of basis in Python and or C#, just apply.
- 1:00:13I mean, just try.
- 1:00:14I really wasn't that experienced.
- 1:00:15I got a, you know, a lucky break and exploited it to as much as I could.
- 1:00:19Beautiful.
- 1:00:19And then Charmed Kubernetes, people are interested in that?
- 1:00:23Yeah, sure.
- 1:00:23So we at Canonical currently have two Kubernetes products that we are working on at the moment.
- 1:00:29One is called MicroKates, which is a very opinionated distribution of Kubernetes.
- 1:00:34It started off as a single node distribution.
- 1:00:36So if you just had your dev laptop and you wanted to test some Kubernetes application that you were writing,
- 1:00:43you could just literally in one command install MicroKates.
- 1:00:45Now with there's a lot of demand coming from sort of IoT and Edge devices,
- 1:00:50you can now run them in a proper Kubernetes cluster.
- 1:00:53So with literally one command to install Kubernetes and then another one to add it to your cluster,
- 1:01:01you've got it.
- 1:01:02So if anyone's used kubeadm, it's similar, except for you've got everything in your MicroKates package.
- 1:01:06You've got the container runtime and the API server and everything else.
- 1:01:10Oh, yeah, that's neat.
- 1:01:11I mean, normally I think of Kubernetes being a server side, big server type of infrastructure, right?
- 1:01:16Exactly.
- 1:01:17So one of the things that also put me off using Kubernetes in the Formula One team was basically testing on it was quite tricky then.
- 1:01:24So with stuff like MicroKates, it's really easy.
- 1:01:27You can just define the infrastructure that you want to test and you can just run it in MicroKates,
- 1:01:31whether that be on your local dev machine or in CI/CD.
- 1:01:34And now if you've got a bunch of Raspberry Pis running on some Edge platform, you can do the same.
- 1:01:39It's just a single command to install it.
- 1:01:41You have everything you need in that single package.
- 1:01:43And yeah, you just add them to the cluster with a single command as well.
- 1:01:47So a total of two commands to install it and enroll it.
- 1:01:51And then if you want a less opinionated Kubernetes distribution, all of the kind of the actual code behind it is all written in Python.
- 1:01:58It's called Charm Kubernetes.
- 1:01:59It runs off a product called Juju, which is basically the actual program that deploys and then monitors your Kubernetes cluster
- 1:02:08and then enforces that what you've asked for stays.
- 1:02:10So, you know, you can choose between the different run times.
- 1:02:14So if you want a Docker or a container D runtime, you can swap out your CNIs, so Flannel, Calico, etc.
- 1:02:21All with single line commands.
- 1:02:23And you can do it on a running cluster.
- 1:02:25And because of this sort of Python infrastructure code that we have running in the background, it's handling all of that for you.
- 1:02:32You're not having to either reapply it or gracefully bring down your cluster first.
- 1:02:37It will all do this on a running cluster.
- 1:02:40Wow.
- 1:02:40That sounds neat.
- 1:02:41Awesome.
- 1:02:41So, yeah.
- 1:02:42Two very different paths for people to check out depending on what they're interested in.
- 1:02:45So let me just ask you real quick, since you mentioned it, what kind of racing did you do?
- 1:02:49I did endurance karting.
- 1:02:51So there was a series called EPEC, which is European Pro Kart Endurance Championship.
- 1:02:57So we did 24-hour races across Europe.
- 1:03:00No way.
- 1:03:0124-hour kart races?
- 1:03:02Oh, my goodness.
- 1:03:03Yeah.
- 1:03:04So there were three or four of us per team.
- 1:03:06We do two or three hours each and just keep rotating like that.
- 1:03:10People might think of karts as like things they go ride at little adventure parks.
- 1:03:15But the racing karts are beasts.
- 1:03:17Like those things are really fast and intense.
- 1:03:19So, yeah, it's an interesting world.
- 1:03:21They're cool.
- 1:03:21Yeah.
- 1:03:22They're not the kind of bachelor party things that I think you'd imagine.
- 1:03:25They're capable of doing 100 miles an hour.
- 1:03:27So you do have to have your, you know, it's not good to be sleepy.
- 1:03:30Two inches off the ground.
- 1:03:31Oh, if that.
- 1:03:32Two inches off the ground with no seatbelt, right?
- 1:03:34Yeah.
- 1:03:35Even.
- 1:03:35Two millimeters, I think.
- 1:03:36Oh, my goodness.
- 1:03:38Well, Joe, this is a super cool look at what you've been up to.
- 1:03:41And thanks for sharing another cool Python story.
- 1:03:44Thank you very much for having me.
- 1:03:45Yeah, you bet.
- 1:03:46Bye.
- 1:03:46This has been another episode of Talk Python To Me.
- 1:03:50Our guest in this episode was Joe Borg.
- 1:03:52And it's been brought to you by us over at Talk Python Training and our friends at Linode.
- 1:03:56Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
- 1:04:01Develop, deploy, and scale your modern applications faster and easier.
- 1:04:05Visit talkpython.fm/Linode and click the create free account button to get started.
- 1:04:10Want to level up your Python?
- 1:04:12If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 1:04:16Or if you're looking for something more advanced, check out our new async course that digs into all the different types of async programming you can do in Python.
- 1:04:25And of course, if you're interested in more than one of these, be sure to check out our Everything Bundle.
- 1:04:29It's like a subscription that never expires.
- 1:04:31Be sure to subscribe to the show.
- 1:04:33Open your favorite podcatcher and search for Python.
- 1:04:36We should be right at the top.
- 1:04:37You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
- 1:04:46This is your host, Michael Kennedy.
- 1:04:48Thanks so much for listening.
- 1:04:50I really appreciate it.
- 1:04:51Now get out there and write some Python code.
- 1:04:52I really appreciate it.