Repository navigation
[Nexthop][distro] Commit the bootstrap agent.conf as the first fboss2 config history commit - #1897
earnest-nexthop wants to merge 1 commit into
Conversation
…mmit
fboss2 starts its config history in /etc/coop at the first `fboss2-dev
config` session, from whatever agent.conf holds then. Anything written
before that (provisioning, test tooling, hand edits) is never recorded,
so the first commit is not reliably the agent.conf the image installed.
On the boot that creates agent.conf, fboss_init.sh now starts the
history as ConfigSession::initializeGit would and commits the bootstrap
as cli/agent.conf with cli/cli_metadata.json ("Initial commit: bootstrap
agent.conf"). It is skipped when agent.conf already existed or the
history has commits, and a failure is logged without stopping boot,
since fboss2's own lazy init still covers that case. fboss2 then skips
its init and commits on top, so the first commit stays the bootstrap.
Signed-off-by: Earnest Phyo <earnest@nexthop.ai>
|
Hi @earnest-nexthop! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
fboss2 starts its config history in
/etc/coopat the firstfboss2-dev configsession, from whateveragent.confholds then. Anything written before that (provisioning, test tooling, hand edits) is never recorded, so the first commit is not reliably theagent.confthe image installed. Tools that need the bootstrap config (for example, to lay generated configuration onto it) cannot get it from the history.agent.conf(first boot after imaging),fboss_init.shstarts the history asConfigSession::initializeGitwould and commits the bootstrap ascli/agent.confwithcli/cli_metadata.json: "Initial commit: bootstrap agent.conf". A newAGENT_CONF_CREATEDflag, set bysetup_agent_config, marks that boot.agent.confalready existed or the history has commits. A failure is logged and boot continues; fboss2's lazy init still covers that case.Test Plan
fboss_init.shinstalled and a first boot simulated (noagent.conf, no history): one commit byfboss-clionmainholding the materialized bootstrap (withsdkVersion), identical to the liveagent.conf, repository group-shared. Afboss2-dev configsession then committed on top and reloaded the agent with the first commit unchanged; rerunningfboss_initadded nothing.shellcheckandshfmtpass.