Building a Fly.io driver for Laravel Sidecar (Part 1)
Working on a new open source driver for Fly.io and Laravel Sidecar.
Everything I said
Here we go. All right, let's check. Oh, looks like I'm live. Is it choppy? No. Nope, nope.
Seems okay. Hello. Cool. Good so far. Let's see.
Looks like I'm live there too. Hey, Khalid. Is it coming through okay here? This is pretty good. Test, test.
Dan, please tell me, what is, what is your immediate use case for this? Oh, Twitch is showing a black screen. That's too bad.
It sure is, isn't it? What is the point of Restream if it's not gonna work? Um. Hmm. Oh, hey, Bathman.
So what's the deal with Twitch, huh? Um. So you can hear me, so that's something. I wonder, um... Guys, this is why I wanna build my own Restream, because I don't feel like this is very good.
So let me go to the creator dashboard, stream manager. And it just sure doesn't look like it's working, does it? Oh, hello from Ethiopia. That's fun. I wonder if, um...
I wonder if I turn down the bit rate, if that will do anything. What's the deal with Twitch, man? From India. Nice. We may just not have Twitch today. Hey, Jordan.
Hey, Philippe. This is cool. I do like the chat. The chat looks pretty. So I'm trying to figure out, um... Yeah, I just turned it down, I just turned it down, uh, to six. I'm still getting nothing. Says offline.
Restream says I'm online. Be honest, if I can't get this Twitch thing figured out, we're just gonna leave it alone. Is it showing you the screen now too?
Yeah, I don't want to enable... What is-- Yes, opt out, I don't care. What does it say? Share your clips. Yeah, whatever. Oh. Bit rate adjustment did the thing. Okay. Can I show you guys a little secret? Um, let me show you.
So if I clear this out and I go... This is a little secret. I'm not really-- I haven't finished working on this yet. I don't think this has any, uh, secrets in it, but look at that. Ha ha ha.
Look at that. That's cool. So I can make sure there's no secrets. Uh, yeah, yeah, yeah, yeah. No secrets, no secrets, no secrets. This, this is my, um, this is my Restream replacement. It's not live yet, clearly, 'cause I'm still running on Restream. Um, but this is my plan to replace Restream.
It's just, it's just Nginx. Uh. Oh, hey, Jordan. It's just Nginx with this RTMP plugin, and then I transcode it To the right bit rates for each platform.
And so, hey, Jason. Um, so this is the goal because what I don't wanna do is send crappy bit rates to YouTube when it supports 15K and Twitch supports six. So, the goal is to host-- I actually have this, this is hosted on, um, this is actually hosted on Fly.io.
It's not what I'm working on today. But this is hosted on Fly.io and on one of, like, their super beefy machines. Um, let me see if Fly toml has any secrets in it. I bet that has secrets in it. Oh, no, it sure doesn't. Um, yeah, so since that has no secrets, so this is hosted on a Performance 16.
It's just this massive machine, but, you know, it costs like, you know, it costs like a dollar an hour or something silly. So, um, yeah, I'm gonna run that in the future. The reason for replacing Restream is I don't like it. So, um, Restream, you send it, you send it your stream, and it just forwards it on.
And I thought what you would do, uh, I thought what you would do is you would send it this, like, massive, beautiful stream, and then it would, like, transcode it to match the settings for each platform, but it doesn't do any of that. So you gotta... You're stuck with the lowest common denominator, which is frustrating.
So what I wanna do-- So the other option is... Oh, guys, we can try out my new drawing setup. Look at this. Watch this. We're gonna draw something. Isn't this awesome? Uh, the overhead light is a little, it's not terribly flattering.
Um, all right, let me get the paper out. Finally. All right. We, uh, okay, so the paper's at a little bit of an angle, so that's kind of a problem. Look at that. So then I gotta cut off the edge here.
Guys, it's working. Look at this. Look at that. I push a button, boom, light goes off, back to the screen. Push a button, boom, light comes on, we're drawing.
All right. Where am I here? Okay, this is good. Big paper. So this is my corner here. Yeah, I could totally do this. This is cool. This nice oak, Jason, you know what this is? That is an IKEA butcher block.
Importantly, not an IKEA, uh, countertop because it's much, much deeper. This back here, that's an IKEA, that's an IKEA, uh, countertop. This is a butcher block. So, here's what I want. Whoa, this is cool.
Sorry, guys, I'm terribly distracted. This is so cool. Um, okay. So I have my computer right here, right? And it's sending out... This is great. This is the silliest thing I've ever done, and I've, I love it.
Um, oh, yeah, I hope it doesn't bleed through. Eh, it should be okay. Let me show you, let me show you. Now I understand why streamers get distracted all the freaking time. Let me show you, um, where this paper is coming from. Da, da, da, da.
Here we go. Here we go. So if we look over here, uh, several days ago, Mark, and I got a, his name is Jakewith. Mark Jakewith tweeted this about this, um, this IKEA roller thing that's made for children. Let's, let's be clear, this is definitely made for children.
And said, "This is Aaron Francis coded." Funny enough, I already had it bookedmark- bookmarked, but then he tweeted that and I thought, "Yeah, I need, I need this. I don't know why, but I need this." So, I bought it, and this morning, bright and early at like 6:00 AM, I installed it. If I zoom, does it zoom?
God, that freaking rules. So I installed it under my desk. I had to modify it a little bit. Um, I had to like add some screws where screws don't go. Um, but now I've got a paper roll mounted to my desk, and I can do stuff like this. So that rules.
All right. So I'm explaining why I don't like Restream, and then we'll get to the real stuff. How deep is your desk? It's quite deep. Um, where is it? 42 inches deep.
All right. Here's why I don't like Restream. Um, so I send, this is Aaron's computer with my happy face on it. Hi, guys. That's me streaming. Um, yeah, it's extremely deep 'cause I have all the stream stuff back here.
Um, so Aaron's computer sends out a stream to Restream, and it just sends it straight on to, uh... It sends it to Twitter。 I'm not gonna call it X. That's ridiculous。 It sends it to YouTube, and it sends it to Twitch. So this is Restream right here in the middle, but I have to send 6K 'cause it sends 6K, 6K, 6K, 6K.
Not that great, especially if you're on YouTube, right? So the other option is... This freaking rules. I love this so much. The other option is, here's Aaron's computer. He's streaming. I could send it, I could send it to YouTube, I don't know why I switched order, Twitter, and Twitch at...
What did we decide? YouTube supports 15K. Twitter supports... What did we decide? I think we decided Twitter supports nine and Twitch is six or something. Maybe that's backwards. But then here's the problem.
I gotta, I gotta do all the encoding here on my computer, and I gotta send it all over my network, which I don't want. Um, so instead of Restream here, we're gonna have, uh... What did I call it? Gorgon? I think Gorgon is one of, like, the multi-headed monsters. What's a Gorgon?
Yeah, there you go. It's Medusa's sister. Snakes for hair. It's pretty clever, right? It's pretty good. Yeah, I'm building a transcoder as a service. So instead of Restream... Oh, you didn't see that. Look, Gorgon, one of the three sisters. Snefo, uh, each of those three sisters, Medusa, snakes for hair.
Yeah, scary stuff. So instead of Restream, we've got Aaron's new Gorgon, and I can send, why the heck not? We'll send 20K there, and then it will encode, and it'll send 15. What did we decide? Nine and six. That's what, that's what I'm building.
Not today, uh, but in general, that's what I'm building. The other problem is I have to get, I have to get all the, um, chats back to my computer. That's the other problem. So this is just an Aaron project, this, this Restream thing, 'cause I don't...
Maybe I'll open source it, but I do not Arvid, as you know, running a SaaS is hard. Uh, I don't wanna do that right now. I need to get dual brush pens. Uh, Dale, will you put in chat what that is? Restream, I do not care that I've received 100 messages today.
Why would you do that? Why would you do that for, to me? Um, yeah, I need an, I need a reverse Gorgon. I don't know what that is. Uh, yeah, Mitch, that's exactly what happens. So this is the Fly 16X performance one, and it only turns on when I'm streaming. Oh, the other good thing is, uh, if my stream accidentally dies or I have to, like, restart OBS, because it's OBS, with this setup, it will just continue to
stream out, and then I can reconnect to it and start streaming again, and it'll pick up, it'll pick up right, uh, right where it left off. So I don't lose... 'Cause you know what's super frustrating is when OBS dies and you have to restart, uh, the stream, it starts on a new freaking link and, like, a new Twitter.
I did that when I was, uh, launching high-performance SQLite. Uh, it died, and I had to restart it and had to tell everybody, like, "Hey, come over here, come over here." Um, so that's frustrating. So that is, that is Gorgon. Um, I have actually started working on, I've work- I've started working on scraping the chat, and then we'll get started.
I gotta get started. Um, there's a project which does this in Nginx and FFmpeg. Well, AJ, good news. You are in luck, my friend. Um, that project is this. So there you go.
So what it does is it takes the incoming stream, and then it farms it out to this transcode.sh and passes through the desired bitrate. And so if we look at transcode.sh, you see input, bitrate, output, and then here's all the, the wacky stuff.
Um, and see, I just wanna do this once and then never think about it again. That's the goal. Um, if Gorgon crashes, could we say it turned to stone? In fact, you could. Um, so it sets all these FFmpeg parameters. Hey, Patricio. Um, why did you choose to scrape the chats?
Yeah, so let's look at where would we find that? Um, where would we find that? Probably not there. I bet it's in the try hard folder in the streaming template Bet it's in here.
Let's just make sure. I haven't confirmed that there are no secrets in here. Yeah, I don't think there are any secrets. Um, aw, thank you, Just Player. All right. So no secrets here. This is a, uh, Chrome extension that I wrote this weekend to scrape the chat from the live streams.
So I'll have to do a full stream on this sometime 'cause it's terribly interesting. But if you look, it's like on these, on these, uh, URL matches, inject this, and on this URL match, inject this. And so if we go over to YouTube, it's extremely simple. It's a checkChat function that runs every 258 milliseconds, 'cause why not?
Computers are powerful. We can do whatever we want. And then, uh, it just looks for these, uh, these elements on the page, turns the avatar opacity down so I know that I've already processed that one. Uh, actually, that's where it does it. That's where I check it to make sure I don't get a chat message twice, and then it grabs the author and the message.
Right now it just logs it, but I imagine, I imagine I'll have it post to a server somewhere. Um, so that's the one for YouTube. The one for Twitter is extremely similar, although Twitter uses some React slop, and so it's really hard to, like, find the elements. And so this is as good as I can do.
They left, they left a test ID on there, um, so their loss is, is my gain. So I'm using their test ID to find the avatars, and then I pull out, uh, I pull out the message similarly. Get author and message, just kind of mucks around in the DOM pulling it out.
So Twitter's worse because you have to be logged in, which sucks. Um, so Twitter is worse also the way that I think their stuff is rendering. It constantly inserts the first node over and over and over, and so that's really frustrating. Um, so I think what I'm probably gonna do, yeah, their APIs do suck.
If you've ever looked at the Twitter APIs, it's just im-impossible. Um, you just-- One, you gotta pay like $50,000 to get access, and two, that's three. Two, it just, it's nothing. It sucks. Um, so I think what this will end up being is I will deploy a headless Chrome, actually headed Chrome browser on fly.io and just have this kind of running out there while I'm streaming and post it back.
I think the Twitch chat API is incredibly straightforward. I think it is. Um, yes, everyone else is just annoying to use. Incredibly annoying to use. So instead of like, I mean, if you've ever been into the Google Credential Center and try to generate credentials for whatever you need, it's, it's a bureaucratic nightmare.
So I'm not gonna do it. I do whatever I want. That's the great part about being a developer. I do whatever I want. Um, all right, so let's get rid of this sheet of paper for we no longer need it. That's Gorgon coming, uh, soon. I don't, I don't really wanna commit to any timelines.
What are we gonna do today? That's the question. What are we going to do today? Um, s-s-s, um, you like this background? Is that what you're saying? The little dot grid? If you like the dot grid, that's a Steve Tenuto original.
Steve made that for me. Steve made all of this for me. All of this, all of this Chrome that you're looking at, Steve did that. He created a, I think he created a Nuxt project. Um, in fact, if we go... We're just looking at Gorgons, weren't we? Um, if we go to localhost:3000, you'll see a Nuxt project that looks blank.
However, it's hard-coded to be the right size. So that's my, that's my stream overlay. Um, the chat itself is an overlay in OBS, and then the camera is obviously an OBS thing. So good guy, Steve. Here's what we're gonna do.
Here's, here's what we're gonna do. So I have this library. It's a very good library. Like some things in my life, it has suffered from neglect. Um, but guys, I have a million children, and I've just started a business. I've got a lot going on.
Here's what we're gonna do. Um, Laravel. No, don't call it Laravel Sidecar. Call it Sidecar for Laravel. Look at that. I even got the snippet. Sidecar packages, creates, deploys, and executes. That's kind of wordy, isn't it? I wonder if that's too wordy. Lambda functions from your Laravel application.
Hey. Hey, Hemp Hill. So this is what, uh, this is what Sidecar does. It is an open source library for Laravel that, um, bundles up, let's say like- A Node.js, um, or just like a JavaScript function, basically.
It ships it off to AWS Lambda, and then it provides you a way to execute that function without worrying about-- Nice try. Without, uh, without worrying about any, like, APIs or anything like that. So I don't know if those docs are still alive.
Hey, those docs are still alive. Hammerstone is dead, however, uh, in its, in that incarnation, so I need to move all these docs to aaronfrancis.com. I have a lot to do. Um, all right. This is what it looks like. So you have your PHP class. That highlighting is bad, huh?
Ugh, why are there a million things to do? You have a PHP class, and you say, "Here's the path to my JavaScript function." Good news, it doesn't have to be JavaScript. It can be, uh, it can be Python, it could be PHP, it could be Go, it could be .NET for whatever reason, it could be Ruby, it could be anything. Um, yeah, so it's great.
Look at this. Look at what Dan says. We used it a week ago. Sidecar, nice. Used it. Literally sidecar, cool. Used sidecar a week ago for creating PDFs on Lambda rather than bogging down our main server. Yeah, that's the goal is you put, like, either weird requirements, so let's say you're running a typical Forge server, and for whatever reason, you need to run a Python function.
Like, could you install that? Yeah, you totally could. Do you want to? Meh. Ugh. So that's what this is for. Um, and then that's just an example of a JavaScript function, and then you can just execute it as a PHP class. Um, Francisco, hello, my friend.
How's being a new dad? Um, so this is what we're gonna do. However, should we draw? I wanna lay out a vision, 'cause where there is no vision, the people perish, something like that. Is that right? Where there is no vision...
Is that right? The people perish. Yeah, there you go. Where there is no vision, the people perish, but he that keepeth the law is happy is he. Huh, I didn't know there was a second part. We're gonna lay out a vision. Gotta lay out a vision. Can you see this bleeding through? Eh, it's fine. Um, let's move it down here a little bit.
So right now, um, get this out of the way. You've got your Laravel app, and it can go to, simply go to AWS. That's all you can do. So it calls out, AWS sends the response back to Laravel. That's fine. Lambda's great, right?
Uh, Lambda's great because it scales forever. What-whatever. Who knows? Lambda's cool. Um, however, there's a lot of, uh... Lambda kinda sucks also, 'cause it's AWS. Very, very powerful, kind of annoying. So instead of just AWS, here is the vision: fly.io, 'cause they have this new machines thing that we're gonna look at.
So you could host your functions on fly.io. You could host your functions on, uh, what's another good functions as a service? I could see you wanting to host it on Vercel. I don't think I'm gonna write that one yet. Um, but you could host it on Vercel.
Ah, obviously, Cloudflare. So the idea is that you have this common interface, you have this common interface in Laravel to, like, say, "Hey, I have a JavaScript function that I need to run." Uh, DigitalOcean. So DigitalOcean is great, but yeah, I know Vercel's AWS, but they don't have the same, uh, yeah.
I know, I know, I know. Uh, DigitalOcean's great, but I don't think their functions API, uh, I don't think their functions API will work. I need to look at that. Um, please merge existing PRs. You know what? Ah, I'm doing my best, you know? Doing my best. We'll see. Um, all right.
So that's what we're working on. We're gonna make it work with fly.io. Where there's no vision, the people perish. Um, yep, yep, yep. Netlify. Netlify is a good one as well. How did you build this amazing chat banner ad streaming UI? Oh, it's Peter.
Hey, Peter. Uh, the way you said Mr. Aaron, sir. Um, it's just a Nuxt app. That's all. Nuxt plus OBS. That's all it is. And if I wanna change these, I just open the code and go change it.
That's it. Google has functions? Go-Google has a functions as a service thing? All right. Yes, there are open PRs that I do need to address. I will admit that. Um, sidecar browser shot? I don't think that's mine. I don't-- I think that's Stefan Zweifel's.
If that's mine, let me know. Um, yeah, it's a browser overlay, and if I turn it off... Oh, no, that's the chat. If I turn off the overlay, you see my camera gets big. So there you go. I can show you.
So I have my Canon R6. Um, I'm gonna turn off the Dell monitor. So you see Dell monitor, Dell monitor blurred, overhead cam, then Restream chat, Canon R6 secondary, overlay, and then Krisp.
I'll be curious what you guys think. Um, Krisp is, like, one of those AI microphone things, so it's using, it's using my real microphone. Um, it's using my real microphone, but it's running it through, like, this, you know, denoiser kind of thing. 'Cause I've, I was listening back to an old chat, and I was hearing lots of, like, mouth clicks, and it was making...
It was disgusting. I hated it. Here's what we gotta do. We gotta figure out what the heck a, a Fly machine is. Um, a, I know what a Fly app is. I have, in fact, um, you'll see Browser Fly and Gorgon. So these are my, these are just, like, my existing apps.
Browser Fly is the one, uh, Browser Fly is the one that hosts the Chrome browsers, hopefully for scraping, uh, live chat in the future. Gorgon is the one that hosts the RTMP multiplexer. Is that right? Is the multiplexer right? I don't know if that's the right word. Um, so those are the two apps that I have, and if we click into the apps, you'll see the machines.
No machines. This is the thing I gotta figure out. I gotta figure out what the heck a machine is, um, because truly, I, I do love a bit. I love, like, I love a recurring bit, but truly, I have no idea what a Fly machine is, so this is not a bit. So I gotta figure out what's a Fly machine, because they claim, um, they claim, and I'm inclined to believe them, they claim that a Fly
machine can respond, I think, in, like, three hundred milliseconds in response to an HTTP request. So that makes a good, uh, a good use case. Uh, what do we want? We want docs. There happens to be a helpful button. Oh, whoa. Learn more about Fly machines.
That's crazy. They're just very fast-launching VMs. Great. That's exactly what I need. Read the docs. See, I can't even click on that. I gotta open up the chat on my own side. Um, all right. So my understanding, low-level machine control, I think you need, I, I do think you need an app.
Fast-launching VMs with a simple REST API. Okay, that's fine. That's good. Actually, in fact, that's entirely necessary, 'cause part of my, part of the ethos of Sidecar is I need to take away the deployment, the packaging and deployment complexity. I need to take that away from you, because that's the whole point. Uh, fast-launching VMs.
Yes, yes, yes. Yep. We give you low-level control over the machines when you need to start VMs. For most of the time, you don't need to be picky. Lifecycle. A machine is the configuration, here we go, and state for a single VM running on fly.io.
This seems important. Every machine will belong to a Fly app. Apps can have more than one machine. Okay. That's fine, I guess. Let's try this. This seems fun. Uh, we gotta get that on the same desktop. Let's move that over here.
I have a button. I wrote an AppleScript. Watch this. So part of my streaming, uh, like, my overlay, you can see how I'm hanging off the screen there, and I can't be bothered to, like, do it manually. What is this, like, 1999 or something? So I have this button on my Stream Deck where I push it, and then boom. Look at that.
Perfectly sized gutter and everything. And then I also have one in case, watch this. Ho, left side. Ho, right side. And I still have the gutter, so I can work, I can have a two-up view. Maybe I need a little space in the middle there. That might be a little bit nicer. Um, so yeah, AppleScript.
You guys wanna see it? Let's see, um, streaming template. Uh, no, no, no. I bet this is in Documents. Scripts. Open stream. What the heck? Open this. Look at all these scripts.
Um, window size stream full. That's probably the one we wanna look at. And so if we hit the button there. So, watch this. Uh, I set a gutter size, and then I run this wild command that I barely understand, um, but it runs it through jq to figure out what, like, what the resolution of my screen is, and then it does a little goofy little switch here that's really just a bunch of ifs,
and then it calculates, um, where to put it. So it puts it fifteen pixels down, fifteen pixels over, and then this is a hard-coded thing that I, like, measured out, and then it adds the gutter on every side. So I can just push that button, and it runs that AppleScript, and the stream left is just almost identical, except it divides it by two.
So there you go. There you go, there you go, there you go. All right, we were gonna do something. We were gonna go, um, actually, do I have a... What's it called? Sidecar? Yeah. Cool.
Yeah, yeah, yeah. Cool, cool, cool. Let's do, um, so the first thing we're gonna do is we're just gonna... Before we dive into any PHP, which we may not even get to today, depending on how far this goes, um, yes, Peter, you do need to stream. There's nobody streaming, especially if you stream on Twitter. You get this, you get this sticky banner.
Look, look at this. It's me and it's Prime. I can't compete with him, but I'm, I'm in everyone's sidebar. Like, it's just stuck there. It's just the easiest, it's the easiest way to get in front of people. Um, yeah, you could use the SDK in your Lambda functions. Sure. I think Lambda functions all have the SDK built in.
AJ could correct me if I'm wrong. Um, but I think that's, I think that's correct. Um, all right. We're gonna try this because that seems fun, and we do love fun things. What's the point if not for fun? Uh, mkdir, what are we gonna call this? We'll call this fly.io inside of sidecar. That's fine.
All right. If we run that, what happens? Um, planet scale demo. We'll also probably kill that one. Uh, Aaron Francis personal. Yep, I wanna run it in there. What's gonna happen? Uh, cool. Huh.
That's kinda cool. So did I-- I just started a VM. Um, what's in here? There's a bunch of stuff. Um, that's kinda cool. That was fast. Huh.
Well, I think that's, I think that's gonna work. Um, all right. Now, if we exit... Well, I do wonder, um, does that show up anywhere, does that show up anywhere in my dashboard as something that's, like, running? Yeah, there you go. So this is interesting. If we look here, yeah, look.
So this is true. What they were saying in the docs is true, which is, which is not always the case, uh, with documentation. So I have these apps, Gorgon, BrowserFly, and this beautifully named interactive shell, and inside the app is a machine, and that's just the one machine that I'm running.
Okay. Okay. So then I think my question is, in the case of Sidecar, I would imagine I need to create an app for each, I need to create an app for each function. I don't know if that's right.
Maybe, maybe I'm thinking too far ahead already. Maybe I'm thinking too far ahead. I think I need to focus on... I think what I need to focus on, so what is the goal here? Maybe the goal... I didn't know Fly and Century was integrated.
That's cool. Good job. Um, one app, pass that app ID, sidecar config. I think my question is, is an app simply an organizational container? Because if an app is simply an organizational container and one machine can have Node 20, one machine can have Node 18, and
one machine can have Python 3, then I only need one app, and the machines, each, like, machine configuration could be a function. But if, uh, if an application declares more than just some sort of organization, then I'll need, then I'll need a different app per
function. Here's something else. Here's something else. This says, "Your app is currently running on a single machine." Can I scale the function, or can I scale... I can scale the machines independently. Guys, we're going too far ahead. We're, we're moving too far ahead.
Um, Fly TOML defines the apps, and that's where you define the runtimes. I think so. Is fly.io free? No, they have some sort of, like, bill forgiveness under $5 or something. I don't really know. Yeah, here's the free allowances.
There are no free allowances. Oh, there you go. Hmm. Yeah, and if you, if you spend less than $5, I think they just forgive it. But I do think you have to put a credit card on file, and I think that happened after Heroku killed theirs, 'cause they were just getting so much spam. Um, all right.
I need to read a little bit of this documentation 'cause I'm a slight bit confused about what a machine is. I do have a machine running, so I probably just wanna... Oh, that's cool. So it destroyed the machine, which is nice. That's good. We don't want, we don't want compute we're not using. Did it retain the app?
So that's interesting. Um, so the app is still running. If we say, did it put anything there? No, it didn't. Yeah. So it kept the app running, but it killed the machine. Guys, I'm a little bit, uh, I'm a little bit confused on, I'm a little bit confused on the difference here.
Status. Is it... Is that all you do? Oh, you gotta do an A. So it's still running. Hmm.
Fly scale count zero for app, that guy. Okay, so we're in a, we're in a bit of a, we're a bit, a bit of a weird state. Um, okay, now it is suspended, so maybe it just took a second. That's exactly what I want.
I want to do the job and nuke. That's exactly what I want. Okay, so we did the quick start. We started a machine, machine state, Fly machine run created, we went through that. Started, we did that. Stopped, we did that. Fly machine destroy, we don't need to do that. Scaling machines.
Remember, the ordinary way to scale an application is use Fly Launch. I don't think we wanna do that. Whether or not use Fly Launch, every machine belongs to an app. Hey, guys, reading the docs, turns out it's helpful. Um, an app is ultimately, ultimately just a named collection of resources, configuration, and routing rules.
That's interesting. Routing rules. That's interesting. Um, cool. I like that. That's good to know. You can put machines there. You can update. Hmm, that seems useful because part of, uh, Sidecar for Laravel, part of configuration, function, you
can set the memory for each separate Sidecar function. You can write... So you can do a timeout, which I don't know how it will enforce. Um, so some of these are like Lambda primitives, like the timeout is outside of the handler. I might have to write a thin middleware layer between the user's code and the Sidecar invocation, which would be fine.
Um, but it looks like I can set the memory for a machine, which will be important. Yep, so you can set the memory. Updating machine takes it down and brings it back up. I think that's fine if I do that. Um, placement, I don't really care where you put it.
I might, I might wanna give people control over that. Um, the use case for Fly over, uh, Lambda is a few-fold. I think Fly is a nice... Well, Fly is its own compute, which is nice.
Like, they're not just a Lambda wrapper. Um, so I do like that. It's also, you have a lot more control and a lot more flexibility because these are like actual machines and not just Firecracker instances or whatever they are. Um, all right. I need to... We should probably just create, we should probably just create an app because we know we're gonna need that.
So if I did... Where am I? That's fine. If I did Fly launch, does that do anything? Um, cool. Could not find a Docker file. Yep, nor detect a runtime. That's correct. Blank app. Correct. Here's what you're getting. Um, personal org, fine.
Chicago, fastest region for me. I doubt that very much. Um, I think Dallas is gonna be faster since I live in Dallas. Um, Postgres, none. Redis, none. Tigris, none. Uh, Tigris is an S3-compatible store, which is pretty cool. Do I wanna tweak these?
Yeah, I do wanna tweak these. Now what? Oh, cool. Um, all right. We're gonna call this Fly Sidecar. Fly Sidecar. You're telling me ORD is faster than DFW, where I live? I do not believe you.
Internal port, 8080, fine. That's fine. Postgres, no. Tigris, no. Tigris? Tigris? What do we think? Tigris? Tigris? Location leaks. Yeah, I live in Dallas. Please don't come visit me. Well, without warning me first.
You're welcome to come visit, but please don't show up at my house. Please don't do that. Sentry. Love Sentry. Look at that. Look at that sponsor timing right there. Sentry, right below the chat. Sentry. Thanks, Sentry. Um, yeah, we're just gonna disable that for now. Dallas port 8080.
Oh, no. Petra. Petra or Peter? Peter's coming for me. Feel free to close this tab. You got it. Cool. Created app, Fly Sidecar in personal. So this, this is important, um, because I'm gonna need to do this for people.
Like, that part that just happened, that part that just happened has to be done by Sidecar. There's gonna be a weird... It's not gonna be a one-to-one match with Lambda, which is fine. I don't care. Um, it's just a matter of figuring out the best developer experience for both of them.
This is gonna be a many weeks project, by the way. Um, hey, welcome from Pakistan. Mitch, who are Firecracker VMs? The Fly machines are Firecracker VMs. They just live forever instead of being limited like Lambda. So, you'll see these sponsors or these logos flashing down below.
These are the, these are the very nice companies that have sponsored, uh, my life basically. Yes, live streaming, but also YouTube videos and also courses and... Like, the reason that I'm able to do this right now is because Fly-- I reached out to Fly and was like, "Hey, I've got this idea, but I would love, I would love some help." And they're like, "Great, here's some help." So, make sure that you're nice to these people.
Um, Sidecar is some kind of I-IAC offered by you. Sort of, not really. It is an orchestrating layer for other infras... Well, I guess that is what infrastructures code is. Sure, yeah. Call it that. That's great. Fade's kind of slow. Jose, what do you want? What do you, what do you need?
You need it faster? I don't know. I kind of like the fade. Eh, we can make it a little snappier. So now if I do, what is it? Is it, like, Fly dashboard? Is that a thing? All right. Here's the app, Fly Sidecar. Um, I think I need to get it to a publicly accessible URL.
Um, yeah, there you go. Transmogrify. A little Calvin and Hobbes fan. Yep. There you go. So they turn your, they turn your Docker file into a Firecracker VM. There you go. Um, if we did this, so it's not connected to anything.
So let's go ahead and open this, not in... Let's open this in PHP Storm. Hit the button, resize. There we go. What do we have? Um, one thing I need from chat is, uh, what are we using instead of Express.js these days? Because I don't wanna embarrass myself.
I don't want, I don't want the, the, the Twitter people to come after me and be like, "Oh, Aaron's such a boomer. He's using Express.js." So, please protect me from Twitter. What are we using? We can close Gorgon. Hono, Hono, Fastify, Honk, Hono, Hono, PHP, Hono, Hono, Bun.
No, that's not Node. Hono, Hono, Hono. Is it Hono? Hono? Um, all right. Hono it is. Let's see if we can find that. Uh, HonoJS. Seems cool.
Should we do it? People still use Express. I know. That's how I feel. I feel like Express is fine, but everybody's like, "Don't use Express." It's JavaScript for you. Hono is Edge native. Okay. Do I need that? Mm, I don't think so.
Um, Hono's just an anagram for Oh No. Well, it's kind of funny. So, I think my goal-- So where we're at right now, um, we've got a Fly app created that does less than nothing, which is fine.
That's where we start. We always start with something that does nothing. Um, what I need to do... Oh, I need to route... I need to get a "Hello, world" response from Hono. That's all I need to do. That is the immediate goal. So if we can do that, um, if we can do that, then we're off to the races.
Is Fly the same as Forge? No. Um, Fly is more analogous to EC2 with some fundamental differences. Um, Forge is an orchestration layer Um, hey. Hey, Andy. Um, Fly is an orchestration layer. Sorry, Forge is an orchestration layer.
Fly is actual compute. They run their own, they run their own stuff, which sounds incredibly difficult. Um, so good for them. All right, we gotta figure out Hono. Um, give me... I don't want... I want docs. Get started. Guys, I'm doing JavaScript live on stream, so brace yourself.
Oh, Chili Pad fan. Yeah, not cheap at all. Um, that's why I only have half, and my wife only on my side. Um, slash theme. I don't know what that's supposed to do. Node.js. Oh, nice. Let's just do that. That seems cool.
NPM create Hono latest. That seems cool. Let's see if that does anything. Yes, that's fine. Uh, Node, right?
Yeah. It's kinda cool they have all of these, TBH. I think Node. I think we're just going, we're just going vanilla. Uh, yeah, probably. Get ready. NPM because I'm a boomer. Is Prime doing Laravel right now?
Oh, that would be awesome. It looks like he's talking about the Amazon return to office. Oracle should drop JavaScript. Man, if we could get Prime into the Laravel world. Well, in fact, if we could, I might be toast, so please, please have mercy, Prime. Ah, F.
Did it put it in my app? F. It sure did. Yoink. So now what? Um, so what did this do? Package JSON. Oh, man.
Install TypeScript. Oh, guys. I don't want that. Um, is there anything in here that I can't just change? I don't think there is. See ya.
So is that fine now? Then can I just... Uh, I don't, I don't know. I don't know what to do about that, to be honest. And I don't want any types at all.
Y'all, please don't tell, please don't tell JavaScript Twitter. Oh, guys. Um, okay. So I wonder if that's just gonna work. I can't believe they don't have a, um... Since
it has the watcher built in. All right, we can start there, but I'm not gonna write TypeScript. Let's just start there. We'll start there, and we'll see what happens. See, like what, what are you complaining about? Yes.
I do not care. Why would I care about that? Uh, we gotta change this. Uh, let's change this to four thousand, uh, forty twenty. So now, presumably, I think that's gone.
Yeah, of course. Um, presumably NPM run dev. Guys. Guys, why is it this way? Why is JavaScript this way?
Um, what did I do wrong? Oh, am I using the wrong... Let's try that. Yeah. This is, this is like, this is par for the course.
Um, Chris, you gotta save me, man. I don't know any of this, I don't know any of this stuff. All right, let's try that again. I changed... What is it? Node version. Will that get me there? All right, let's see if that works. NPM run dev. Okay, user error. Still JavaScript's fault somehow.
Um, local host 4020. Hello, Hono. Hono? Ridiculous name. Um, all right, now we need to get this on Fly. But how? Um, okay. So I'm still confused about...
Let's look at this Yep, that was generated. I'm still a little bit confused. I already looked at that. Internal port, do I change that to forty twenty? Maybe. Okay, so I feel like, um...
I feel like I'm maybe going about this the wrong way. Chris says yes, so... And then I need to like... Yeah. I don't understand how I separate machines out.
Machines. Create a machine. Given the name of a Fly app, which I have, create a machine. Oh, so maybe because I'm doing this all through Fly launch, I'm being led astray a little bit, um, 'cause I need the URI of a container image.
Creating machine without booting it. Oh, that's good. That'll be important. That'll be important later. Um, so I can create a machine without launching it, which is important. Um, so you can configure the machine characteristics like its CPU and memory through the Fly parks proxy.
Creating machine with services. See, look, maybe this is what I need. Look at that. Fastify functions. What do you do? What do you do? Where, where do I find more about you? That sounds awesome.
Ah, give me more. Give me some details. Two years ago. Um, okay, Docker... Whoops, wrong one. Docker file. Add Node, Yarn, package, package, Yarn. This looks good. Server, server, start, start, expose. Tired proxy, I don't know what that is. Um, okay, then what does start do?
Starts a Node server and a proxy from outer port to inner port. Okay, this seems cool. This seems cool. Um, what does server do? Yeah, that's what I'm freaking talking about. Um, so if I...
Is this what I want? Is this exactly what I need? This seems cool. This seems very cool. How do I do this? Um, okay. Here's what we're suffering from.
Uh, I don't know what I'm doing. That's the first, that's the first thing we're suffering from. Um, which is fine. I never know what I'm doing when I start. That's how everybody starts. If anybody tells you they always know what they're doing, they're lying. I don't know what I'm doing. That's totally fine. We need to simplify the problem. I'm jumping, like, five steps ahead, um, and I'm confusing myself and probably everyone else.
So we need to start... We need to prove things one step at a time. Um, so far, what have I proven? I can launch an app on Fly. That's great. Now I need to prove that I can get a "Hello, world" response from Fly.
And then after that, then after that, we can talk about machines and launching and all of that stuff. So gone too far, too fast, which is fine. We're excited. That's no problem. Um, so I just want this. This is what I want. I wanna yoink all of this. So in fact, um, what I don't want, sorry to, sorry to the chat, um, I don't want Hono at all.
I think that's gonzo. So then... Can I, um... Chris, can I just copy, like, can I launch with this as a template, or do I just copy it all?
Like, can I do Fly CTL launch with that as a template? Uh, Florian, it's a great question. So here's, here's something, here's something for you to think about or to help me think about. Um, Laravel, Laravel Cloud, to my understanding, full-on servers, which is great.
That's what we want. Um, but there's no concept of, like, ephemeral function executions. And so the idea is that you would host your app on Laravel Cloud, and then when you need to do something that's, like, massive throughput all at once or uses a stack that Laravel Cloud doesn't support, like Python, then you would have a sidecar function.
And that sidecar function could execute on Lambda, could execute on Fly, could execute on whatever. Um- And so it's kind of like an adjunct to your main application, and it provides other things like scale and, uh, it provides scale and different stacks.
You can update your Fly.toml and set that as a Docker image. Cool. Let's try... Chris used to work at Fly, so Chris knows everything. Now, where, how do I do that? Fly Blueprints.
I need, uh, apps on Fly, Fly launch. Oh, see, look, specify... I don't think I can click that. Specify a Docker image. Um, can I click on that somehow?
Probably. If I open Restream, I bet I could click on that. Man, y'all are the best. Y'all are the best. I hope, uh, it's somewhat encouraging that I don't know anything. And if you don't know anything, we're on the same page, my friends.
Heyo. Yoink. That's mine now. Where do you go? In the build section. Okay, come on, PHP Storm, come on. Hey, come on. Um, and then I want... Oh, I think this, I think that is that. So it's maintained by Fly, and it is the Fastify functions.
Uh, yeah, Chris gets all the credit. Did Jason do something? Probably not. If somebody else besides Jason did something, I give them credit. Um, but if it's between, if it's between Chris and Jason, yeah, Chris gets all the credit. Sorry, Jason. Um, we've got, we got some Laravel employees here.
Shouldn't... I'm gonna tell Taylor you guys are watching TV instead of working. I'm kidding. I think we're good. So what if we did, um... So we've got Fastify functions, internals eighty/eighty. Yep, that's fine. Auto stop and start machines.
That's kinda... That's interesting, but that's too far ahead. We're not, we're not thinking about that. Seventy-five percent. Oh. All right. Florian, you have an excuse. It's, it's, uh, it's nighttime hours for Florian. Chris is just here. Chris is in trouble. Um, what if we did Fly... What do you do now? Do you do Fly launch or do you do Fly deploy?
Fly deploy. I will say that's a cool experience when you can just be like, "Yeah, just go make a bunch of stuff for me." All right. This deployment will create two app machines. No machines in group app. Launching a new machine. Creating a second machine to increase service availability.
Love it. Good job, y'all. Thanks, Fly. Um, all right. Let's see. Ah, wrong browser. Ah, I don't wanna spoil it, but ah, it worked. I have a, I have a secret browser over here where you guys can't read my messages.
Ah. Guys, this is... That's the feeling. That's the high. That's what we're chasing always. We're always chasing, "It worked." You just, you know, you just can't, you just can't replicate it.
Feels good, man. So what have we proven? What have we proven? Um, we have proven we can deploy an app. Uh, rather, let's back up. We've proven we can create an app, which is indeed step one. Then we've proven, um, that we can deploy an app from a preexisting Docker image,
which I think is important, but not the ultimate goal. So we're, we're kind of on a, we're, we're s- we're on a stopping, a waypoint here. So we have proven we can create an app, we can deploy an app from an existing image, and I think maybe most importantly, we've proven we can hit it from the outside world. Because the way that the sidecar driver works on Lambda, there's no publicly exposed URL to your Lambda function.
Um, it uses the AWS SDK to hit those functions. But for Fly and presumably, you know, Cloudflare as well, presumably you have to hit it through a public function URL, which is totally fine. I, I don't begrudge that. Um, but it is a reality that we will have to overcome because we'll have to, we'll have to have an HTTP server waiting and
responding, but also importantly, uh, enforcing authentication. And no, I'm not gonna use a hosted service for that. It's just gonna be a simple, a simple key pair. Um, okay. So we've proven those things. What do we need to prove next?
Um- I think we need to prove that we can write our own, we can write our own Docker file because that is gonna be in the purview of Sidecar. Sidecar will write, Sidecar will write that Docker file on your behalf. Um, and so I think it's relatively important that we prove that next.
In fact, let us, let us do this. Um, we're gonna yoink that, but before we do, we specified a Docker image, which is cool. Dig that. Um, do I need this right now? This is too far ahead. We need to stay focused. I do wanna look at this, Fly Sidecar in here.
Um, machines. Look at that. What's interesting is I wonder... So it deployed to... I do have, uh, a Laravel Pulse video. The AWS Lambda function URLs are not deterministic.
Um, and so I've not entered into this world on the Sidecar, uh, on the Sidecar driver yet. I've not enter-entered into a world where I need to persist any state. I think that might change with this Fly.io driver, but as it currently exists, the, uh, the way that the functions on Lambda are addressed is by name.
And so as Sidecar, I don't have to persist any state as to what that unique URL is. Um, and the URLs created are not deterministic, which means it just assigns a URL. And so from my side, I can't determine what that URL, URL is without keeping track of it. Um, and that may change because this might have some state that I need to keep track of, but that's not a can of worms I've opened yet.
Um, that's why. That was probably more than you bargained for, TBH. Um, all right, let us keep going. Do you guys know I'm lived on Li- I'm live on LinkedIn? Isn't that the silliest thing in the world? Look at this. Don't do JS, please.
I d- I don't even know if it's still, if it's still going over on LinkedIn. That's wild, LinkedIn. All right. Uh, I think we can do something neat, which is fly scale count four. And it'll just turn on more machines, which is pretty cool. Um, So we got two machines coming up.
Is there a way to, like, log this or just, um, to watch it? There you go. Watch. All right, so we got two machines. I don't know why those are still stopped. Presumably, those should be alive by now.
So those are... Wait, it stopped the old ones seven minutes ago, and it started new ones? Huh? Seems confusing to me. Um, fly scale count four.
I want four running. Hmm. All right. Well, fly scale count one. I just need one for now. Oh, cool. LinkedIn user. It doesn't even pull your name.
Come on, Restream, what am I paying you for? So here's one good thing about having very smart friends. Um, Chris says, "Fly machines stop on idle by default. If Fly decides they're needed to handle load, they'll turn on," which is very cool. So I dig. I dig.
Good job, Fly. So here's something interesting. Presumably, if I hit this, so fly status, it says stopped. Watch, we're gonna do the left and right thing. Boom, left side. Boom, right side. Now, presumably, if I hit... What is the URL for this?
Um, it was like fly sidecar. There we go. Okay, so 502 there, but it says it's starting, and now it's on. Very, very interesting. Very, very interesting. So it did start back up, um, on request, which is nice.
However, it 502'd on me first. That's interesting. Very, very interesting. I wonder, I bet you can set a minimum active. Um, I bet you can set a minimum active machines so that that doesn't happen.
Yeah, I probably do need health checks. Here's what I wanna prove next. I wanna prove we're trying to walk down the road Of proving things that I don't know, um, of which there are many. So what I wanna prove next is that we can do this ourselves. Because while it is nice, while it is nice to deploy from a preexisting image, in fact, I may have to create, I may have to create some preexisting images,
huh? Like, if a user comes in, a user of Sidecar comes in and says, "I want a Python function," do I-- I don't wanna maintain images. I noped out on that pretty quick. I'm not doing that. All right, let's do this instead. What we're gonna do is, um, Docker file.
I don't know what Tired Proxy is. Could give a... You guys, y'all got, y'all gotta learn marketing. Tired Proxy's a bad... That's too tired and eventually just shuts down. All right, I take it all back. This is genius. I take it back, I take it back. This is great. Um, Daniel, this would not... You're, you're in charge of the function code, so does it handle DB connections?
You tell me. Um, my job as Sidecar, my job is to deploy your code. That's it. Well, package, deploy, execute your code. That's it. Okay. This is cool. I don't speak Go, but the fact that it just, yeah... How am I gonna read that?
I can't read anything that's there. Um, so this is the thing that lets the machine die, so eventually it just shuts down. Um, ooh. AWS maintained images. AWS Python Docker image. Son of a...
Hot damn. That is really interesting. That might be fantastic. Um, okay. Too far down the road. That's very interesting. I like that.
Um, okay. So I need, uh, I don't need yarn lock, I need package JSON. Why do you have a package lock and a yarn lock? I guess to allow for everyone. Um, okay. So package. So what we're trying to prove now is that should we need to, which we will, we can write our own, and that's gonna be programmatically generated.
We can write our own Docker file. Um, server. Start, I think. Oh, time to shut, idle shutdown. Tired Proxy? That's cool.
I have lots of start files. Is that all I need? Uh, yarn server package license, nope. Um, yeah, probably want that. Oh, what is this? Is this a dot dockerignore? Is that what it was? Yeah. Can you guys believe that I have touched Docker zero times before this in my life?
I count that as a great success. Um, Tired Proxy needs a break. Boy, do I feel that in my bones. Um, you don't think Tired Proxy's needed anymore. All right, cool. Let's, uh, let's start there, and then let's keep going. Yeah, sorry Florian.
Um, okay. Have we done everything we need to do? Always my question. NPM install. Okay. Package no longer supported. Checks out. Sounds about right. Um, hmm. Whoa, guys.
Preparing a Terraform module? I appreciate your confidence in me. That ain't gonna happen. There's, I don't... That's more of a Fideloper sort of thing, maybe a Florian sort of thing. All right. So if this works, which I have to believe that it will, 'cause I'm nothing if not an optimist, um, then we can take the next step of removing Tired Proxy perhaps.
So let's just run it. Um, actually, in fact, however, that's enough caveats. Uh, Ludicrous 2.0. Actually, what's, what's beyond Ludicrous? Is it Plaid? I think Plaid is the next speed. Also, what is this Chaotic? All right, so now we'll know that we have changed it, so fly deploy.
Hmm, so it's much worse. Oh, it wants yarn lock. It wants yarn lock. That's why there was a yarn lock there. Do I not have... I have package lock. Why does it need yarn lock? Oh, I bet one of these requires a yarn lock.
Oh, no, no, no, no. Let's see. Oh, I'm, I'm doing the wrong one. Um, so before we go mucking everything up, let's just do it their way. Let's just do it their way first. So we have yarn lock. One of, one of m- m- one thing that I always struggle with is trying to take four steps at a time.
Um, and that gets frustrating. So what it's doing is it's taking that Docker file and converting it to a bunch of these different, uh, I guess these different layers, and then somehow it converts that into a f- a firecracker.
Um, who knows, man? It's voodoo. So I think the thing I need to change... Can I just, can I just add instead of yarn? Can I just add NPM? Can I just do that? Is that legit?
Oh, that is some cold coffee. That is supposed to be hot coffee. Okay. Well, while that's taking a thousand years, um, let's just muck around here. So we're gonna change, I think, tell me if that's wrong, and then we're gonna copy package-lock instead, and then we're gonna run NPM.
I don't know that it matters, honestly. NPM comes with. Any progress on Live OS? A little bit. Um, that is like a pure fun project, and so it gets put on the back burner. Um, see, justplayer knows, justplayer knows stuff about Docker. Unsure if it comes with Alpine.
We're gonna figure that out. Add Node.js, NPM install. Did this finally complete? See, hmm, hmm. This is good. This is exposing potential error states that I might have to work with in Sidecar. Um, let's just kill it and try again. Now we're using, uh, now we're using NPM instead.
See error, NPM run install. NPM not found. Ah, you guys led me astray. Can I just do that? Boom. No, still can't do it. What, what, what, what is your problem?
What in the world does this mean? What in the world does that mean? Ideal tree already exists? Okay. It's okay to be frustrated. Let's keep trying though. Um. Okay, so if-- We're, we're continuing to prove things.
If I remove, um, run NPM install, NPM not found. Okay? So that leads me to believe it is not bundled in here. Um, so now if we put NPM back, I think, I think we get an NPM error.
Remove node modules first. NPM is missing a working directory. Uh, yeah, I do stream on Twitch. I think I'm live on Twitch, I think. Work dir...
I need to copy this. Thanks, Florian. All right, so here's what Florian says. Okay, um, this is, this is a little bit embarrassing. I don't really know what's going on here. Um, okay.
But that's okay. I think NPM might depend on Node.
All right, we need to slow down. I'm getting confused. Um, first I'm going to delete node modules, package-lock, yarn.lock, and then what I'm gonna do is I'm gonna run NPM install. Okay. You need both Node and NPM.
Oh boy, here come the Docker commands. Um, all right, I'm gonna try this first just so we're all on the same page as to what the error is, and then we will work on that part together. There we go. Uh, the ideal tree already exists.
So... Okay. Look, this is, this is directionally correct. Okay, Florian is right. Executed in the root directory. Good so far. Okay.
Um, so this is good. This helps me. It does mean it's installed. That is correct. That is what we just proved. So in our debugging process, um, we got an NPM error this time, rather than an error that said NPM is not available. So this is, while it's still an error, it is progress, which is what we want.
Oh, from node alpine. You think that's better? That's interesting. So then can I remove this part? Let's see if we still need to set the working directory, which I imagine we do, which is fine, but I'd wanna prove that.
Uh, I wanna prove that NPM is there. Yes. Okay, cool. So that's nice. So instead of doing this, we did that. So now we're good there. Now, let's see. Uh, I need to set the working directory.
Is that right? I don't know if that's right. So this is copy everything, copy everything from my... Yeah, we can drop that. Copy everything from this directory into the app and then run NPM install, and we can get rid of that, and we
can get rid of that. Okay. How does this, how does this feel now? Does this feel closer? Run it.
Link me, uh... Joel, link me that Dockerfile generator, please. Okay.
Getting some layer reusage. Uh, I think I had node modules in the dockerignore. Did I do that wrong? Yeah. I would love to switch to PHP. I just don't know how to get into it, you know? Um, so help me understand before we check.
So we're gonna save the suspense. Okay. It is okay. Node modules is ignored. Um, okay. Overview. Show me the, the vanity URL. .fly.dev. There we go. Oh, no.
Oh, shoot, Joel, I didn't think about that. All right, so we have an issue. Um, Fly status. Do we have machines alive? We have a machine that's starting, which is not great. Um, that machine should be running.
So it's failing to start. It's refusing to start. So we m- we mucked something up. This is good.
This, this is frustrating, but this is good. Um, so here we go. So I'm-- These are-- I'm tailing the logs from the Fly machine. Um, now the idea is that you deploy this app once, and then it goes to sleep, and then you can hit it over and over and over again.
So you should only incur the penalty of deploying the app whenever things change, um, which is pretty important. Instance refused connection. Is your app listening on 8080? I think it is. Oh.
Oh. Levi. Um, okay, and there was another suggestion about copying package. All right, so Justplayer says, "Most every command you run in the Dockerfile creates a new layer that can get cached depending on what you do." And that was his Or there, excuse me, uh, recommendation.
I do recommend copying package JSON and installing it before copying the rest of the project to make it cache the install part. Hmm. Yes, Florian, you're right. Too many steps. Too many steps ahead, Aaron. Uh, Fly deploy.
See, we're all learning together. S- s- s- s- I will want to make that cached in the future, I think. I'm seeing nothing.
Replacing. Stopped. Starting. Started. Funk yeah. I'm the smartest man alive, while also, while also being quite stupid. While also really not fully understanding a lot of stuff.
Um, this is awesome. I feel, I feel very, uh... I feel very proud of this. Um, cool. Cool. I like this. This is great.
Um, okay. Um, all right. So now what have we proven? Um, what we're working towards is we're working towards, um, a system such that we can deploy, we can deploy user
functions. We can deploy user functions to fly.io, and then... So Sidecar should create the Docker file. It should package and deploy, and I think we've just done that.
And we gotta figure out execute, but we can do that later. Um, we gotta figure out the machines thing now. Um, we gotta figure out the machines thing. Sidecar, uh, yeah, other Aaron is correct.
It allows you to deploy and run. It's basically like, um... It's this. So imagine you have an actual, you've got an application. This is your application. Can I draw? This is your application right here.
That's your application. A sidecar is a little function that's kind of attached to your application, um, but not really. And so you might, you might put, uh, you might put this on forthcoming Laravel Cloud.
You might put it on fly.io, you might put it on DigitalOcean. You might put your app anywhere, right? But then you've got this over here, which is a Python function or some esoteric, uh, PDF generator node function or something. Something that either requires a lot of resources, um, is very bursty.
So if you need like, you know, 100, uh, simultaneous invocations and you want to scale this part of your app separately, it's a good use for a sidecar. Um, or it requires infrastructure that you do not want to maintain, so something like Python Lambda or Python .NET, you know, whatever.
So that is the purpose. Um, and if you look, not there. If you look sidecar for Laravel, you can execute functions. Um, you can execute a bunch of these functions all at once.
Hmm. There's like an execute mini. I don't know why it's not here. There you go. So you can execute like five of these functions at once, or you can execute 100 of these functions at once.
So if you wanted to create three images, this would fan out to three different Lambda functions, create those images, and then give you the results back. And if you wanna just fire and forget, you can execute many async. So maybe the function itself creates the image and then writes it to S3, an S3 bucket, and you don't actually care about the results.
Then you can fire that off, um, in the background and just carry on, on the PHP side, just carry on. Um, this will be interesting with Laravel's new defer and concurrent, um, drivers or things. So Laravel just introduced at, at Laracon, he, He Taylor announced it.
Um, and I don't know, I think it might be live already. Um- Uh, I don't remember if he said that it was live. I think he said... Yeah.
So here's one. Um, here's one. Defer will execute some stuff in not necessarily the background, but it can be the background. Um, I mean, it, I guess it technically is always the background, but how, the means by which it is executed is dependent on the driver that you use.
And so, like, you can just, whoop, throw that in the background, and it will, uh, run later. So I think, I think there are two drivers for this c- uh, currently, which is, like, whatever, FastCGI or whatever it is. Um, there could be a sidecar driver.
So you could, I don't know, I'm not promising anything. You could have this run on Fly.io or Lambda or whatever. That's one. Cache flexible. This is the other. Concurrency run. So, uh, uh, uh, still in beta.
That's fine. Here you go. Three drivers. So maybe Defer doesn't have a driver. Maybe it's Concurrency I was thinking of. But Concurrency Facade supports three drivers: Process, Fork, and Sync. Sync is likely just for testing. Um, Fork, uh, requires Spotsy's package.
But you can imagine, instead of, uh, Process, Fork, and Sync, you've got Process, Fork, Sync, and Sidecar, which would then open up Fly.io, Lambda, maybe Cloudflare in the future. Um, what's interesting about this is this is specifically for running, uh, parts of your Laravel application, not necessarily like Node.js or Python or whatever.
So yeah, it's very, very cool. You would need your app deployed to that other cloud, which, ah, I don't know if, I don't know if that's very compelling, but it's at least interesting to think about. Um, okay, do we need to do anything else? Typesense. Typesense is cool.
Um, what have we proven? Do I want to-- So it's 10 o'clock. Um... Oh, that's a pity about the Concurrency Facade. So I think one thing, we've, we've got an app.
So far, we've been in this world of applications, right? Um... Do we wanna move into the world of machines, or do we wanna save that for later? Um, why don't we give it a shot now?
Let's just give it a shot and see how far we get. Um, I don't know. I don't know if it will be very far, to be honest with you. Um, hmm. Do I wanna do this now, or do I wanna save this for later?
Let's just look at this API real quick. Machines. Okay. So regardless, we're going to need an app name. So we know that, and we have that, so we're fine. I think in the future, we'll need to create that via API, but we're fine for now. Um, we can POST to create a machine.
Can it use preexisting apps? Yeah, maybe. It's a good question. So the app name is required. The only required parameter in the body is image in the config object. Okay. So that tells me...
Why would you call me? Why would you call me if I'm streaming? Guess I should turn on DND, huh? So the image... Okay, so what I'm learning, what I'm learning here, we probably want the one with services.
Um, it's cool that you can do ENVs because that is a function, or that is an affordance provided by Sidecar, so that's pretty important. Um, there's a health check. So what I'm seeing here is that this is very similar to our Fly TOML.
And so what I'm thinking is, um, all this needs to move, moved into the machine layer, which is one layer below an application. That's my guess. And I think that's right. My question is: How do I go from...
How do I get this image? That's what I, that's what I don't understand. Like, um, we managed to get here, right? So how do I go from-- If it's telling me, if it's telling me...
Let's look at this. Not that one. Fly Sidecar, Machines. Okay. So I now know I could create a machine using this image.
Yeah. So it sounds like a two-legged process, eh? So I think what I'm trying to figure out is how do you go from fly.toml to this registry without using Fly Deploy?
Does that make sense? Does the question make sense? Like... Yeah, I'll have Docker locally. Why would I have Docker locally? That's crazy. Why would I ever do such a thing? What I wanna do, here's what I wanna do. I wanna send this, I wanna send this to Fly somewhere, and it gives me back a, it gives me back a, a, uh, image
UID or whatever that I can then use in this parameter. Is that possible, Chris? Image required. Yeah, I know. I don't...
So here, here, um, I'm being a, a bit silly, but here is, here's why I don't want Docker. The reasons are many, let me count the ways. Um, I am going to be responsible for building these things in an unknown environment, right?
So, uh, if you look at Sidecar, if you look... Boy, that URL's quite a bit, isn't it? Um, if you look... No, not there. Deploying. So this deploy script, that could be run from your local machine, it could be run from GitHub actions, it could be run from the fabulous, uh, ChipperCI,
could be run from here. It's great. It's not a sponsor. It's great. Go check it out. Um, this Sidecar deploy could be run from anywhere. And as it stands currently, all I need for that is, is PHP, which is great. Everything else I like farm out to, I farm out to AWS.
So it like packages the function, it creates a zip file, it uploads the zip file to S3, um, and then it activates the function. Oh, I wrote that. So my question is: how can I go from, how can I go from a Docker file to a registered image on
the Fly.io registry without having Docker installed locally? Um, and I'm fine, I'm fine with doing it an insane way. That's fine with me. So it might be... Oh, Steven's about to type something good. It might be that I need to like deploy it, grab the image, kill it, and then use the, use the image to make a machine.
Um, so this is potentially a roadblock. Um, this is potentially a roadblock, isn't it? Um, just
curious. I am surprised by this a little bit. Um, Rails, Laravel, JavaScript.
What do you do? Fly off Docker. This allows you to push images directly to Fly from the Docker CLI. No, that's not quite right. Okay. So if we say, let's do a little creative problem-solving here.
Um, let's say that we are not allowed to use Docker locally. Let's just make that a rule. So if we say you're not allowed to use Docker locally because this is going to be running in environments that I don't control, which is like the whole point. Um, if you're not allowed to use Docker locally...
Maybe that's the only rule. I, I thought there were gonna be more. I thought there were gonna be like five rules. Uh, you're not allowed to use Docker locally. Now what? How do we solve this problem? Um, I'm fine requiring...
Make a sidecar AWS function. Yeah, then I'm incurring all the costs for people building stuff. Um, I am fine requiring the Fly command line locally. I think that's fine. Or the Fly, uh, CLI command line interface. Let's see what you have to offer. Launch, status, deploy, apps, machines.
What is, uh... What do you do? API proxy through a wired guard. Don't know what that means. Clone, cordon, fun word. Deactivate, create, but don't start a machine. What do you do? Huh.
What would you say you do here? Fly machine create. Cool. Um, likely. Yep, that's required. This is all optional. Path to applica- uh, application configure file. Path to Dockerfile.
What? What in the world? All right, let's see what Chris is saying. Chris knows stuff, so we're gonna trust Chris. Um, Fly M list app name J, get the image. Yeah, so let's, let's run down two proofs of concepts here.
Um, I do wonder if I can create a machine based on a Dockerfile. That's what I'm, that's what I wonder. So if I was to do Fly machine create, app is, uh, Fly sidecar. Is that the name of the app? I think that's the name of the app. Fly sidecar.
Dockerfile is just Dockerfile. Requires at least one arg. You cannot create a machine via API with a Dockerfile. Ah, F. F. All right. You can with the CLI.
So here's my question. It's telling me... All right, we have an image. We just gotta, we gotta start breaking some stuff. We have an image. Um, we're gonna take this image, and we're gonna say Fly, Fly machine.
Is that what it was? And the first, the only required argument is that. So building Docker images doesn't always require Docker. Like, I don't have Docker on this machine, and I just push this to Fly. That... They have like a remote builder. So what happens if I do this? It found it.
It created it. Command not found app. Oops. So I wonder where that machine went. Okay. So we did just create a clone. Cool.
So if we do this again, create a new machine. Machine created. All right, we're creating machines, which is cool. Do we have any rogue machines? Where did that one machine go that I didn't associate with an app? I guess it just didn't go anywhere.
So that's my, that's my remote builder, this guy. That builds, that builds my, uh, my Docker images so that I don't have to. Which is why I want Fly to do it, 'cause I don't wanna do it. So those are all good.
So then my question is, um, why give me a... Why give me this flag here? Dockerfile, Dockerfile. What do you do? Nothing, apparently. I think we're gonna have to go the goofy route of... So I don't think it touches that.
It doesn't do anything at all with that Dockerfile. It just reads the image. So I'm not exactly sure why. Boy, we sure are creating a lot of machines, aren't we? Fly scale count one. Hmm, that's interesting. We go to apps. Oh, we've stepped outside of the, um...
We're now in manually Creating machine mode. So we've stepped outside of the scale thing. Uh, so I should probably destroy some of these. They're all, they're all stopped anyway, which is nice. So here's what I'm wondering, and this seems a little bit insane.
This seems a little bit insane. Do I create a separate app whose sole purpose is to build Docker images, like, in the user's account? Do you see what I mean? I don't like it.
I don't like that idea at all, but I don't know what else to do. So the, the flow would look something like this. I would, um, create a sidecar builder app in the user's fly.io.
I would push... I would, I guess, fly launch. Fly launch the user's code, um, grab the Docker image URL from the machine that started
in the app, kill the machine, destroy it. I don't need it hanging around. Um, then in the user's sidecar, whatever they decide to name it, application, start a new machine with the image from the
sidecar builder app. This is Chrome. This is PHP Storm. Is that what I have to do? Oh, maybe I meant fly deploy.
So, mm, mm, mm, mm, mm, mm, it's a little bit of an orchestration challenge, isn't it? Okay, so what happens-- Let's do this. We need to experiment a little bit. Um, yeah, me no likey either. Fly deploy, what do you do?
Build. Yes. Um, let's try it. Funk yeah. Fly deploy build. What?
Okay, phew. Holy moly. Remote builder. Building with Docker, not on my computer. Hell yeah.
Uh, who said that? Uh, I'm sorry, I'm not gonna pronounce your name right, but Vegelis Efantis, you are today's MVP. Yes. Um, okay. Let's prove that that works.
We need to first... I wanna, I wanna destroy these machines. Um, so what have we done? We just built a new Docker image that has the text Plaid 2.0 in it, and so if we hit this fly sidecar. Speed is set to Plaid.
Um, speed is set to Plaid. Now, now what I wanna do is I wanna destroy these machines. These are all the sidecar machines, so I'm not destroying my runner.
Okay, you also get out of here. Okay. Now, that is... So those should be gone. So now if we take this, let's get some space, and we do fly machine create.
Um, I think we decided Dockerfile is nonsense. And then- Uh, yeah, we'll just kill that, and then we can put it back. App equals Fly Sidecar. Boy, you would think I'd be able to remember at least one thing. Fly Sidecar, that's right. All right. Now, with any luck, this will create a new machine that returns Plaid 2.0.
Mer. What did I do wrong? What did I do wrong? Does it need HTTP or something? F that. Why did it not work? What the hell, man? What?
Why'd you do that to me? Um, all right, let's try this one more time. Build only. That's an interesting question. Maybe. So there's that, and yeah, that's alive again, which I don't, I don't fully understand.
Oh, you're right about the, the command. Um, so let's try this again. So I have a new one. Fly machine create. That's a new one, and let's do this right this time. App Fly Sidecar. Well, isn't that a, isn't that a kick in the head?
What the f... Where did that... Y'all, what happened? Yeah, I removed the app equals. So which is the one that worked? That one is the one that worked.
Oh. What is it doing otherwise? That's not my problem. You just gotta read the docs. That's not their problem. Actually, that is my problem. Um, okay.
Oh, guys, here we go. Deploy build only push. I just don't understand how it gave me a URL if it didn't push, but that is neither here nor there. That's why we're doing this. Lol bruh. Yeah, man, this is how it works.
This is how it works. This is why streaming is scary. Um, did I just, did I just clear that? I did. Okay. Streaming is scary 'cause it shows everyone how you're not good at things, and that's okay. It's okay to not be good at things. Let's try this again.
Fly machine create this guy with an app of no equals Fly Sidecar. Over like that. Oughta two black.
Less than a minute ago in ORD, which is fine. So who's gonna respond? DFW or ORD? Nobody, and then we hit it again. So now that I have one, yeah, this is the old one. This is the new one. Can I just kill you now?
Stop. Start. F. It's not responding. Hmm. It's not responding.
Your new machine is missing the app process. That's interesting. Um. That one doesn't have process app.
I'm sorry. I don't understand what that means. The new one doesn't have process app. Oh, I didn't do the thing where it creates a service, did I? I don't think I did. Maybe I do have to do this via API. Um, okay, so we need to stop.
What have I done? We don't need to stop the stream, but what have I done? Um, we've proven that we can build Docker images without using Docker locally. That's good. And we do that by running Fly deploy build only push. That's good. And then we need to capture...
We need to spell that right, otherwise people will make fun of me. We need to capture the registry URL. So here's a question. Do I need to parse that like a crazy person or, um- Not that one. Uh, Fly deploy build only help find JSON. I can't get JSON output here.
We're gonna have to regex the whole thing. Um, that's too bad. I'm surprised they don't give you a JSON output. Dum, dum, da, dum. Huh.
What does verbose give me? Probably n-nothing that I want. Um, okay. So we just have to parse that. Parse it out of the output, I suppose. Hello, Joe. That one doesn't have process app. I still don't know what that actually means, process app.
Um, and then we can do Fly machine create image app, app name, but need to figure out how to route HTTP to it.
But that's the part that I'm missing. Um, and if we look at manage machines, create. Create but don't start. Well, that's a problem.
Um, let's, let's switch over to auto-start. Hmm, that's a good point, Razor War. We could probably just do all this via API when we get there. Env is cool.
Um, port. So I think what I'm learning is I need to create, recreate most of this. Um... Oh, I see. Process doesn't have app.
That's what y'all are saying. Um, processes app. I see, I see, I see. So let's try to recreate... I think what I'm learning... Guys, we like to learn, don't we? I think what I'm learning is I need to deconstruct most of this Fly TOML and put it in the, um, put
it in this part. So Fly machines... Oh, no. Is, uh, chat on Twitter dead? I saw your chat. Fly M run is really close. So if we did... What does run a machine do?
Is that the thing we actually want? Let's just try this. Um, we're getting closer step by step, which is nice. I want to, I want to kill all the machines that are in here. That was fast. All right. Ri-dit-dit-to-doo.
Big tuna. Let's try this again. Um, Fly, uh, machine. We're not gonna create, 'cause that created and didn't run, which is fine. That's a good... Like, it's nice to have a two-legged process when you need it. Um, so if we did Fly machine run, what do you do?
Image. Oh, does that run a command? That's not what I want, if that's what that does. No, it runs a machine. All right, we're just gonna freaking do it. We'll do it live. Uh, so that's the image that we want.
We're gonna attach it to app of Fly sidecar. So I'm gonna test this first, and then I'm gonna throw a port on there and see what happens. The machine has been launched in app Fly sidecar. No health checks found. You can connect via the following private IP.
So, hold on. That's private. Don't tell anybody that one. Now, what do you look like? Okay. Uh, uh, uh, uh, uh, uh, uh, uh, uh. Which I bet... So the machine, the app still has no running machines. Well, it says it's suspended, but it should have one machine running.
Perhaps in artifacts. There you go, deployed. So now, I don't think this is gonna work yet, which is fine. Still have no process here. Um, all right, so step two is gonna be... What if we expose... What are we doing here?
In the Fly TOML, we're exposing eighty eighty. Is that right? Internal port? No, I think this one's external port. That's not gonna work Uh, what do you say port does? The external ports. So
which one do I want? That says internal port very clearly. Boy, we got ports all over the place, don't we? Um, see what that does.
I don't think that's gonna work. Less than a minute ago, two minutes ago, stopped. We can kill that. Yeah, I think that was wrong. So which machine is that?
That's D8. D8 just got going. So we want D8. That's our most recent one. Seven eight we can kill. I think I'm still, I think I'm still missing something in my head quite a bit.
But as it relates to this, I'm still missing something because I'm not, um, I'm not fully understanding what this, this process column represents. So if I look in the, if I look in the Docker file and I see... No, I look in the Fly.toml, I see processes equals app.
Um. Oh, there's your min machines running. You can always keep one alive. That's nice. I am not entirely sure... I'm not entirely sure what that processes equals app actually means.
Does everybody know what's going on except me? This is the question I ask myself. Process groups. You define processes in your Fly.
Uh, I think I just saw default process group. Yeah. If you don't explicitly define any processes, then the machines in a Fly app belong to the default app process group, and on boot, they run whatever the entry point is in the Docker. So is...
It has the process groups. Um, is entry point a proper noun? 'Cause I don't have anything in here that says entry point. Do I need to do that? Because what this, what this doc is telling me, um, and on boot, they run whatever entry point process the app's Docker image has.
And so I don't have an entry point here. I just start this command, which works for an application, but I'm wondering if it doesn't work for a machine, if that makes sense. Um, let's first take a step in the right direction. You need to define an entry point. Okay.
Is this allowed? Can I have both? That's a question for you, Chris Fideloper. Can I have both? There's a yes from Razor. Okay.
And then somebody was saying... Yeah, you can have multiple processes, which is fine. That will break it, so let's just kill that. Um, what were we looking at? Fly machines, fly CTL. Machines.
Somebody was saying... Oh, I think somebody said, "You can have both, but not like you have it." Damn it. Um. Process groups.
Deploy to machines only in these process groups. I don't think any of that applies for build. Uh, Smith, here's your answer, 'cause I have no freaking idea. Um, I just, I-- We're not at that point. We're not at the point of optimizing quite yet. So I think what I'm gonna do is I'm going to rebuild this Docker image with an entry point, and then, hey, Robin.
We're gonna rebuild, we're gonna rebuild this Docker image that has the correct entry point in it Um, so there's my builder. Oh, thanks.
Thanks, Adrian. Let's take a look at that link. Oh. Looks like that just kinda works. So Adrian, uh, sent me this.
And it looks like... Okay. It looks like you can do it that way, um, which is nice. So maybe that's the preferred way to do it. Uh, yeah, Smith, I need, I need to save time. I just don't know how to do it yet.
Um, so that time will come. All right, so I have this new one that has an entry point. And what do I do now? I do Fly machine. Um, let's go back to create just for giggles.
And we're gonna pass this new one in. We're gonna say app Fly sidecar, and then I think there's one other flag I want. Where's my scratch pad? I think we want auto-start. And we'll see this now has an entry point baked in.
And so, less than a minute ago. I'm gonna kill the seven-minute ago ones. It is not alive. Should have auto-started, but I can forgive you for that.
So we still have nothing. So we're gonna create a new one with this port. One minute ago, you're dead. Less than a minute ago. Okay, one minute ago. Yeah, there are some logs.
I could look at those in a second. One minute ago, kill you. Less than a minute ago, start you. All right, let's take a look at the logs. Machine.
No. Maybe not. Maybe it's just, like, dying over and over and over.
Although it says it's booted, so that would be... Sure does seem hosed, doesn't it? We might be reaching, we might be reaching the end of my, uh, my energy for today. What time is it? 10:51.
I got a, I got a whole PostgreSQL course to record, guys. Um, these logs are not coming alive. So where did we stop? We need to figure out how to route HTTP to it. That is true. That is still true. Um, port 80 might be a thing.
I am unsure about the port thing. Um, so this is toast. We don't need to do that. Um, Florian. Florian doesn't even use SQLite or want to, and he still watched all the SQLite videos.
We love him for that. We've proven that we can build Docker images without using Docker locally. That is freaking awesome. Uh, Fly deploy build push is the way that we do that. We capture it out of the output, and then we can do Fly machine create to create a machine in this application.
What I haven't figured out... Oh, there we go. Oh, boy, that just sure isn't much, is it? Boy. That ain't it. Um, unsure about the port thing.
I think the, I think the, uh, you're probably right. I think the Docker file needs an entry point. Pretty convinced about that. Um, so here's something.
Um, I don't know that I ever set this up. Do you know what I mean? When we, when we switched it from, when we switched it from- When we switched it from app to machine, I think we lose all of this Fly.toml, and I don't think I ever set up the internal port.
Chris, I think I need an entry point if... Am I, like, just totally dense? It's very much on the table. Um, where was that doc? I don't think I did ever set up the HTTP service at all.
There was a doc that said... Oh, it was process groups. Um, the default process group. If you don't explicitly define any processes, machines in a Fly app belong to app, and on boot, they run whatever the entry point process is.
So long, Steven. Yeah, please tweet at me. So I think I need the entry point, but you worked there and you're smarter, so you tell me. Um, I think I need the entry point when we switch over from, uh, app to machine.
I'm not wrong. It'll just run your command defined. Okay. Well, I believe you. Um, but we did not ever... Is this the problem? Since you need a command. Oh, yes, please give it to me.
You can Telegram me. I'll open Telegram on my phone or, um, yeah, I'll open it on my phone. Yeah, just send me, just send it to me on Telegram, and we'll see if that works. Command does not overwrite entry point. Guys. Um, so what I think I need is, uh, manage machines.
So there's no internal on this page, and there's only... So, oh, that's the wrong page. Internal. The only, um, port strings, external ports and handlers.
Oh, F. Port, machine port. F. Am I doing this like a big old dummy? Um, port 80 goes to 8080. Chris, is that right?
Is that right, Chris? Oh, thanks, Luke. That's very nice of you. Um, oh, I swear if this did it, I'm gonna be so freaking pumped. I don't know why it's not auto-starting. That's kind of a bummer. Um, but we persist.
Peter says it's right, and Peter does Elixir, so he's smarter than, he's much smarter than me. Did you actually send me anything? There you go. Oh, okay. So Chris says close.
Chris says close, but there's a little Fly-specific detail that I missed. Um, 8080/tcp http. Let's try that. See, guys? See, people? Um, this is why Sidecar exists.
I'm going to eat all of this glass so that you can just deploy your little, your cute little functions, your adorable little functions that make little OG images and stuff, and you don't have to worry about any of this. All right. Falling Mountains seven five two, show me the good news.
Oh. All right, I think we may have to call it. Let's check the logs on this. I feel like we're getting closer. Um, we're getting closer, but there's still something fundamentally wrong. Um, well, that's port four four three.
Oh, is it HTTPS? F me. Is it? F,.devs have to be HTTPS. Ah, ah, ah! Is this it? Um, let me check Chris's message again. I can just do space-separated. In fact, I don't need to route, I don't need to route 80 at all.
Four four three, 8080, TCP. Guys, there is so much I don't know. TLS, HTTP. Ooh. Um, yeah, the, the video, the VODs, I guess is what I'm supposed to call them, those live on YouTube forever.
I don't know what the deal on Twitch is. Um, Hetzner. Hetzner seems cool. Um, machines. I think I'm gonna try to do streams Tuesday, Thursdays. Um, so I will be... The two work processes that I will be doing is I'm gonna be making this Sidecar driver. I'm also gonna create the official, hopefully, Laravel driver for Turso, which is, uh- Hosted SQLite.
So I'll be creating, I'll be creating the Laravel driver for Turso. So between this Fly and Turso stuff, it'll be a combination of, uh, Laravel plus these services that are very cool. Um, okay, less than a minute ago, we routed HTTPS. Um, please.
Yes. Ah. Chris is the smartest man in the world, and also Peter, but not Aaron. Hell yeah. Whoo! We love it when a plan comes together.
Man. Y'all, this is it. This is it. What else would you rather be doing? Nothing. Nothing. Um, all right. We gotta write these learnings down. God, this freaking rules.
Um, all right. Here we go. So what did we learn? Uh, unsure about the port thing. Chris figured that out. We need to figure out that's... We-- Chris figured that out. So what did we learn? Um, we can... That's the image acquired from the previous. This is the user's application.
Auto-start I'm still confused about. Um, so one note is .dev always requires, uh, HTTPS as a TLD, so we had to route 443. Um, that's where I got hosed. Um, God, that just freaking rules.
We've proven a lot. We've proven a lot. I think one thing we could try to do next is transition, transition from the CLI to the REST API. Um, I'm not convinced that's a... I don't know if that's a good idea or not, because the CLI does all that file uploading when you run the Fly deploy build only, so it, like, handles all of that, and I feel like
I don't wanna do that. Um, oh. Oh, Levi, yes. Um, the streams are crazy. Crazy in a good way. We'll take crazy in a good way. Um, I think Levi perhaps is either a genius or just literate, and he-- they read the thing that I didn't read, one or the other.
Um, so if we, uh... What, what's everybody want me to do? Control L? Hey, that's kinda cool. I'll just type it anyway. Fly machine create help. Why did that... So auto-start. Automatically start or stop the machine. Yeah, that's what I want. That is what I want.
Um, default true. Correct, Peter. Um, so we can kill that. The next question is default true. Oh, Florian, you're typing in chat. You're not in your terminal. I've done it before too.
It happens to me as well. Um, I could have overwritten. I could have just done that myself, but it doesn't matter. I think this request will be... I think I will turn this into an HTTP request because I don't have to upload, um, but that's fine. Um, it's
cool you can resize it. Um, Ollie, this is a family stream. Um, this is cool. You can skip DNS registration so that it's not available, but I wonder if you can later enable it, um, which would be kind of important.
So I think the thing I gotta figure out, um, uh... Auto-stop, suspend or stop is important. Fly will stop your VM if no request comes in after some time. It won't do this by default, so this flag is necessary. Okay.
Default is off. I see what you're saying. We do probably want that, 'cause the whole point is to be ephemeral. So we want auto-stop equals... Why do I always do that? Auto-stop. Here's a question. Off, stop, and suspend. Off means auto-stop is off, but what is stop and suspend?
We'll go with suspend for now. I think the question is how do I roll the machines? So like if I, you know, if I were to go over here and change server to Plaid 3, um... You know what? I think you're right, Coolpants TV.
Great name. I wonder if we... I think early on Chris mentioned, uh, instead of create, do run. And so I wonder if... So I just updated server to Plaid 3.0. So if we were to change this to run And then we clear this out.
I can't... What am I gonna... Con-Control + L, you're never gonna get me to do that. Um, so seven minutes ago, eight minutes ago. Let's kill eight minutes ago. So wake up, wake up, wake up. There we go. Plaid 2.0. You should be alive.
You're alive. Now, if we were to do Fly Machine update, that's interesting. Um, oh, you doofus. I need that, I need that registry. Um, so Fly Machine run the image.
Uh, app is Fly Sidecar. Auto-stop is suspend. Um, port is this mess. So outer is four four three, inner is 80 80 on that protocol. And we have one machine.
The machine that is running is four eight E, and so if we were to do this... There you go. Attempting to start. That's what we're after. Come on, Fly. All right, so four eight E is still running, and we have two eight six
now. The question is, how do they decide? Yeah, I think I have to kill the old machines myself. I think it's doing, um, either round robin or random or something, but it's stuck on the old machine. So if I were to pause, suspend it, is it gonna route to two eight six?
Oh, you big old goon. You didn't do this right. You did not do this right at all. Um, apologies, dear friends. Fly deploy, build only, push. I didn't bake in the new changes. The server... I didn't bake in the Plaid 3.0 changes.
My bad, y'all. Um, I use Inertia. I love Inertia. Livewire's fantastic. I love Livewire. Um, I just, I like Vue.js a lot, and this, uh, one of the benefits of Vue.js, this is an Inertia app.
This is the, um, the SQLite course that I did, which is very good. Please go buy it. Uh, highperformancesqlite.com. Can I chat as, as like the king? Can I chat? Oh, that's cool. Restream? My name's not Restream. Um, okay. This is an Inertia app, an Inertia app, and one of the reasons we did that is my business partner, Steve, is a big Vue.js guy.
Um, and so this allows us to work, this allows us to work separately. Um, he doesn't know PHP, he doesn't know Livewire, and so he can build out, and did build out the entire thing in Vue, and then I just kinda wired it together with Inertia. So, uh, I don't like React because I do not prefer it.
It's as simple as that. Uh, I, I'm not gonna claim that I know everything about it or that, like, it's bad. I just don't prefer it, and I think that's okay. It's, it's a short life after all. Um, I like the way that Vue works. It works with my brain. So we're gonna try this one more time.
Let's take that, and then we need app is Fly Sidecar, and then we'll paste auto-stop suspend, port, yes, yes, yes. So this has the new response string baked into it, and what I'm trying to determine is does it route to the machines randomly if the configuration is the same?
I think I read that in the docs. So did it kill the old one, or is it just simply routing to the new one? So the old one is just simply suspended. This'll be interesting. Peter, I don't think you can.
Um, I think the Fly TOML is for apps only, and the, either the REST API or this Fly Machine create thing, I think... 'Cause you'll notice we're copying a lot of the Fly TOML stuff out, and I think the Fly TOML is like a nice layer on top of this that works for like apps.
And we've kinda dropped down, we're mucking around in the dirt down here with machines, trying to like control things ourselves. Um, yeah, it'll route randomly to existing machines that have this port configured. I think that is what I read. And I think once it overwhelms one machine, it like wakes up another, but I don't think it'll start any new ones unless I configure it that way.
So I feel, I feel I feel like a genius. Um, yes, Aaron, but also Mastering Postgres is coming soon. Very soon. It's terrifying. Um, so masteringpostgres.com is, is my next one.
So if you're using Postgres, that might, that might be better. Um, all right, I think we did it. We need to write down some final learnings here. And in fact, we can stop this machine. We don't need that. So fly machine run. Um, so this is create a machine only.
This is create plus run a machine. So we're gonna have to separate... If you want high-performance Postgres, well, buy them both then. Um, we, in Sidecar, we have a separate deploy step and activate step because that allows you to do, um, to keep your Sidecar functions in sync with your main application.
Because this part, this part may, may take a long time, and then this part should be super quick. In Lambda, the way that you can do that is you can deploy a Lambda function without activating it. Um, and so then on the deploy step, we just flip a flag and activate it.
Um, I don't know if that's a joke, Kevin, but I don't know if you're wrong. Somebody was... I think maybe Ian was telling me about that on the podcast yesterday, that I need to do SQL Server. So, 'cause man, those SQL Server people, they've got money, don't they? Kevin, don't you have so much money? Um, so this is good 'cause I can potentially, potentially create...
See ya, Peter. Thanks for hanging out. Thanks for the help. Potentially create a machine and then potentially, potentially, uh, start a previously created machine and also kill old machines, question mark.
Hmm. Uh, yes, Ian is feeling better. Ian is alive again, which is, uh, pretty important. He had his gallbladder removed, but the new... I think he said producer Dave is on... I think he said producer Dave is on vacation. Yeah, there you go. Uh, so it'll probably come out tomorrow.
What's today? Oh, good. Today's Tuesday. I love it when I get a day back. Um, I thought it was Wednesday. Uh, I think it should come out Wednesday or Thursday. See, Kevin, I think you're right. I think I do need to get into that enterprise world. We'll see, we'll see, we'll see. I feel like this is a great success.
Um, so we've proven we can build Docker images locally, which w- or without, sorry, build them locally without Docker by doing that, and then we capture that. I think that, um, Chris is not convinced about that. Chris is not convinced, but it does work.
Chris is not convinced that's required, but it does work. A simple command might also work, question mark? To create a machine, rather to only create a machine, to create plus run a machine.
This is just simply a note. Uh, this is a Sidecar, uh, architecture. Sidecar architecture. Boy, architecture notes. Um, okay.
Yes, please go subscribe on YouTube. Guys, this is how I make a living. Is that not the dumbest thing you've ever heard in the world? That like, I, I like sit alone in this office. See ya, Kevin. Sit alone in this office and just talk, and that's how I make a living. But yes, please go subscribe. Please go subscribe on YouTube.
Um, that would be quite helpful. Um, hey, Coolpants. I don't know what it takes to become a, a partner on Twitch, and I think, don't tell anybody, that by running a, a, uh, amalgamated stream like this, um, like the chat stream, I think that's illegal on Twitch.
I don't hang out on Twitch, and so I don't fully get, I don't fully get the, the vibe over there. Sean G., you're using Chrome dev tool for live chat? Whoa, whoa, whoa, whoa, wait, what do you mean? Tell me more about that. What are you talking about? Um, okay. So this is good. This is good. I should probably not have this in a scratch file.
Let's make a notes. All right. While it's fresh on the brain, what's next? So for next time. Um, in fact, let's move this up.
Boy, we proved a lot of stuff today. I'm all about proving stuff. If you, if you approve... If you can prove enough little things, you can create something quite large. What's next? Um- Even just being affiliate will allow you to sub on Twitch though. S-s-s-s-s-s-s-s-what is next?
So of all the steps, what have, what have we completed? We've, um... I think maybe what's next... Yeah, that-- Ollie, that sounds right. If I get there, that's great. I'm not really counting on it. Um, my primary hang spot is Twitter, and my primary video spot is YouTube.
So, what's next would be, um... Man, what is next? Um, create a Docker image. Let's give it a, a capital V plan.
S-s- oh, nice, you made the extension? That was fast. Create a Docker image from user's code, uh, from user's code. It's my code, but whatever. Um, create a machine using the Docker image from the Fly registry.
Yeah, honestly, trying to figure out what to do. Um, what I haven't done, um... I think I haven't created an app. I mean... I don't like any of this. Let's move it into, move it into a PHP Laravel application.
Um, then we need to orchestrate the process of creating a Fly app, because every machine must belong to an app. Then we need to, um, orchestrate, orchestrate building, um, creating, creating a Docker image from the user's code.
And then we need to, um, deploy the... Yep. Oh, man, I'm gonna have to store that, aren't I? Um, parse the logs. Parse the logs to get the registry ID.
Am I gonna have to... What's the REST API look like? This is all using the command line.
I just don't know if there's a way around that. I mean, it would be nice to do it all through Laravel's HTTP facade. Um, but I just don't know if Fly exposes that. I suppose I could just, like, sneak, like sniff and see what happens when the CLI runs.
Um, or I bet the CLI is open source, isn't it? Boy, oh boy, oh boy. Um, that's all Go. Oh, see, Levi, I don't wanna do that.
It seems to go over a WireGuard VPN. Ain't nobody got time for that. I'm just gonna use their command line until someone tells me how to do it the other way. Um, let's see if I'm eligible for Twitch.tv. Creator dashboard.
I think I have not streamed enough times. I don't know, man. Yep, yep, yep, yep, yep, yep. Um, okay, so parse logs, get the re- the machine, the Docker image registry ID, deploy the machine into the app, and then start the new machine and kill the old machine.
I think that's probably right. Yeah, thanks, Levi. Thank you for making me, not making me do that. Um, that's plenty for next time. Um, and that's to say nothing of, like, actually integrating it into Sidecar.
So I feel like that's probably, that's probably good for now. Um, this is Here's the deal. I started this stream thinking, "I don't know if this is gonna work. I have no idea how any of this works. Um, and this is gonna be a little bit embarrassing." You know what?
This freaking rules. We came a long way, and I'm very, uh, I'm very proud of us. This is awesome. I'm super pumped about this. Um, all right. I'm a little bit hungry. It is 11:30, so I'm gonna start shutting it down. Um, tell Fly.io on Twitter, please tell them that you think I'm a very smart boy.
Fly.io. Yeah. Tell them you think I'm a very smart boy and that they are very good. Um, if you want, please also subscribe to my YouTube channel. Hey, who's that guy? Look at that. Good job, guy. Hey, 6.1. That's awesome. That's great.
Good for you, man. Um, if you like SQLite, high-performance SQLite, and if you like Postgres, Mastering Postgres, and if you like to screencast, screencasting.com. Uh, and if you're a sophomore at Texas A&M University, here's some accounting tutoring. Womp, womp, womp. Guess I need to...
Oh, there we go. Look at that. This was the first course I ever did. Look at that. Isn't that cool? This is where I teach sophomores at Texas A&M University what the deal is with, uh, financial accounting. It's actually quite good. Look how young that person is. Can you imagine being that young? That must be incredible.
Hey, Teej. If only you knew what was coming. Um, yeah, look at all those videos about accounting, for goodness sakes. You can, you can make, you can make videos about anything. I'll never be that young again. Look at that. Look at all that hair.
Look at all that hair. Must be nice. I'm hanging on for dear life. Um, there you go. There's all the stuff that I do. I also have a, I also have a website. It's very good. It's very good. I have two sets of twins. That's one, that's the other. Isn't that crazy? Isn't that crazy? Two sets of twins.
I need to remove this image because I was speaking to literally three people in this, at this conference, so it's not great. It's not great. Oh, this was fun. Four under four. You got that right. Used to have four under three. Why isn't the younger Aaron on your personal site?
Because I don't wanna disappoint people. I don't want them to see this young, handsome f- head full of hair and then meet me and be like, "Ew, you're quite old, aren't you?" So w- w- it's called managing expectations, Adrian. Um, yeah, I think instead I need to put, I need to put this image.
That's much better. There are actually people there. Yeah, Teej, I heard on the DHH interview that, uh, y'all just recently, sort of recently, had a new one, so congrats. Um, I wouldn't go for the full four under four, just, just personally, if I were you. That's just a, that's just one idea.
I'm currently getting this whole site redone because there's just too much stuff to, to fit on here now. Like, this is very silly. That's very silly. Um, so I'm working on getting that done. So y'all are the best. We got 3.0 done there.
Freaking love that. We got, learned a bunch about Fly. Did I kill all the machines? Yeah, you can go away. I don't need you. Yeah, go away. We killed all the machines. Gorgon and BrowserFly are still hanging out. One day, one day I shall work on you. Um, no, Florian, I can barely, I can barely keep track of all the stuff I need to do.
In fact, I don't keep track of it very well. I think that's it. I think we did it. Great success. Um, if you have any questions, find me on Twitter. Um, yeah, this was fun. Any final questions before we shut it down for the day and I go get some... What do I want? Do I want Chick-fil-A?
Do I want Chick-fil-A or do I want tacos? I think I'm gonna go get tacos maybe today. Um, all right, all right, all right. I think that's it. I'll be back on Thursday. I think on Thursday I'm gonna work on the Turso, uh, the Turso driver for Laravel.
I think that'll be fun. So come back on Thursday for that. Probably same time. Probably like 7 or 8 AM Central. Um, y'all are the best. Thanks for hanging out. I'm gonna end it there. Thank you all for all of your help. I would not have made it without you. Um, it's good to have friends. All right.
Talk to y'all soon.