Serverless Computing Tutorial: Introduction (Part 1)
Articles,  Blog

Serverless Computing Tutorial: Introduction (Part 1)


[Music in background] The following is a Coderland presentation about our newest attraction, the Compile Driver. Greetings, coders! This is Doug Tidwell. [train sounds in background] As we see the majestic Coderland Special pulling into the station with a load of happy coders, bituminous coal, and poisonous chlorine gas, it’s time for another exciting announcement from Coderland. The park’s extensive lineup of attractions now includes the Compile Driver, a terrifying ride that illustrates the power of serverless computing to thrillseekers and bystanders alike. When construction began, management had high hopes that the Compile Driver would generate significant revenue. Unfortunately, a number of beta testers of the ride shared their experiences more broadly than we would have liked. To shore up our sagging prospects, we’ve installed a camera that captures the expressions of free-falling riders. Your assignment, should you choose to accept it, is to use Knative and Kubernetes to host a serverless function that stamps the current date and the Coderland logo on the image from the camera. Guests, of course, will have the opportunity to purchase a copy of that photo as they stagger away from the ride. But before we get to the code and Knative, a word about the ride itself. Once guests are strapped to their seats, they’re quickly hoisted to the top of the enormous tower, giving them a panoramic vista of Coderland and the surrounding countryside. That view doesn’t last long, however, because within seconds, riders enjoy a thrilling plunge back to the ground. [sounds of screams and crashes in the background] [Stunned silence] During testing of the ride, many people asked for a souvenir photograph, something they could share with their friends, loved ones, and attorneys. So we took a high-definition webcam, nailed it to a pole, and put it next to the ride. As guests enjoy the exhilarating descent from the ride’s dizzy heights, the webcam captures the joy on their faces. That image will be sent to your serverless function, which will turn those pixels into a priceless memento, available for $19.95 at the Coderland Swag Shop. There are two videos to help you build the solution. The first covers the back-end code that does the image processing, as well as a React-based front-end written by our friend Don Schenck. Don’s code lets you send an image from your system’s webcam to your back-end code and display the modified image in your browser. The second video shows you how to deploy the code to Knative running inside a Kubernetes cluster. Keep in mind that these two videos are independent of each other. You don’t have to deploy the code to Knative, and if you skip ahead to the second video, it starts with a pre-built container image of the code from the first one. Finally, there’s an interview I did with Don about his code, the design decisions he made, and some ideas about some cool things you could add or change. If you go through these materials and the code, you’ll have a solid understanding of serverless computing and Knative. We’re always glad to hear from you, so please fork or clone our repos, send us your questions, comments, and PRs. We hope you enjoy this stuff, we had a lot of fun putting it together. For Coderland, this is Doug Tidwell, saying may all your bugs be shallow. Cheers. [Doug screaming into a hair dryer to create a fake photo of himself falling from the sky] [train sounds] [more train sounds] [train whistle] [yes, more train sounds]

Leave a Reply

Your email address will not be published. Required fields are marked *