2025-03-20 Week 10 - Session 3 - TDS Jan 25#

2025-03-20 Week 10 - Session 3 - TDS Jan 25

Duration: 1h 44m

Here’s the FAQ based on the provided transcript:


Q1: What’s the recommended workflow for Project 2?

A1: You’ll need to follow a specific pipeline. The most important recommendation is to collaborate. You’ve been given 5 Graded Assignments (GAs) with over 50 questions in total. It would be incredibly tedious for one person to create 50 functions. Form groups, where multiple people work on creating individual functions for each question, and then one person can be responsible for merging all those functions together.

Q2: What’s the “API thing” required for Project 2?

A2: Similar to Project 1, you need to create an API application. We should be able to send an API request to your server, and it should return the answer for a particular question. This is the only way we can access and evaluate your work.

Q3: For the FastAPI requirement, should the 50 functions be in a separate file from the API server?

A3: Yes, absolutely. Your functions can be in a separate file (or multiple files). The FastAPI server can then import those modules (files) that contain your functions.

Q4: Do I submit the files on Azure and then provide an Azure link?

A4: Yes. Once you’ve created all your API files, functions, and any other necessary folders, the next step is hosting this application. After hosting, you’ll provide us with the live link (domain) to your hosted application.

Q5: How can I check if my Azure link (or any other hosting link) is working correctly?

A5: If you can successfully access the API endpoint from an incognito tab on your browser or from a different device (like your mobile phone), then it’s definitely working. This ensures we will also be able to access it.

Q6: What are the recommended hosting options, and why isn’t Vercel suitable for Project 2?

A6:

  • Vercel: It offers free hosting, but it provides limited RAM and disk space. Project 2’s complexity and resource requirements (especially for over 50 questions) mean Vercel likely won’t be sufficient. It was okay for Project 1, but not for this one.
  • Azure: This is highly recommended. You can avail a student package that often includes free services for a year and $100 worth of credits. This should be enough for Project 2.
  • Digital Ocean: Similar to Azure, they offer free options or student discounts.
  • Render: They might offer free deployment for one application, with potentially better resources than Vercel. You should check their current offerings.
  • Hostinger: While an option, it will charge you money (around $60 per year), and we don’t believe they currently offer student discounts.

Q7: Should the API response be in JSON format, or the same format as the GA portal?

A7: The responses for Project 2 should be in JSON format. If the response involves an image, it should be provided as a Base64 encoded string within the JSON.

Q8: Can you demonstrate how to host our application on Azure in a session?

A8: Yes, we can arrange a session to demonstrate hosting on Azure. However, it won’t be in this particular live session, but likely in a future one.

Q9: Can I develop my Project 2 application locally before deploying it?

A9: Absolutely. You should develop your entire application on your local machine, using a local host server. Make sure to perform all your testing locally first. Once you are confident that your application is ready and fully functional, then you can proceed to deploy it on a hosting service like Azure. You can also find tutorials on YouTube for deploying Python applications to Azure.

Q10: In GA1, question 16 required moving files and getting a hash value, but I kept getting different answers. Why is that, and how can I fix it?

A10: You shouldn’t be getting different hash values for the same set of operations. The issue likely stems from how you’re unzipping the folder. You mentioned using a Python unzip module. Instead of a Python module, you should use a bash command to unzip the file directly from within your Python code. The underlying environment (like Azure) is Linux-based, so bash commands will work consistently. After unzipping, the grep command should sort the files and then calculate the SHA sum, which should always yield the same result regardless of where the files are stored. The bash command will ensure consistent extraction behavior.