APS 03
In this assignment, we are going to create a new version of the work from the API class.
We will create a Lambda function that will make predictions using a pre-trained model. The Lambda function will be exposed through an API Gateway.
Accept assignment
All assignments delivery will be made using Git repositories. Access the link below to accept the invitation and start working on the third assignment.
Clone repository
Clone your private repository:
Question 1
Now, it's time to start working!
Our goal is to transform the predict
route from class 02 into a lambda function. In other words, assume the model is already trained and that the model pickle can be embedded in the Docker image.
Important!
Notice that we will no longer be using FastAPI.
We will create a lambda function that has a handler for predict, then we will create an API Gateway that exposes the lambda function.
Part I
This part is about creating a Lambda function for the model prediction manually. It's a more hands-on approach compared to using the Terraform setup.
Info!
Use the work from class 02 as a reference.
You can copy the model pickles from class 02 (Ignore the training part).
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Warning
In the upcoming exercises, you will write scripts to provision resources (repository creation, functions, API, etc.).
If You prefer, you may use the Terraform setup right away (as will be required in Part 2).
Question 8
Question 9
Question 10
Question 11
Question 12
Part 2
This APS requires that you use the Terraform setup to create the Lambda function and API Gateway.
Use the past pages as a reference.
It's advisable to study about and implement:
- How to use Terraform Modular Configuration (project structure)?
- How to perform Variable Validation (e.g Lambda memory size)?
- How to use Remote State (S3) to store Terraform state remotely for team collaboration?
Question 13
Question 14
Delivering the assignment
Question 15
After pushing the code on GitHub, to achieve the highest grade, the student must inform the professor (in class or during office hours) that they wish to present the project. The presentation will involve showing that the project works and discussing its components, possibly demonstrating that they studied or learned beyond the project requirements (if that was the case).
Before starting this stage, it is advisable to have the repository open (both on GitHub’s website and in VSCode), have the deployment completed and functional on AWS, and have code or calls ready to demonstrate its operation.
Students who do not present their project to the professor will have their maximum grade restricted at a B.
Deadlines
- Github submission Deadline: available here
- Presentation deadline (only for maximum concept): october 15th.
Rubrics
Concept | Criteria |
---|---|
I (Insufficient) | Did not complete the required steps, major components missing, or solution does not work. |
D (Developing) | Attempted some steps, but with significant errors or missing parts; solution is incomplete or unreliable. |
C (Essential) | Completed all required steps from Part 1; solution works but lacks polish or best practices, improvements possible. |
B (Above Average) | Solution is robust (both Part 1 and 2), well-documented (wrote a good README), follows best practices. |
A (Excellent) | Presented the project to the professor during class or office hours. Demonstrates deep understanding and extra effort. The Terraform infrastructure state is maintained centrally in S3. |