Skip to content

[Nexthop] Add fboss-sim: a minimal fake-SAI FBOSS runtime container#1278

Open
hillol-nexthop wants to merge 4 commits into
facebook:mainfrom
nexthop-ai:fboss-sim
Open

[Nexthop] Add fboss-sim: a minimal fake-SAI FBOSS runtime container#1278
hillol-nexthop wants to merge 4 commits into
facebook:mainfrom
nexthop-ai:fboss-sim

Conversation

@hillol-nexthop

@hillol-nexthop hillol-nexthop commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds fboss-sim, a minimal fake-SAI FBOSS runtime container. It packages the fake-SAI FBOSS agents and the fboss2 CLI into a small (~1.2 GB) CentOS Stream 9 Docker image, so FBOSS can be run and exercised end-to-end without any switching hardware.

What's included

  • fboss-sim/docker/Dockerfile.runtime — builds the runtime image from the CentOS Stream 9 base plus the existing FBOSS centos-09.0 rootfs overlay (fboss-image/image_builder/templates/centos-09.0/root_files/: systemd agent units, login env hook, eth0 IPv6 sysctl) and the collected binaries + shared libraries.
  • fboss-sim/scripts/fboss-sim-docker-package.py — collects the fake-SAI binaries and their ldd-resolved shared libraries and builds the image. Two phases:
    • --collect-only: resolve binaries + libs into tmp_build_dir/. Must run where ldd resolves the image-base libraries (CentOS Stream 9), e.g. inside the CentOS build image.
    • --build-only: docker build the image from tmp_build_dir/ on the host that owns the Docker daemon.
    • A flagless run does both (when the host is already CentOS Stream 9).
  • fboss-sim/scripts/fboss-sim-docker-run.py — creates an IPv6 network and starts the runtime container in split or monolithic agent mode.
  • .github/workflows/fboss-sim.yml — a GitHub Actions job that builds the fake-SAI agent + fboss2 targets via docker-build.py, packages and starts the runtime image (collect inside the CentOS fboss_image, build on the host), and runs fboss2_integration_test. Mirrors the existing agent.yml / fboss2-cli.yml pattern.

Build naming

The BUILD_SAI_FAKE CMake arm now names the fake-SAI agents wedge_agent-sai_impl / fboss_hw_agent-sai_impl (instead of -fake), so they land at the /opt/fboss/bin paths the systemd units and package.py already reference — the runtime no longer needs -fake-sai_impl symlinks.

Testing

Validated locally with a fake-SAI build:

  • --collect-only inside the build container → --build-only on the host → image built from the centos-09.0 template rootfs.
  • Container starts; both fboss_sw_agent and fboss_hw_agent@0 go active; fboss2 show interface serves fake Montblanc ports.
  • fboss2_integration_test: 38 tests / 18 suites, all passed.

fboss-sim packages the fake-SAI FBOSS agents and the fboss2 CLI into a
small (~1.2 GB) CentOS Stream 9 Docker image, so FBOSS can be run and
exercised end-to-end without any switching hardware.

- docker/Dockerfile.runtime builds the runtime image from the CentOS
  Stream 9 base plus the existing FBOSS centos-09.0 rootfs overlay
  (systemd agent units, login env hook, eth0 IPv6 sysctl) and the
  collected binaries + shared libraries.
- scripts/fboss-sim-docker-package.py collects the fake-SAI binaries and
  their ldd-resolved libraries and builds the image. It has two phases:
  --collect-only (run where ldd resolves the image-base libraries, i.e.
  inside the CentOS build image) and --build-only (run on the host that
  owns the Docker daemon); a flagless run does both.
- scripts/fboss-sim-docker-run.py creates an IPv6 network and starts the
  runtime container in split or monolithic agent mode.

A new GitHub Actions workflow (.github/workflows/fboss-sim.yml) builds
the fake-SAI agent + fboss2 targets via docker-build.py, packages and
starts the runtime image, and runs fboss2_integration_test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hillol-nexthop hillol-nexthop requested a review from a team as a code owner June 10, 2026 15:51
@meta-cla meta-cla Bot added the CLA Signed label Jun 10, 2026
@hillol-nexthop hillol-nexthop marked this pull request as draft June 10, 2026 15:52
hillol-nexthop and others added 2 commits June 11, 2026 03:43
The BUILD_SAI_FAKE arm now builds the agents with the -sai_impl suffix
(and is made mutually exclusive with the real-SAI SAI_IMPL path via
elseif), and fboss_fake_agent_targets depends on wedge_agent-sai_impl /
fboss_hw_agent-sai_impl. This lands fake-SAI builds at the
/opt/fboss/bin paths the systemd units and package.py already reference,
so the fboss-sim runtime no longer needs the -fake -> -sai_impl
symlinks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…/profile 39

Add sudo to the runtime Dockerfile's dnf install list, and bump all four
mono.conf ports from 400G/profileID 38 to 800G/profileID 39.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hillol-nexthop hillol-nexthop marked this pull request as ready for review June 16, 2026 07:59
@hillol-nexthop

Copy link
Copy Markdown
Contributor Author

there is a list of tests failing which need to be looked at separately but this is the fboss-sim infra and GHA.

resolve_dependencies() set LD_LIBRARY_PATH to a `find installed/` union of
every lib dir under the getdeps installed/ tree before running ldd.
LD_LIBRARY_PATH outranks the binary's RUNPATH and ldd takes the first dir
on the path with a matching soname, so a stale dependency generation left
in installed/ by a previous build could shadow the correct one and produce
a package with ABI-mismatched libs (undefined symbol at load).

Each binary's RUNPATH already points at the exact install dir it was linked
against, so resolve via RUNPATH instead: strip any inherited LD_LIBRARY_PATH
and let ldd use RUNPATH + default system paths (system libs resolve from
/usr/lib64). Remove the now-unused get_lib_search_paths() helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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