Duration: 8 Weeks Team Size: 2 Developers Focus: Serverless Computing, Event-Driven Architecture, Containerization
The goal of this internship is to build a simplified Function as a Service (FaaS) platform similar to AWS Lambda using Go programming language.
By the end of this project, you will have built a system that allows a user to deploy serverless functions via a CLI command (e.g., lambda deploy ./my-function), which will package the code, run it in an isolated container, and expose it via HTTP (e.g., http://my-func.localhost).
- Container Runtime: Building lightweight, fast-spinning containers for function execution.
- Event-Driven Design: Understanding HTTP triggers, scheduled events, and async invocation patterns.
- Cold Start Optimization: Learning about container pooling, warm instances, and startup latency.
- CLI Design: Building intuitive developer tools using a suited Go library.
The system consists of three main components:
- The CLI (Client): A command-line tool running on the user's machine. It packages function code and sends it to the server for deployment.
- The Gateway (API + Router): The "brain" of the operation. It receives function code, manages deployments, and routes HTTP requests to the appropriate function containers.
- The Runtime Manager: Manages Docker containers for function execution—spinning them up, handling invocations, and managing their lifecycle.
flowchart TD
subgraph "User's Machine"
CLI[Terminal / CLI Tool]
Browser[Web Browser / curl]
end
subgraph "Cloud VM"
Gateway[HTTP Gateway / API]
Runtime[Runtime Manager]
DB[(SQLite DB)]
Docker[Docker Daemon]
Fn1[Container: Function A]
Fn2[Container: Function B]
Scheduler[Cron Scheduler]
end
%% Deployment Flow
CLI -- "1. lambda deploy (zip)" --> Gateway
Gateway -- "2. Store metadata" --> DB
Gateway -- "3. Build image" --> Docker
Docker -- "4. Create container" --> Fn1
Docker -- "4. Create container" --> Fn2
%% Invocation Flow
Browser -- "1. HTTP Request: func-a.localhost" --> Gateway
Gateway -- "2. Route to function" --> Runtime
Runtime -- "3. Invoke" --> Fn1
Fn1 -- "4. Response" --> Gateway
%% Scheduled Execution
Scheduler -- "Trigger on schedule" --> Runtime
%% Styling
style CLI fill:#e1f5fe,stroke:#01579b
style Gateway fill:#e8f5e9,stroke:#2e7d32
style Runtime fill:#fff3e0,stroke:#ef6c00
style Docker fill:#f3e5f5,stroke:#7b1fa2
style Scheduler fill:#fce4ec,stroke:#c2185b
To understand the project better, here is how a developer will eventually use your platform:
Imagine a developer has a simple function in a folder. They will use your tool like this:
$ cd my-function
$ lambda deploy . --name greet
[1/3] Packaging function code... Done.
[2/3] Building image "func-greet"... (Docker build output follows)
[3/3] Starting container... Done.
Your function is live at: http://greet.localhost$ curl "http://greet.localhost?name=World"
{"message": "Hello, World!"}
# Or via CLI
$ lambda invoke greet --data '{"name": "World"}'
{"message": "Hello, World!"}$ lambda schedule greet --cron "0 * * * *" # Run every hour
Scheduled function "greet" with cron: 0 * * * *Internally, your Gateway code will look something like this (Go code):
func handleInvoke(w http.ResponseWriter, r *http.Request) {
// 1. Extract function name from the Host header (e.g., greet.localhost)
// 2. Look up the function's container info from the database
// 3. Forward the request to the container
// 4. Return the function's response to the caller
}Goal: Learn to control Docker with Go and build the function packaging pipeline.
Instead of typing docker run, you will write Go code to do it for you.
- Objectives:
- Set up the Go development environment.
- Research how AWS Lambda work internally.
- Connect to the Docker Daemon via the official Go SDK (
github.com/docker/docker/client). - Write a Go program to spin up/down containers quickly.
- Measure container startup times (baseline for optimization later).
- Deliverable: A Go binary that spins up a function container and prints invocation latency.
Turning function code into a runnable container image.
- Objectives:
- Create sample functions (hello-world, echo, calculator) with Dockerfiles.
- Implement a Go function to package source code into a
.tar.gzarchive. - Use the Docker SDK to
ImageBuildan image from the packaged source. - Create a lightweight base image optimized for fast cold starts.
- Deliverable: A Go function that builds a Docker image from function source code.
Goal: Route HTTP traffic to functions and deploy to the cloud.
Routing requests from the internet to the correct function container.
- Objectives:
- Implement an HTTP gateway using
httputil.ReverseProxy. - Route requests based on subdomain (e.g.,
greet.localhost-> Function "greet"). - Inject request context (query params, headers, body) into the function.
- Handle function timeouts and error responses.
- Implement an HTTP gateway using
- Deliverable: Invoking functions via HTTP requests.
Moving from "It works on my machine" to "It works on the Cloud".
- Objectives:
- SSH into the provided Cloud VM and install Docker and Go.
- Create a GitHub Action that triggers on every
git push:- Builds the Go binary.
- Transfers it to the VM (via SCP/SSH).
- Restarts the systemd service.
- Configure DNS to point subdomains to the VM.
- Deliverable: Deploy a function from a laptop to the Cloud VM.
Goal: Add scheduled triggers and function versioning.
Running functions on a schedule.
- Objectives:
- Implement a cron-style scheduler using a Go library (e.g.,
robfig/cron). - Add
lambda scheduleCLI command. - Handle overlapping executions (skip if still running vs. allow parallel).
- Implement async invocation queue.
- Implement a cron-style scheduler using a Go library (e.g.,
- Deliverable: Functions that run on a schedule.
Remembering what is deployed and supporting rollbacks.
- Objectives:
- Implement SQLite for function metadata persistence.
- Add function versioning (each deploy creates a new version).
- Implement
lambda versionsandlambda rollbackcommands. - Ensure database persistence across platform restarts.
- Deliverable: Deploy new versions and rollback to previous ones.
Goal: Complete the CLI and prepare for demo.
- Objectives:
- Complete the CLI with all commands:
deploy,invoke,logs,list,delete,versions,rollback,schedule. - Implement
lambda logsto stream logs from function containers. - Add basic metrics (invocation count, duration, errors).
- Add authentication (API Key) so only authorized users can deploy.
- Complete the CLI with all commands:
- Deliverable: Full-featured CLI with observability.
- Objectives:
- Final code cleanup.
- Write user documentation.
- The Demo: You will present the project by deploying a fresh function to the live Cloud VM.
- Language: Go (Golang)
- Container Engine: Docker (via Go SDK)
- Database: SQLite
- CLI Framework: Cobra
- HTTP Gateway: Go
net/http+httputil.ReverseProxy - Scheduler:
robfig/cronor similar
We treat this internship as a simulation of a real engineering environment.
- The 3-Hour Rule: If you are stuck on a specific error for more than 3 hours, stop and ask for help. We want you to struggle enough to learn, but not enough to burn out.
- Quality > Speed: It is better to have a fully working function invocation than a broken complex system.
- Understanding is Key: During code reviews, we will ask "Why?". You must be able to explain every line of code you write.
- Collaborate: You are a team. Don't split the work in silos (e.g., "I do gateway, you do CLI"). Pair program on the hard parts.
- Response: Within 2 hours during working hours
- Meeting Attendance: Mandatory unless communicated in advance
- Daily Updates: Required - brief summary of progress and blockers
- Documentation: All decisions and learnings must be documented
- Code Quality: Follow coding standards, passes linting
- Testing: Should have basic tests
- PR Reviews: Submit work in reviewable chunks, address feedback promptly
- Deadlines: Meet timelines or communicate in advance
- Monday: Sprint Planning. Review the week's goals. Mentor provides a high-level overview of concepts. (30 min sync)
- Tue-Thu: Implementation. Async communication over chat to flag blockers.
- Friday: Code Review & Demo. Show what was built to the mentor. (30 min sync)