Skip to content

[Nexthop] Add fboss2-dev to Distro Image#903

Open
travisb-nexthop wants to merge 12 commits intofacebook:mainfrom
nexthop-ai:raghav.build-stack-part10b
Open

[Nexthop] Add fboss2-dev to Distro Image#903
travisb-nexthop wants to merge 12 commits intofacebook:mainfrom
nexthop-ai:raghav.build-stack-part10b

Conversation

@travisb-nexthop
Copy link
Contributor

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

The fboss2-dev CLI command has recently been added to support configuring FBOSS. Add it to the Distro Image.

Test Plan

Validate that the command exists and executes in the image:

[root@dut ~]# /opt/fboss/bin/fboss2-dev -h
FBOSS CLI
Usage: /opt/fboss/bin/fboss2-dev [OPTIONS] SUBCOMMAND

Options:
  -h,--help                   Print this help message and exit
  -H,--host TEXT ...          Hostname(s) to query
  -l,--loglevel TEXT          Debug log level
  --file TEXT:FILE            filename, queries every host in the file
  --fmt TEXT:{tabular,json}   Output format (tabular, json)
  --agent-port INT:POSITIVE   Agent thrift port to connect to
  --qsfp-port INT:POSITIVE    QsfpService thrift port to connect to
  --color TEXT                color (no, yes => yes for tty and no for pipe)
  --filter TEXT               filter expression. expression must be of the form TERM1&&TERM2||TERM3||TERM4... where each TERMi is of the form <key op value> See specific commands for list of available filters. Please note the specific whitespace requirements for the command
  --aggregate TEXT            Aggregation operation. Must be of the form OPERATOR(column)
  --aggregate-hosts BOOLEAN   whether to perform aggregation across all hosts or not

Subcommands:
  bounce                      Disable/Enable object
  clear                       Clear object info
  config                      Configuration commands
  create                      Create object
  debug                       Debug object
  delete                      Delete object
  get                         Get object
  reload                      Reload object
  set                         Set object
  show                        Show object info
  start                       Start event
  stop                        Stop event
  stream                      Continuously stream

[root@dut ~]# 

raghav-nexthop and others added 12 commits February 5, 2026 01:12
This commit updates the FBOSS-OSS Kernel files to remove Nexthop-specific
references that were inadvertently included in the initial merge:

- Remove sccache distributed build references from build_kernel.sh
- Remove nhfboss-common.sh sourcing
- Update kernel.spec copyright header to Meta/Facebook format
- Fix import ordering in Python scripts to match upstream style
- Simplify kernel build process to use standard gcc without sccache wrapper

These changes ensure the kernel build system is clean and suitable for
upstream FBOSS without Nexthop-specific dependencies.
Integrate distro_cli Python unit tests into the FBOSS CMake build system to enable automated testing in CI/CD pipelines.

- Add FbossImageDistroCliTests.cmake to discover and register Python unit tests
- Configure test discovery for distro_cli modules (builder, cmds, lib, tools)
- Update root CMakeLists.txt to include distro_cli test suite
- Enable distro_cli tests in GitHub Actions workflow
- Update distro_cli README with build and test instructions

The CMake configuration automatically discovers all *_test.py files and registers them as CTest targets, allowing tests to run via 'ctest' or 'make test'.
Provide basic tools and utiulities for the distro_cli build system.

- Add custom exception classes for structured error handling
- Define shared constants for Docker configuration and build settings
- Implement path resolution utilities for components
- Define test data fixture for image manifest validation

These core utilities provide the base infrastructure required by all downstream components including Docker integration, artifact handling, and build orchestration.
Add Docker container and image management capabilities.

- Implement Docker container wrapper with exec and run operations
- Implement Docker image wrapper with build, pull, and tag operations
- Add comprehensive unit tests for container and image functionality
- Include test helper utilities for unit test infrastructure
- Add build_docker.sh script for Docker build automation

Added unit tests for docker infrastructure and image building.
Add artifact storage and caching capabilities for build outputs.

- Implement artifact store for managing build artifacts
- Add artifact caching and retrieval functionality
- Include unit tests for artifact operations
- Update test helpers to support artifact testing

Added unit tests for artifact storage and caching.
Add file download capabilities for fetching build dependencies.

- Implement download module for HTTP/HTTPS file retrieval
- Add support for progress tracking during downloads
- Include comprehensive unit tests for download operations
Add command execution capabilities for running build operations.

- Implement execute module for running commands in Docker containers
- Add support for command execution with output capture
- Enable build operations to run in isolated container environments
Add abstract build component framework for managing build operations.

- Implement AbstractComponent base class for build components
- Add component lifecycle management (prepare, build, extract)
- Integrate with artifact store, download, and execute modules
- Enable extensible component-based build architecture

Tests utilizing the above infrastructure will be added when component build supports are included.
Add build entrypoint orchestration for component-based builds.

- Implement build entrypoint for coordinating component build workflows
- Add support for build configuration and execution management
- Include comprehensive unit tests for entrypoint functionality
Add ImageBuilder class for orchestrating component builds and image assembly.

- ImageBuilder: Main orchestration class for building FBOSS images
- Compression support for build artifacts (zstd)
- Component build coordination
- Test coverage for compression functionality
- Updated build_test.py to use ImageBuilder
Add scripts and build configuration for building FBOSS forwarding and platform stacks.

- CMakeLists.txt:  Defines build targets for forwarding stack
- package.py:   Script for packaging forwarding and platform stacks
- build_fboss_stack.sh:   Script for building forwarding and platform stacks
@meta-cla meta-cla bot added the CLA Signed label Feb 5, 2026
@joseph5wu
Copy link
Contributor

@travisb-nexthop : is it possible to make /opt/fboss/bin/ in $PATH so we can run fboss2-dev without specifying the absolute path?

@travisb-nexthop
Copy link
Contributor Author

@travisb-nexthop : is it possible to make /opt/fboss/bin/ in $PATH so we can run fboss2-dev without specifying the absolute path?

Of course, but if we do that we probably want to move the daemons out into /opt/fboss/sbin or something so they can't be accidentally executed and don't clutter up tab completion. Does that sound acceptable?

@joseph5wu
Copy link
Contributor

joseph5wu commented Feb 12, 2026

@travisb-nexthop : is it possible to make /opt/fboss/bin/ in $PATH so we can run fboss2-dev without specifying the absolute path?

Of course, but if we do that we probably want to move the daemons out into /opt/fboss/sbin or something so they can't be accidentally executed and don't clutter up tab completion. Does that sound acceptable?

I don't have strong preference here but we can set some standards for any non-service binary that where should we host these binaries.

Here's the example on our product NetOS

[netops@XXXXXX(container) (NETOS NSPAWN VARIANT) ~]
$ whereis fboss2
fboss2: /usr/local/bin/fboss2

$ ls -al /usr/local/bin/fboss2
-rwxr-xr-x 1 root root 437157192 Feb  4 17:40 /usr/local/bin/fboss2

$ echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

$ ls -al /etc/packages/
total 0
drwxrwxr-x 1 root switching  286 Oct 30 16:23 .
drwxr-xr-x 1 root root      2726 Feb  9 07:04 ..
drwxr-xr-x 1 root root       206 Jan 26 14:01 neteng-fboss-bgpd
drwxr-xr-x 1 root root       206 Jan 26 14:01 neteng-fboss-fsdb
drwxr-xr-x 1 root root       206 Jan 26 14:01 neteng-fboss-qsfp_service
drwxr-xr-x 1 root root       206 Jan 26 13:55 neteng-fboss-qsfp_service-firmware
drwxr-xr-x 1 root root       206 Jan 26 14:01 neteng-fboss-wedge_agent
drwxr-xr-x 1 root root       206 Jan 26 14:01 openr
-rw-r--r-- 1 root root         0 Oct 15 15:36 .package_updater_lock

@kevin645 let me know what do you think

@joseph5wu
Copy link
Contributor

Actually talked to Kevin, and it shouldn't be difficult to adjust the path or directory with a small diff in the future.
I agree that we don't have to put the whole /opt/fboss/bin/ in $PATH, maybe we can just create an fboss2-dev alias in /user/local/bin since we know it's an executable cli binary

@travisb-nexthop
Copy link
Contributor Author

we can just create an fboss2-dev alias in /user/local/bin since we know it's an executable cli binary

Ok, how about I add a small wrapper script as /usr/local/bin/fboss2-dev (and for any other normal command) which invokes the correct binary? This wrapper will later work with component updating where the binary path is not always fixed under /opt/fboss. Similar to the unit drop-ins necessary for the services.

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.

3 participants