Skip to content

Commit 1327125

Browse files
Build Distro Image in CI
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. --> **Pre-submission checklist** - [x] 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` - [x] `pre-commit run` <!-- Explain the motivation for making this change and any other context that you think would help reviewers of your code. What existing problem does the pull request solve? --> This is the start of the Distro Image CI where the Distro Image is built. This simply invokes the `fboss-image build` command against the sample `from_source.json` image manifest. The resulting artifacts are not preserved in this PR. As part of this it is necessary to remove `-it` from the docker command because GHA's don't have a stdin. Further the sample image manifest now requires all components be present, so add them. <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? --> <!-- If a relevant Github issue exists for this PR, please make sure you link that issue to this PR --> Look at the new workflow in this PR.
1 parent 0055265 commit 1327125

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Distro Image Build
2+
run-name: Distro Image Build
3+
4+
on:
5+
pull_request:
6+
# Allow manually triggering the workflow
7+
workflow_dispatch:
8+
push:
9+
branches: [ main ]
10+
11+
jobs:
12+
Distro-Image-Build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out repository code
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Run fboss-image build
21+
run: ./fboss-image/distro_cli/fboss-image build fboss-image/from_source.json
22+
23+
- name: Cleanup
24+
if: always()
25+
run: |
26+
docker stop ${USER}-fboss-image-builder 2>/dev/null || true
27+
docker rm ${USER}-fboss-image-builder 2>/dev/null || true

fboss-image/from_source.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"distribution_formats": {
33
"usb": "fboss-distro-image_usb.iso"
4+
},
5+
"kernel": {
6+
},
7+
"other_dependencies": [
8+
],
9+
"fboss-platform-stack": {
10+
},
11+
"bsps": [
12+
],
13+
"sai": {
14+
},
15+
"fboss-forwarding-stack": {
16+
},
17+
"image_build_hooks": {
418
}
519
}

fboss-image/image_builder/bin/build_image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if [ "${ENTER_SHELL}" = "yes" ] ; then
179179
else
180180
if [ "${BUILD_FBOSS_IMAGES}" = "yes" ]; then
181181
dprint "Starting image build, launching in docker: /${IMAGE_BUILDER_DIR}/bin/build_image_in_container.sh ${CHILD_SCRIPT_ARGS[*]}"
182-
docker run --rm -it "${DOCKER_ARGS}" "${DOCKER_IMAGE_NAME}" /"${IMAGE_BUILDER_DIR}"/bin/build_image_in_container.sh "${CHILD_SCRIPT_ARGS[@]}" >> "${LOG_FILE}" 2>&1
182+
docker run --rm "${DOCKER_ARGS}" "${DOCKER_IMAGE_NAME}" /"${IMAGE_BUILDER_DIR}"/bin/build_image_in_container.sh "${CHILD_SCRIPT_ARGS[@]}" >> "${LOG_FILE}" 2>&1
183183
RC=$?
184184
handle_error "${RC}" "docker run /${IMAGE_BUILDER_DIR}/bin/build_image.sh ${CHILD_SCRIPT_ARGS[*]}"
185185
fi

0 commit comments

Comments
 (0)