Skip to content

[Nexthop] Add a Distro Image demo container example - #911

Closed
travisb-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:distro_demo_container
Closed

travisb-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:distro_demo_container

Conversation

@travisb-nexthop

Copy link
Copy Markdown
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
meta#911 which motivated this need.
@meta-codesync

meta-codesync Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

@kevin645 has imported this pull request. If you are a Meta employee, you can view this in D93011198.

meta-codesync Bot pushed a commit that referenced this pull request Mar 6, 2026
Summary:
**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`

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.

Pull Request resolved: #916

Test Plan:
Build the Demo Container other_dependency from
#911 which motivated this need.

Reviewed By: shiva-menta

Differential Revision: D95069372

Pulled By: kevin645

fbshipit-source-id: 8375260f8336d6ff684e72c0581aa39f04c1386c
@meta-codesync meta-codesync Bot closed this in 68bc869 Mar 9, 2026
@meta-codesync

meta-codesync Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

@kevin645 merged this pull request in 68bc869.

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.

2 participants