Skip to content

Conversation

@raghav-nexthop
Copy link

@raghav-nexthop raghav-nexthop commented Jan 9, 2026

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

This PR adds the infrastructure pieces for the FBOSS Image Builder's distro_cli tool. It creates infrastructure for manifest parsing, path resolution, error handling, and shared constants.

  • Exception handling (lib/exceptions.py): Custom exception classes for build errors, validation errors, and component-specific failures
  • Constants (lib/constants.py): Shared configuration for Docker settings and build paths
  • Path utilities (lib/paths.py): Helper functions for resolving component paths (relative and URL-based)
  • Manifest parsing (lib/manifest.py): ImageManifest class for loading and validating build configuration JSON files
  • Test infrastructure (tests/manifest_test.py, tests/data/dev_image.json): Unit tests and test data for manifest functionality

This PR is part of a series. The previous one is #792 and the next one is #794

Test Plan

Pre-commit checks: PASSED

Unit tests: 5/5 passing

PYTHONPATH=fboss-image python3 -m pytest fboss-image/distro_cli/tests/manifest_test.py -v
test_has_component PASSED
test_load_manifest PASSED
test_missing_components PASSED
test_resolve_path_relative PASSED
test_resolve_path_url PASSED

Summary:

Here an RPM specfile and surrounding machinery is added to build an
FBOSS-compatible Linux kernel from vanilla Linux sources which is
compatible with CentOS. On top of this reference configuration,
additional local changes from `fboss-local-overrides.yaml` are applied
prior to building.

To use, inside an FBOSS build container, run:

    # fboss-image/kernel/scripts/build_kernel.sh 6.4.3 out
    ...
    Kernel RPM build complete!
    Output files:
    out/x86_64/kernel-modules-6.4.3-1.fboss.el9.x86_64.rpm
    out/x86_64/kernel-headers-6.4.3-1.fboss.el9.x86_64.rpm
    out/x86_64/kernel-core-6.4.3-1.fboss.el9.x86_64.rpm
    out/x86_64/kernel-devel-6.4.3-1.fboss.el9.x86_64.rpm
    out/BUILD/linux-6.4.3/kernel/config_data.gz
    out/SRPMS/kernel-6.4.3-1.fboss.el9.src.rpm
    out/kernel-6.4.3.rpms.tar.gz
    out/kernel-6.4.3-1.fboss.el9.src.rpm
    out/RPMS/x86_64/kernel-modules-6.4.3-1.fboss.el9.x86_64.rpm
    out/RPMS/x86_64/kernel-headers-6.4.3-1.fboss.el9.x86_64.rpm
    out/RPMS/x86_64/kernel-core-6.4.3-1.fboss.el9.x86_64.rpm
    out/RPMS/x86_64/kernel-devel-6.4.3-1.fboss.el9.x86_64.rpm
    # ls fboss-image/kernel/dist/build-6.4.3/out/
    kernel-6.4.3-1.fboss.el9.src.rpm  kernel-core-6.4.3-1.fboss.el9.x86_64.rpm   kernel-headers-6.4.3-1.fboss.el9.x86_64.rpm
    kernel-6.4.3.rpms.tar.gz          kernel-devel-6.4.3-1.fboss.el9.x86_64.rpm  kernel-modules-6.4.3-1.fboss.el9.x86_64.rpm
@meta-cla meta-cla bot added the CLA Signed label Jan 9, 2026
Add CMake configuration and CI workflow for FBOSS Image Builder:
- CMake test configuration for distro_cli unit tests
- GitHub Actions workflow for automated testing
- README documentation for the distro_cli tool

Test Plan:
- CMake configuration tested with pytest integration
- CI workflow validates on pull requests
Add foundational infrastructure for distro_cli:
- Custom exception classes for error handling
- Shared constants for Docker and build configuration
- Path resolution utilities for locating components
- ImageManifest class for build configuration parsing
- Unit tests for ImageManifest with test data

Test Plan:
- All unit tests pass (manifest_test.py)
- Pre-commit checks pass
@raghav-nexthop raghav-nexthop force-pushed the raghav.distro-cli-core branch from 8788a05 to 315c596 Compare January 9, 2026 04:28
raghav-nexthop added a commit to nexthop-ai/fboss that referenced this pull request Jan 9, 2026
Add artifact storage and caching system:
- ArtifactStore class for managing build artifacts with file caching
- Support for metadata and data file separation
- Cache evaluation with caller-provided functions
- Unit tests for artifact operations

Dependencies: Uses Docker infrastructure from PR facebook#793

Test Plan:
- All unit tests pass (artifact_test.py)
- Pre-commit checks pass
@raghav-nexthop
Copy link
Author

New PR will be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant