Skip to content

Firecracker Python Improvement/Stabilty#1

Merged
0xR35tu merged 8 commits intohysnsec:mainfrom
restuhaqza:main
Jan 28, 2026
Merged

Firecracker Python Improvement/Stabilty#1
0xR35tu merged 8 commits intohysnsec:mainfrom
restuhaqza:main

Conversation

@restuhaqza
Copy link
Copy Markdown

@restuhaqza restuhaqza commented Jan 28, 2026

This pull request introduces several important improvements to the Firecracker Python project, focusing on documentation, developer tooling, and test environment setup. The main changes include new and updated documentation for quick start and rootfs setup, a comprehensive Makefile for development workflows, a dedicated Dockerfile for running tests with KVM support, and enhancements to the README for clarity and ease of onboarding.

Documentation improvements:

  • Added a new QUICKSTART.md guide with step-by-step instructions for verifying prerequisites, running the official setup script, enabling networking, running the sample script, troubleshooting, and VM cleanup.
  • Added FIRECRACKER_SETUP.md, detailing how to build a Firecracker-compatible Ubuntu 24.04 rootfs, including Dockerfile usage, kernel download, networking setup, and integration with the SDK.
  • Updated README.md to reference the new quick start and setup guides, clarify installation steps (including uv usage), and provide clearer instructions for enabling networking and running the sample script. [1] [2] [3]

Developer tooling and test environment:

  • Added a new Makefile with targets for installing dependencies, running various test suites (unit, integration, coverage), linting, formatting, type checking, cleaning, and Docker-based testing. This streamlines development and CI workflows.
  • Introduced Dockerfile.test for building a test environment with KVM access, Python tooling, Firecracker binary, and all necessary dependencies for running unit and integration tests inside Docker.

Other improvements:

  • Updated image paths in README.md to use the new location under assets/img.

These changes collectively enhance onboarding, documentation clarity, developer productivity, and ensure robust testing across environments.This pull request introduces comprehensive improvements to the developer experience and documentation for working with Firecracker microVMs in Python. It adds detailed setup guides, a robust Makefile for development workflows, and a Dockerfile for running tests with KVM support. The documentation now clearly explains both the quickstart and advanced rootfs setup, and provides troubleshooting advice for common issues.

Documentation and User Guides:

  • Added QUICKSTART.md for a fast setup and usage guide, including prerequisites, setup script usage, networking, running and connecting to VMs, troubleshooting, and cleanup instructions.
  • Added FIRECRACKER_SETUP.md with step-by-step instructions for building a custom Ubuntu 24.04 rootfs image for Firecracker, including Dockerfile details, kernel info, and integration with the Python SDK.
  • Updated README.md with new image path, instructions for using the official setup script, manual setup alternatives, and prerequisite checks for a smoother onboarding process. [1] [2] [3]

Development and Testing Workflow:

  • Added a comprehensive Makefile with targets for installing dependencies, running various types of tests (unit, integration, coverage), linting, formatting, type checking, cleaning, and Docker-based test workflows.
  • Added Dockerfile.test for running unit tests in a containerized environment with KVM and Firecracker support, including all necessary system and Python dependencies.

- Add AGENTS.md with project overview and development guidelines
- Add QUICKSTART.md for quick setup instructions
- Add FIRECRACKER_SETUP.md with detailed Firecracker setup guide
- Add docs/testing-in-docker.md for Docker-based testing
- Add tests/README.md with testing documentation
- Format firecracker/microvm.py with ruff for consistency
- Update network.py and utils.py with code style improvements
- Add _version.py module for version tracking
- Improve error handling and validation in MicroVM class
- Enhance snapshot loading with better error messages and recovery
- Add comprehensive test suite for API client
- Add Docker integration tests
- Add error handling tests
- Add networking tests
- Add port forwarding tests
- Add process manager tests
- Add snapshot tests
- Add utility tests
- Add VM configuration tests
- Add VMM manager tests
- Add microVM initialization tests
- Update conftest.py and test_microvm.py
- Add Makefile for common development commands
- Add Dockerfile.test for containerized testing
- Add docker-compose.test.yml for test orchestration
- Update pyproject.toml with dependencies and configuration
- Update .gitignore to exclude SSH keys and Firecracker files
- Add uv.lock for reproducible builds with uv package manager
- Add sample.py example script for microVM creation
- Add scripts/ directory with utility scripts
- Add assets/ directory with Firecracker setup files
- Add verify-setup.py script for environment validation
- Add quick start section using official setup script
- Update installation instructions with uv support
- Update image path from img/ to assets/img/
- Remove old img/firecracker.png file
- Add *.bak pattern for backup files
- Add *.old pattern for old file versions
- Add *.backup pattern for backup files
- Add *.squashfs* pattern for squashfs images
- Add vmlinux-* pattern for kernel files
- Add timeout parameter support to API client for better request handling
- Convert MicroVM helper methods to static methods for better code organization
- Add NetworkManager.close() method for proper resource cleanup
- Improve process iteration using psutil.pids() for better performance
- Add comprehensive error handling tests across multiple modules
- Implement session-scoped cleanup fixtures for test isolation
- Add cleanup utilities for Firecracker processes and resources
- Update Makefile with new cleanup targets and test failure handling
- Update pytest configuration with coverage and marker settings
@restuhaqza restuhaqza changed the title Draft: Firecracker Python Improvement Firecracker Python Improvement/Stabilty Jan 28, 2026
@restuhaqza restuhaqza marked this pull request as draft January 28, 2026 08:13
@restuhaqza restuhaqza marked this pull request as ready for review January 28, 2026 08:14
@0xR35tu 0xR35tu self-assigned this Jan 28, 2026
@0xR35tu 0xR35tu requested a review from yashdiq-pdso January 28, 2026 08:27
Copy link
Copy Markdown
Collaborator

@yashdiq-pdso yashdiq-pdso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good from my side.

next TO-DOs:

  • Implement clean up on vm delation (singular defunct deletion)

@0xR35tu 0xR35tu merged commit b622253 into hysnsec:main Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants