 All right, here we go Yeah, I started not I started recording a bit too late, but yeah, it's okay You only missed me Fixing the keyboard I have to rotate it again It was correct wasn't it? No, okay good. So last time. Yeah, we made we made it easy to Deploy Haskell programs on AWS Lambda, right? Which is good But now we have to use that That's the best way to test it, right? It's just like hey, let's Sit down and write an actual real world app that runs on AWS Lambda using the functions we learned right? so what I'm thinking is that we write like a little web page That offloads things to AWS we're gonna use like Cognito or something for user management That's gonna be interesting in Lambda I Will just see what happens, right? We'll be at it for like an hour or an hour and a half. I guess we won't get very far But we'll we'll do something right We're like, what's a nice computational lambda task right that we would like to Like, you know, we want to we want a task where it's like good to spin off Multiple copies right like massively parallel tasks Because then we can we can like invoke our Lambda function Again and again and again In a nice way Let me see because I do have a synthesis problem it where Where you synthesize and what you're doing when you synthesize is that you and you'll essentially, you know You run quick check on a bunch of expressions Really cool if we could like parallelize that like bam Just run this synthesis This is what you do is that you kind of you Naively generate candidates, but you need to test those candidates, right? If we could do that like on a massively parallel scale on Lambda, and I wouldn't be a bit cool, right? Let me see. What am I doing? Okay, let me change the title screen using Let me see. We're not in that so Using Change the stream title update information good. Okay, so What is a nice way to do this? Let's just create like a like like a a simple system, right that has a login Because what I kind of want also is that I kind of want to get a user User interaction stuff. Let's see. This is LARPy Let's change our test library here to Use something This is the function we're deploying and we would like to invoke something from Amazon got That's an album by Ruslana But it's also a Xcode library, right? Let's just see Oh, yeah, one thing we had to do is that we have to fix our package So that it builds with gg 8.10 Mostly because Yeah, because it yeah, so because I think yeah, this this build plan is too tight Uh, let me see then okay, so because like this this is okay. We can do Um It should be fine Okay, uh, and now we're gonna go. Okay. Let's copy the shell.nix Uh to shell 8.10, right? And let's fix it because it doesn't generate a documentation on on hack itch because it Oh, I think 8.3 is available Because it it doesn't It doesn't know about it, right? Like it doesn't because it tries to build it with ghc 8.10 and then that fails Uh, it doesn't work 8.2 is too new But it tends to work We're getting there That's all about having fun while we're at it, right? Let me just send a couple of send a message to show them To do while we're waiting. Okay. Okay. It's there, right message sent All right, so Build because we need to check if it actually builds, right? Yeah, so This one doesn't work wait Next go right check because we want the documentation on a hack itch definitely, right? I'm wondering if I can get this password somewhere We check it. Okay Let me turn off the camera here And then we go to And I'll look it up on my phone and type it and copy paste it That way you can't see anything Okay, so Hack itch It's so long Okay, we can add search. So I think we can just change the ball file metadata here Yes, okay. I think it's so let's see if this actually built Okay, it's still building So if this works I get this build works. I think it's enough for us to literally just say, you know 15 year and just publish new revision Um And that should be fine. Let's turn on the stream cam again How's everyone doing? Akita software with something super cool company by the way, and they sent me this water bottle Mostly mostly I think it's mostly geniangs Doing right she knows I love Haskell and it's such a cool water bottle, right? I'm married Let me un-mirror myself on stream. Are you ready? Are you ready for the un-mirroring flip horizontal? No I had the wrong chosen Flip horizontal Let's flip it. Oh, yeah. No, I can't flip it because it's like part of me. Oh, yeah, I should be able to Give me a second Transform flip Yeah, check it This is good. So Yeah Although it's just a monad Now, you know a monad is it's kind of like a water bottle You can pour stuff out of it I'm gonna keep I'm gonna keep me mirrored Uh, why because that's how I see myself In the mirror every day. So then you meet me in the street and you're gonna be like bro What's up with that the hairdo it's different Oh, well, I will You should try looking at me in the mirror Anyway, yeah, it's pretty nice. It's just just white clean Nothing going on except a nice haspo logo I've had to explain it a couple of times like what's up with that logo Some people are like, oh, we use lambda in radiation and I'm like, yeah, well We use lambda for other stuff. We gotta we gotta have our own lambda. You know, it's good stuff. Let me see Building pro functors nice, okay, so let's Hmm, let's think a bit about what we want to do like what are we trying to do What's a nice application because I just I just kind of want to publish my Publish my synthesis stuff, but I want to I want to see if we can We can make it scale Can we make it web scale on aws lambda? Another thing I've been doing is I've been writing like a parser for webpages Well, not writing a parser like using a parser and then like invoking that parser and that's just being run on Lambda would be nice, but this is gonna take a while. I'm guessing so Right, we should have a bit more of a plan for what we want to do, right? Okay, so what are we what are we trying to do web page wise? could create like a so, yeah, what I was talking about on Twitter earlier is that I accept I've been taking a lot of photos And we'd be nice to have like a nice page to display those photos, right? Maybe we do that Let's look at html frameworks Uh, what is that? It's called state of the asco ecosystem State of the union. Yeah, this one is good I mean, it's not the most after-date thing. I think I mean they try to keep it updated Okay, they kind of go into You know everything you need right to the front. So, yeah, let's look at server-side webpages IHP, I mean that looks nice starter thing I've used I've used servant a bunch But that's like for rest stuff graphql api. I think I even you don't need my password here I think I even Contributed That was not this one. That was the that was the other one There was a graphql api that I contributed to WebSockets authenticate. Yeah, that's nice Haskell DSL for building html Yes, so what do we want, uh, we could run the entire thing on Haskell Run the entire thing as a lambda function You can do that with cloud front. That would be kind of cool um Let's see. Yes, let's see. Let's see here. Uh, IHP. This is a bit much changing. Uh, I just want something I just want to generate I just want to generate html To start with Okay, uh, let's see cloud front aws It's called lambda add edge or something like that Okay, we're back in the Christmas. I ran out this new um, I hope it's also free. How are we gonna get? dmc8 Which isn't that nice Okay, we're building RSA core. Okay P. Hello. Sup sup Okay, but what do we have here for front and server side? So this is server side Okay, scripting, uh, let's see front end web programming Okay, we can compile to JavaScript But I'm not sure I'm not sure that's what we want I think that's a bit much Because now we can we can actually run things, but do you want to run it on the front end? We need to do it Let's see Here he is That's good You don't know about this compiler. It's It's good stuff Jared jack Uh, he's a legend And he's one of the main guys behind this I think I think it's I think he's that's his name Jared jack Uh, yeah. Yeah. Yeah. He's a guy Might have a couple of times conferences It's cool guy So this is taking so long to build because Uh, we're doing with ghc 8.10 right to test it And we haven't built it with that yet. So that's going to be take a long time. Okay. Let me see lambda edge So we request cloud front cache are you right already trust? Yeah Of course the limit is at the run times of features So can we even run? That's go on the edge example cloud front message event, right? Functions generally should be Can we just do this? Let me see We need to I need to log into the console Beep beep beep beep beep beep beep beep I'm gonna turn off the camera as usual When I log into things Because I don't want you to see the Do-do-do-do-do-do-do I usually tend to vocalize things also if I'm typing a code like this But I specifically have to not do that if I want to keep it hidden on stream, right? It's not easy Being a streamer Here we have cloud front That's just to make a new let's a make a new distribution The great distribution Get started origin domain name Okay, let's see after cloud front with the request To change cloud front requests and responses at the following points Before cloud front forwards response to the viewer. Okay, let me It's always jumping back to like I wanted to play this This one keeps looking back to the Christmas one. Not that I don't like the Christmas one. Okay. What is your body? Yeah, okay Okay, let's just create a new s3 here Create a new bucket That's just called larpy And we make it do something So then we have like an s3 bucket right to uh Where we can place like an index file, right? Dude, so is it gonna be more web development? I guess I mean we're using Haskell for it But we're gonna be we're gonna need to Make Create bucket I don't want you to see which ones are ugly or not. So let me move this image here And Okay, we got the larpy bucket ready to go Let's see, uh origin domain name This needs to we need to read changes to get started Set this to Larpy, what is the origin shield? Origin, let's see Okay, you can also add yeah with our serverless logic, the dynamic origin logic, let's see Okay, centralized caching later to help increase your cash hatred ratio To reduce the load on your origin or I can shield also to increase the or you're not putting the product on the request. It was originally due to you Request to go to your original project Okay, uh, let's click. Let's see the pricing. I mean, I think it's it looks good origin shield costs I don't know This I don't want it to be like five dollars per request, right? I was just there, right? Uh, it's super cheap, but this is like per request Okay, it says we fine. Okay, just be sure Let's see. Uh, yeah, that's no Uh, okay origin connection because it matters Okay, and then here we're gonna say origin Response let's see what we can do here. Um, so what is the Uh Here origin response viewer response, right? So It goes through clock far and then yeah, we want to Which one do we want? I think it's viewer response We can change this later Your response lambda function r and Let's see. Let's go to lambda And see what we can do This is so fun. Yeah, okay. We're getting there There be Okay, what I want to do now is I want to change this so that a I want to change the test one I want to change this one So that it's And what was the state here? Yeah, okay, the state was You turn right at so Uh, what's this again? Oh the The interface Takes in a lambda interface The lambda invocation, right? And I just want to say here They should be right And lambda invocations They should already have uh, I'm not sure that we can okay, right I think we need to Okay, so here we can't return the invocation directly We need to say write ps dot Pack response Is that request body right high body? I want to just return the body But it's ps pack, right? We need to unpack it Okay It should be fine ps dot Then we need to say here. No, oh So this worked. I want to see I want to build a So we can edit the package. Let's edit this and review changes That's how you do test it with right welcome in a lot Let's see. Is this more slow than usual? Feel a little bit like it, right? I don't know if I'm doing anything different, but Yeah, yeah, okay, but I run the specific request. Yeah. Yeah, okay. This should be fine It shouldn't take too long. Oh here. I'm doing this. This is a different Okay, build it again. Yeah, probably Let's see if it works. So this should work. We should be getting documentation How often do they try again? Is it 1949? 1956 I hope they try again soon. It'll be nice to have it properly on there We are working on this one Okay, you built No, no, right got by string Then I'm going to push this And it should just reveal the request And what I'm going to do then is that, you know, I'm going to run a cloud front edge Using this lambda And then I can see exactly what the request that request it's getting is right And that would be cool Because then we can see what we have to work with But I think I probably have to return a request in a specific format So now it's going to take whatever it gets And it's not going to interpret it. It's just going to return it directly, which is fine And then we need to update this what I'm unsure about is that, you know, we Maybe we can't run these functions Directly right That's my suspicion because like this is a special runtime interface thing and then I think we might Not be able to run it on edge Because it said it had limited runtimes Oh my god. Yeah I'm getting there Slowly but surely. Okay. Uh, let's upload a file here And let's just make a Bad file saying Damn, okay. Good website. Nothing unnecessary. We're gonna go like index To desktop 102 bytes All right, let's see game two Waiting for this one. We're slowly but surely getting there. Yeah Let's see. Okay Nice now it should work. I think it should work now But yeah, yeah, it's a compiler at least it's telling us now what the problem is rather than Way too late, right? We can ask for it to queue it again It's only real slavery. What was the result here? They did it or did it work? It should work. Okay. Okay This should be In And this is not needed. Yeah Well, yeah, this is what you do if you're doing Haskell, right? There's a lot of a lot of slow work It's also because I'm you know, I'm streaming Uh at the same time that I'm Developing like on a virtual machine, right? So It's always going to be a bit slow, but at least we kind of fixed this part, right? So now Larby It should be updated soon Because we made a revision To make it build with the latest one and we we can't test it test it like on the containers But if it built Like it's you know, there's there's nothing that it's doing that's Changed just right from h 0.8 to 8.10. Okay. It built finally. So Now we can cat that deploy and it should all work out. All right. Let me see. Do I have to log in again? I might have to log So we just need to Do it here. Let's see. Let's see Amazon You push commands. Yeah, we need to do this. I need to do sudo for the daemon sudo We're gonna get like a shot and then it's gonna be I'm gonna post that It should all work out checking if this is Happening no not quite yet Okay, and then we have this one and we're gonna say deploy new image Which is gonna say here Save Okay, and it's still updating once it start that stop updating we're going to run the test See what happens Because then I want to add this arm here To um, oh, we can just do it do all of them. That's nice. You are request Uh, the order here doesn't matter We have the body as well Origin response. Yeah And it would have to log create new configuration Price class. No, we're just gonna use a US channel in Europe Uh, there's no Alternate their name names We had larpy.mpg.is right So let's call it larpy Web.mpg.is Uh, since it's all for mpg Tsl a default route object is Time configuration what? Wow, okay a Yes, what is the name? real larpy Do do do no no no no a Cloud from this view right Okay, I don't think we need this I think it's fine. Uh Not in a let's we can just no no not we don't want to kinesis data stream of logs Okay Create distribution S3 packet for logs. Yeah, let's put them in larpy Great distribution one or more inputs not valid Which ones Are not valid here Is there anything that is red? What? Inventedly function armor specific reference a specific function version Oh Okay A copy arm That was not enough I guess And Yeah, wait to larpy and then Let me see versions publish new version v2 Web I'm just gonna just gonna be called web copy arm for version two And this doesn't include a version. Okay So let's see larpy to function arm. Yeah, this includes a version Yes, yes, yes, yes Create distribution the function must be in region us east one Okay I guess This is the s3 right Let's change to us east one North virginia mount mama And larpy when what it was a runtime The custom runtime What was the runtime we'd set up to last time? I don't know. I don't think we did Advanced settings code setting. Okay. I think we should Just Provide your own bootstrap Yes, let me see Let's just look at it here. Dude. I can't see Ireland. Okay And let's just see what we are dealing with What was the setting runtime What did we set the runtime to? Okay, let's just try this. I think this works. Yeah um Yes, okay create function We had to set like the xsh or something like that Um configuration Oh, did I mess this up? How did I okay? This is not the right runtime How did I create the runtime last time? We did this way back in like episode one We have to select container image say There we're going to use the same images here See we had some entry point override command override test Okay, create function. Yes, this should work Image repository. Oh my god, they're making this so hard Okay, uh, let's just create an acr in Like they should also tell you this right? Okay, you need to Do it in the right place. Okay. Also. Why can't you upload a function from like another amazon acr? Isn't it like different? Okay, then I guess we have to what do we have to do? Yeah, let's say this is you us To one I'm guessing I'm guessing we have to also log in Didn't we do that? We did that here Us One I'm trying to log into Us One okay Yes, no, you have to push all of it. Yeah That's fine. It's a tiny image. So it's going to be quick. Uh, this is almost here. Yeah Okay, is it this it's usually the same Hash right? Let's see. Okay. This is to be. Yeah, it should be the same hash Yes, it's 3o and then it's with 38, right? Yeah, so it's the same hash Okay, um Create function. Okay, we managed to create this function Versions Polish new version Web let's call it v1. Okay. We're still creating the function, but we're almost there. Okay v1, okay, and This should be our arm Yeah It was easy as you can see Create distribution Lambda attached does not support function with a repository type with ECR Okay, so we just can't use lambdas here as with all science Negative results are important. Um It's harder to publish and so it's sad because you're like, hey, we made an achievement But what we find out now, you know is that you cannot run ECR functions at edge, right? So you would have to like either compile haskell through javascript Or something like that, which is a shame So we can't write our web page entirely In haskell We would have to have some We can write like back-end server stuff that calls to lambda functions But we can't do it entirely in haskell Which is yeah, it's sad. That is sad I was because I was kind of looking forward to, you know, hey, let's just render everything in haskell, right? That would be cool Yeah, okay, I know I'm gonna plan it's better for tomorrow, you know, we'll actually have something that works instead of this kind of Nothing, which is a bit lame, but yeah, but uh, anyway Thanks for tuning in I hope this was uh Not terrible waste of time watching this that nothing happened Uh, because I I really thought I don't know. I guess I could have read this in a docs, but no anyway, um, but at least We did fix this And it says okay now And which means that this should say okay All right, because it built, right? Oh, this should be happening quite soon, right? This should happen and this should work and then we have finally documentation for larpy So at least we did something positive, even if we didn't actually write so much dog food stuff tomorrow Um, see what happens And but thanks for tuning in and I hope to see some of you tomorrow And then probably this will be uploaded, which is cool. See you tomorrow. Okay