Skip to content

Commit 2f54d69

Browse files
KevinYakarmeta-codesync[bot]
authored andcommitted
Fix BGP GitHub CI by building in the FBOSS image (#16)
Summary: Pull Request resolved: #16 The BGP GitHub Actions workflow has failed on every run since it was added in July. It runs getdeps directly on an Ubuntu runner, where this dependency closure has never been built: it first fails to resolve the EL9-only `gcc12`, and past that, third-party code fails to compile under GCC 13. Build in the FBOSS CentOS Stream 9 image through `run-getdeps.py` instead, the environment the `oss_bgp` conveyor and on-diff BGP OSS jobs already build in, so GitHub CI checks the same thing internal CI does. Reviewed By: Scott8440 Differential Revision: D128415158 fbshipit-source-id: 359a9ff870cef20a12c3229ac850396b0f8565c0
1 parent fc68ee0 commit 2f54d69

1 file changed

Lines changed: 40 additions & 22 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ jobs:
4141
run: sudo rm -rf ${{ github.workspace }}/*
4242
- name: Check out repository code
4343
uses: actions/checkout@v7
44+
# Build in the FBOSS CentOS Stream 9 image through run-getdeps.py, as the
45+
# internal BGP OSS builds do. The wrapper switches the image to clang and
46+
# sets flags some dependencies need (e.g. HAVE_SETNS for iproute2); plain
47+
# getdeps on the Ubuntu runner has never built this dependency closure.
48+
# Neither the Dockerfile nor the wrapper ships in this repo, so both come
49+
# from an FBOSS clone.
50+
- name: Fetch FBOSS build tooling
51+
run: git clone --depth 1 https://github.com/meta/fboss.git ${{ runner.temp }}/fboss
52+
- name: Build FBOSS Docker image
53+
run: >
54+
sudo docker build ${{ runner.temp }}/fboss
55+
-f ${{ runner.temp }}/fboss/fboss/oss/docker/Dockerfile
56+
-t fboss_image
57+
--build-arg USE_CLANG=true
4458
# Build DC against the FBOSS fsdb_client profile and BB against the
4559
# smaller exported_libraries profile. Separate build directories ensure
4660
# each variant configures and installs its own dependency closure.
@@ -51,39 +65,43 @@ jobs:
5165
# scratch dir nested in this repo makes it patch from the BGP root and fail
5266
# (e.g. boost -> "No such file or directory"). runner.temp is a sibling of
5367
# the checkout and is not a git repo.
68+
# FBOSS_ROOT points run-getdeps.py at this checkout's getdeps instead of
69+
# the FBOSS clone it runs from.
5470
- name: Build BGP ${{ matrix.variant }} (getdeps / CMake)
5571
run: >
56-
sudo
57-
env
58-
BUILD_SAI_FAKE=1
59-
FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
60-
python3
61-
build/fbcode_builder/getdeps.py
62-
--allow-system-packages
63-
--scratch-path
64-
${{ runner.temp }}/bgp-build-${{ matrix.variant }}
72+
sudo docker run --rm
73+
--cap-add=CAP_AUDIT_WRITE
74+
-e FBOSS_ROOT=/var/FBOSS/fboss
75+
-e FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
76+
-v ${{ github.workspace }}:/var/FBOSS/fboss:z
77+
-v ${{ runner.temp }}/fboss:/var/FBOSS/fboss_tools:ro
78+
-v ${{ runner.temp }}/bgp-build-${{ matrix.variant }}:/var/FBOSS/tmp_bld_dir:z
79+
fboss_image:latest
80+
python3 /var/FBOSS/fboss_tools/fboss/oss/scripts/run-getdeps.py
6581
build
82+
--allow-system-packages
83+
--scratch-path /var/FBOSS/tmp_bld_dir
6684
--extra-cmake-defines='{"BGP_BUILD_VARIANT":"${{ matrix.variant }}"}'
6785
--src-dir=.
68-
--num-jobs
69-
18
86+
--num-jobs 18
7087
bgp
7188
- name: Test BGP ${{ matrix.variant }} (getdeps / CTest)
7289
run: >
73-
sudo
74-
env
75-
BUILD_SAI_FAKE=1
76-
FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
77-
python3
78-
build/fbcode_builder/getdeps.py
79-
--allow-system-packages
80-
--scratch-path
81-
${{ runner.temp }}/bgp-build-${{ matrix.variant }}
90+
sudo docker run --rm
91+
--cap-add=CAP_AUDIT_WRITE
92+
-e FBOSS_ROOT=/var/FBOSS/fboss
93+
-e FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
94+
-v ${{ github.workspace }}:/var/FBOSS/fboss:z
95+
-v ${{ runner.temp }}/fboss:/var/FBOSS/fboss_tools:ro
96+
-v ${{ runner.temp }}/bgp-build-${{ matrix.variant }}:/var/FBOSS/tmp_bld_dir:z
97+
fboss_image:latest
98+
python3 /var/FBOSS/fboss_tools/fboss/oss/scripts/run-getdeps.py
8299
test
100+
--allow-system-packages
101+
--scratch-path /var/FBOSS/tmp_bld_dir
83102
--extra-cmake-defines='{"BGP_BUILD_VARIANT":"${{ matrix.variant }}"}'
84103
--src-dir=.
85-
--num-jobs
86-
18
104+
--num-jobs 18
87105
bgp
88106
- name: Restore build ownership
89107
if: always()

0 commit comments

Comments
 (0)