2025-03-18 Week 10 - Session 1 - TDS Jan 25#
Duration: 2h 24m
Here’s an FAQ summary of the tutorial:
Q1: What are the main deployment options discussed for Project 2?
A1: You have several options:
- Digital Ocean Droplet: Offers $100 in credits for 60 days, but requires a credit card or PayPal for setup.
- Azure Education Pack: Provides $100 in credits for 12 months (renewable), and importantly, does not require a credit card for activation. This is ideal if you don’t have a credit or debit card.
- AWS: Mentions 750 hours of compute for one year, which likely requires credit card details.
- GitHub Student Developer Pack: Another resource that might offer various benefits for students.
Q2: How can I access and use the Azure Education Pack?
A2: You can sign up using your student email account. Once verified, you’ll receive $100 in credits. These credits are valid for 12 months and can be renewed if your student status remains active. The key benefit is that it doesn’t require a credit card.
Q3: Is the Azure credit “free for life”?
A3: No, it’s not free for life. The credits are valid for 12 months and can be renewed. However, if your student account or associated student email becomes inactive, the renewal might not be possible.
Q4: Can I use a GitHub student account to sign up for Azure Education Pack?
A4: It’s best to start with your official student email address as it’s typically required for verification. While a GitHub student account might be used for later stages or linked somehow, direct student email verification is the standard process.
Q5: What is the general process for deploying my application to a virtual machine (VM)?
A5: The general process involves:
- Creating a VM: This is called a Droplet on Digital Ocean or simply a VM on Azure.
- Preparing your application: Develop your application (e.g., a FastAPI app) and create a Dockerfile for it locally.
- Building and Pushing: Build your Docker image locally and push it to a container registry like Docker Hub.
- Deploying to VM: SSH into your VM, install a container runtime (like Podman), log into your container registry, pull your Docker image, and then run it.
Q6: How can I automate the deployment process to achieve Continuous Deployment (CD)?
A6: You can set up a Continuous Deployment (CD) pipeline using GitHub Actions and a webhook server on your VM:
- GitHub Actions Workflow: Configure a workflow that triggers on every code push or pull request to your GitHub repository.
- Docker Operations: This workflow will automatically log into Docker Hub (using stored secrets for credentials), build your Docker image, and push the updated image to Docker Hub.
- Webhook Trigger: After pushing the updated image, the GitHub Action sends a POST request to a webhook server running on your VM.
- VM Action: The webhook server on your VM receives this request, pulls the new Docker image from Docker Hub, stops the old running container, removes the old container, and then starts a new container using the updated image (keeping the same container name for consistency). This ensures your application on the VM is always running the latest code.
Q7: How do I ensure my service continues running on the VM even after I disconnect my SSH session?
A7: You can use the screen utility.
- SSH into your VM.
- Start a
screensession by typingscreen. - Run your service (e.g., a Uvicorn command for your FastAPI app) within this
screensession. - Detach from the screen session by pressing
Ctrl+A D. - You can then disconnect your SSH session, and the service will continue running in the background. To reattach to your session, use
screen -r <session_name_or_id>.
Q8: What data visualization tools were discussed in the tutorial?
A8: We covered:
- Flourish: An advanced web-based tool for creating modern data visualizations, including animated bar charts, projection maps, 3D maps, and pictograms. It’s recommended over PowerPoint for creating engaging animations.
- Looker Studio (Google Data Studio): A powerful, web-based tool for building interactive dashboards. It allows for cross-filtering, where selecting a data point in one visualization updates all others. It’s praised for its collaboration features and not relying on your local system resources.
- RawGraphs: A free and open-source tool for creating custom and unique data visualizations.
- ComicGen: A tool for creating comics by designing characters, adding speech bubbles, and arranging panels.
Q9: What is Marimo, the reactive notebook environment?
A9: Marimo is a reactive notebook environment similar to Jupyter. Its key feature is that if you change the definition of a variable, all subsequent cells that use that variable automatically update in real-time. This makes it highly interactive and useful for development, as you instantly see the impact of your code changes. It internally uses “D-U pairs” (Definition-Use pairs), a concept from software testing, to manage these dependencies.
Q10: Are there any specific considerations for using cloud credits like Azure’s $100?
A10: Yes, it’s crucial to use your cloud resources economically. Always close your VM or machine instances when you’re not actively using them. If you leave them running constantly, you could quickly consume all your allotted credits (e.g., $100 within a year). Always aim to optimize usage to make your credits last.
