Skip to content

A tutorial about how to build a distributed system for a render farm

License

Notifications You must be signed in to change notification settings

khnumdev/dist-app-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

How to Build Your First Distributed System

A practical tutorial on building a distributed Blender rendering system with Node.js, Docker, and Docker Compose

Deploy Docs License

Distributed Rendering System

Note: This is a tutorial to start building an example of a distributed system and is not intended for a production deployment.

πŸ“š What You'll Learn

This hands-on tutorial teaches you how to build a distributed Blender rendering system from scratch. You'll learn:

  • RESTful API Development with Node.js and Express
  • Process Management for long-running background tasks
  • Distributed Orchestration to split workloads across multiple nodes
  • Containerization with Docker
  • Multi-container Deployment with Docker Compose
  • Production Patterns like rate limiting, service discovery, and monitoring

By the end, you'll have a working distributed system that can render Blender animations in parallel across multiple servers!

πŸ—οΈ Repository Structure

dist-app-tutorial/
β”œβ”€β”€ docs/                          # Tutorial documentation (GitHub Pages)
β”‚   β”œβ”€β”€ index.md                   # Landing page
β”‚   β”œβ”€β”€ 00-setup.md                # Environment setup
β”‚   β”œβ”€β”€ 01-rendering-node.md       # Part 1: Rendering Node
β”‚   β”œβ”€β”€ 02-orchestrator.md         # Part 2: Orchestrator
β”‚   β”œβ”€β”€ 03-docker.md               # Part 3: Docker
β”‚   β”œβ”€β”€ 04-docker-compose.md       # Part 4: Docker Compose
β”‚   β”œβ”€β”€ 05-enhancements.md         # Future improvements
β”‚   └── _config.yml                # Jekyll configuration
β”‚
β”œβ”€β”€ examples/                      # Working code for each part
β”‚   β”œβ”€β”€ part1-rendering-node/      # Express server with job management
β”‚   β”œβ”€β”€ part2-orchestrator/        # Work distribution system
β”‚   β”œβ”€β”€ part3-docker/              # Dockerfiles for containerization
β”‚   └── part4-docker-compose/      # Complete Docker Compose setup
β”‚
β”œβ”€β”€ img/                           # Images and assets
β”œβ”€β”€ .github/workflows/             # GitHub Actions for auto-deployment
β”œβ”€β”€ CONTRIBUTING.md                # Contribution guidelines
β”œβ”€β”€ CODE_OF_CONDUCT.md             # Code of conduct
└── README.md                      # This file

🎯 Tutorial Overview

Install Node.js, Blender, and prepare your development environment.

Build a web API that accepts Blender rendering jobs and manages background processes.

Key Concepts:

  • Express.js server setup
  • HTTP status codes (202 Accepted, 200 OK)
  • Process management with child_process
  • Polling patterns

Create an orchestrator to distribute rendering workloads across multiple nodes.

Key Concepts:

  • Work distribution and batching
  • Parallel execution with Promise.all()
  • Round-robin scheduling
  • Status aggregation

Containerize the rendering node and orchestrator for consistent deployment.

Key Concepts:

  • Writing Dockerfiles
  • Docker networking
  • Volume mounts
  • Container orchestration

Deploy the entire distributed system with a single command.

Key Concepts:

  • Multi-container applications
  • Service dependencies
  • Scaling services
  • Production-ready deployment

Explore production-ready improvements and advanced patterns.

Topics:

  • Rate limiting (429 Too Many Requests)
  • Message queues (RabbitMQ, Kafka)
  • Service discovery
  • Kubernetes deployment (AKS)
  • Monitoring and logging
  • Security best practices

🚦 Quick Start

Option 1: Follow the Tutorial

Visit the full tutorial for step-by-step instructions.

Option 2: Run the Examples

Each examples/ folder contains complete, working code:

# Part 1: Single rendering node
cd examples/part1-rendering-node
npm install
npm start

# Part 4: Complete system with Docker Compose
cd examples/part4-docker-compose
docker-compose up --build

See individual README files in each example folder for detailed instructions.

πŸ“‹ Prerequisites

  • Node.js v14 or higher (Download)
  • Blender (Download)
  • Docker (for Parts 3-4) (Get Docker)
  • Basic knowledge of:
    • JavaScript/Node.js
    • REST APIs
    • Command line

🀝 Contributing

We welcome contributions! Whether it's:

  • πŸ› Bug fixes
  • πŸ“ Documentation improvements
  • ✨ New features or examples
  • πŸ’‘ Suggestions for enhancements

Please see CONTRIBUTING.md for guidelines.

πŸ“– Additional Resources

πŸ“œ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Blender Foundation for the amazing open-source 3D software
  • The Node.js and Express.js communities
  • All contributors to this tutorial

πŸ’¬ Support


Ready to get started? πŸ‘‰ Begin the tutorial

Star this repo ⭐ if you find it helpful!

About

A tutorial about how to build a distributed system for a render farm

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •