Skip to content

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

This adds an example of an other_dependency which creates and runs a custom container.

Here a simple clock service inside a container is added as this example.

Test Plan

Add this to the image manifest:

"other_dependencies": [
  { "execute": "examples/demo_container/build.sh" }
]

When the device boots, you can check the time:

[root@dut ~]# cat /var/clock/time.txt
  ________________________________________
| Current time is Thu Feb  5 18:34:43 2026 |
  ========================================
                                               \
                                                \
                                                 \
                                                  \
                                                     .-=-==--==--.
                                               ..-=="  ,'o`)      `.
                                             ,'         `"'         \
                                            :  (                     `.__...._
                                            |                  )    /         `-=-.
                                            :       ,vv.-._   /    /               `---==-._
                                             \/\/\/VV ^ d88`;'    /                         `.
                                                 ``  ^/d88P!'    /             ,              `._
                                                    ^/    !'   ,.      ,      /                  "-,,__,,--'""""-.
                                                   ^/    !'  ,'  \ . .(      (         _           )  ) ) ) ))_,-.\
                                                  ^(__ ,!',"'   ;:+.:%:a.     \:.. . ,'          )  )  ) ) ,"'    '
                                                  ',,,'','     /o:::":%:%a.    \:.:.:         .    )  ) _,'
                                                   """'       ;':::'' `+%%%a._  \%:%|         ;.). _,-""
                                                          ,-='_.-'      ``:%::)  )%:|        /:._,"
                                                         (/(/"           ," ,'_,'%%%:       (_,'
                                                                        (  (//(`.___;        \
                                                                         \     \    `         `
                                                                          `.    `.   `.        :
                                                                            \. . .\    : . . . :
                                                                             \. . .:    `.. . .:
                                                                              `..:.:\     \:...\
                                                                               ;:.:.;      ::...:
                                                                               ):%::       :::::;
                                                                           __,::%:(        :::::
                                                                        ,;:%%%%%%%:        ;:%::
                                                                          ;,--""-.`\  ,=--':%:%:\
                                                                         /"       "| /-".:%%%%%%%\
                                                                                         ;,-"'`)%%)
                                                                                        /"      "|
[root@dut ~]#

<!-- 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 adds an example of an other_dependency which creates and runs a
custom container.

Here a simple clock service inside a container is added as this example.

<!-- 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 -->

Add this to the image manifest:
```
"other_dependencies": [
  { "execute": "examples/demo_container/build.sh" }
]
```

When the device boots, you can check the time:
```
[root@dut ~]# cat /var/clock/time.txt
  ________________________________________
| Current time is Thu Feb  5 18:34:43 2026 |
  ========================================
                                               \
                                                \
                                                 \
                                                  \
                                                     .-=-==--==--.
                                               ..-=="  ,'o`)      `.
                                             ,'         `"'         \
                                            :  (                     `.__...._
                                            |                  )    /         `-=-.
                                            :       ,vv.-._   /    /               `---==-._
                                             \/\/\/VV ^ d88`;'    /                         `.
                                                 ``  ^/d88P!'    /             ,              `._
                                                    ^/    !'   ,.      ,      /                  "-,,__,,--'""""-.
                                                   ^/    !'  ,'  \ . .(      (         _           )  ) ) ) ))_,-.\
                                                  ^(__ ,!',"'   ;:+.:%:a.     \:.. . ,'          )  )  ) ) ,"'    '
                                                  ',,,'','     /o:::":%:%a.    \:.:.:         .    )  ) _,'
                                                   """'       ;':::'' `+%%%a._  \%:%|         ;.). _,-""
                                                          ,-='_.-'      ``:%::)  )%:|        /:._,"
                                                         (/(/"           ," ,'_,'%%%:       (_,'
                                                                        (  (//(`.___;        \
                                                                         \     \    `         `
                                                                          `.    `.   `.        :
                                                                            \. . .\    : . . . :
                                                                             \. . .:    `.. . .:
                                                                              `..:.:\     \:...\
                                                                               ;:.:.;      ::...:
                                                                               ):%::       :::::;
                                                                           __,::%:(        :::::
                                                                        ,;:%%%%%%%:        ;:%::
                                                                          ;,--""-.`\  ,=--':%:%:\
                                                                         /"       "| /-".:%%%%%%%\
                                                                                         ;,-"'`)%%)
                                                                                        /"      "|
[root@dut ~]#
```
@meta-cla meta-cla bot added the CLA Signed label Feb 7, 2026
@travisb-nexthop travisb-nexthop marked this pull request as ready for review February 7, 2026 02:48
travisb-nexthop added a commit to nexthop-ai/fboss that referenced this pull request Feb 9, 2026
<!-- 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? -->

Some kinds of builds require a privileged containers, such as builds
which need to use containers within themselves.

Make the component build containers all privileged.

This requires making /etc/shadow root-readable because CentOS uses
special permission capability overrides to read the file which are not
configured in the host user namespace.

<!-- 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 -->

Build the Demo Container other_dependency from
facebook#911 which motivated this need.
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