Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cfggen] Support reading from and writing to configdb #808

Merged
merged 11 commits into from
Aug 2, 2017

Conversation

taoyl-ms
Copy link
Contributor

No description provided.

@lguohan
Copy link
Collaborator

lguohan commented Jul 14, 2017

retest this please #Closed

@lguohan
Copy link
Collaborator

lguohan commented Jul 16, 2017

can you do a rebase so that it is easy to check the changes from codeflow. #Resolved

@taoyl-ms
Copy link
Contributor Author

done


In reply to: 315573216 [](ancestors = 315573216)

break
fi
sleep 1
done
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while true; do if [ "$(redis-cli ping)" == "PONG" ]; then break; fi; sleep 1; done

is more reliable then just check existence of redis.sock #Resolved

@@ -132,8 +132,7 @@ sudo bash -c "echo dhcp_as_static=true >> $FILESYSTEM_ROOT/etc/sonic/updategraph
sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
{% endif %}
{% if shutdown_bgp_on_start == "y" %}
sudo bash -c "echo bgp_admin_state: > $FILESYSTEM_ROOT/etc/sonic/bgp_admin.yml"
sudo bash -c "echo ' all: off' >> $FILESYSTEM_ROOT/etc/sonic/bgp_admin.yml"
sudo bash -c "echo '{ \"bgp_admin_state\": { \"all\": false } }' >> $FILESYSTEM_ROOT/etc/sonic/config_db.json"
{% endif %}
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the option is n, we should probably put bgp_admin_state to true. the reason is that when bgp docker start, it needs to read the bgp_admin_state, there is chance that the configuration is loaded to the config_db yet. In this case, how do you know whether config is already loaded but the state is true versus the config is not yet loaded? #ByDesign

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to tell whether configuration is loaded or not by looking at the content of config. Instead, we should find other ways to ensure initial config loading is finished before other container consume DB data, either by systemd service sequence or by setting flag in DB.


In reply to: 128321125 [](ancestors = 128321125)

parser.add_argument("-a", "--additional-data", help="addition data, in json string")
parser.add_argument("-d", "--from-db", help="read config from configdb", action='store_true')
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this option, we should always read from the configdb. can we make it as default? #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll suggest keep the -d option during migration from minigraph to db. We can come back to revisit this after we move all data to DB.


In reply to: 128322480 [](ancestors = 128322480)

group = parser.add_mutually_exclusive_group()
group.add_argument("-t", "--template", help="render the data with the template file")
group.add_argument("-v", "--var", help="print the value of a variable, support jinja2 expression")
group.add_argument("--var-json", help="print the value of a variable, in json format")
group.add_argument("--print-data", help="print all data", action='store_true')
group.add_argument("-D", "--write-to-db", help="write config into configdb", action='store_true')
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-write-to-db [](start = 31, length = 12)

--import : import json into configdb #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the current option setting for dev purposes. I'll later add a "config load" and "config save" command to CLI for users.


In reply to: 128327833 [](ancestors = 128327833)

Dump config DB content into json file:
sonic-cfggen -d --print-data > db_dump.json
Load content of json file into config DB:
sonic-cfggen -j db_dump.json --write-to-db
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onic-cfggen -j db_dump.json --write-to-db [](start = 9, length = 41)

sonic-cfggen --import db_dump.json #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the current option setting for dev purposes. I'll later add a "config load" and "config save" command to CLI for users.


In reply to: 128328144 [](ancestors = 128328144)

Render template with minigraph:
sonic-cfggen -m -t /usr/share/template/bgpd.conf.j2
Dump config DB content into json file:
sonic-cfggen -d --print-data > db_dump.json
Copy link
Collaborator

@lguohan lguohan Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-d [](start = 21, length = 3)

if we assume by default it will load configdb, then we do not need this option. #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we fully remove minigraph dependency, let's keep -m and -d options.


In reply to: 128328361 [](ancestors = 128328361)

@lguohan
Copy link
Collaborator

lguohan commented Jul 19, 2017

🕐

@@ -21,6 +18,8 @@ echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

rm -f /var/run/rsyslogd.pid

supervisorctl start bgpcfgd
Copy link
Collaborator

@lguohan lguohan Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need this for docker-fpm-frr too. #WontFix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will resolve in later PRs.


In reply to: 130536078 [](ancestors = 130536078)

[program:redis-server]
command=/usr/bin/redis-server /etc/redis/redis.conf
[program:start.sh]
command=/usr/bin/start.sh
Copy link
Collaborator

@lguohan lguohan Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not why start redis-server inside start.sh, why can you make start.sh independent of redis-server start. maybe rename it as configdb-load.sh? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just because we are following the similar design - start.sh controls all - in other dockers. As redis-server in docker-database does not have any dependency, I can decouple it with start.sh.


In reply to: 130537997 [](ancestors = 130537997)

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a question on docker-database start.sh. frr support can be another pr.

@taoyl-ms
Copy link
Contributor Author

taoyl-ms commented Aug 2, 2017

retest this please #Closed

@taoyl-ms taoyl-ms merged commit b6efe43 into sonic-net:master Aug 2, 2017
jleveque added a commit that referenced this pull request Mar 26, 2021
Update sonic-sairedis submodule and also update sonic-swss submodule as there are interdependent changes.

* src/sonic-sairedis 13474d1...bc58b0f (12):
  > Add gbsyncdmgrd; deprecate gbsyncd_startup.py (#809)
  > Remove gbsyncd_start.sh (#808)
  > [gbsyncd] Fix shebang in gbsyncd_startup.py; Make script executable (#807)
  > [saiasiccmp] Add saiasiccmp tool to compare 2 asic views (#791)
  > [configure] Add -Wno-psabi to remove "passing argument changed in GCC 7.1" (#799)
  > Update FlexCounter.cpp, use m_pollInterval in MUTEX lock (#797)
  > [vs] Add special warm boot logic to populate default attributes (#796)
  > [ci]: add vstest (#795)
  > [tests] Add macsec unittest (#782)
  > [debian/control] libsairedis-dev depends on libzmq5-dev (#794)
  > [ci]: use build template (#793)
  > Rename duplicate file name (#773)

* src/sonic-swss 0b0d24c...5adb73e (47):
  > Initialize system port type variable (#1681)
  > [Dynamic Buffer Calc] Enhance the field checking in table handling (#1680)
  > Handle the clear request for 'Q_SHARED_ALL' (#1653)
  > [MuxOrch] FDB ageout safety check (#1674)
  > Deactivate mirror session only when session status is true in updateLagMember (#1666)
  > Revert "[buffermgr] Support maximum port headroom checking (#1607)" (#1675)
  > reduce severity of log to info in case of flush on non-existing member (#1669)
  > Revert "[Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (#1652)" (#1676)
  > [Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (#1652)
  > [acl] Move ACL table constants to acltable.h (#1671)
  > [nbrmgrd] added function to parse IP address from APP_DB (#1672)
  > [MUX/PFCWD] Use in_ports for acls instead of seperate ACL table (#1670)
  > [vog/systemlag] Voq lagid allocator (#1603)
  > Add table descriptions for dynamic buffer calculation to the documents (#1664)
  > [vstest/subintf] Add vs test case to validate processing sequence of APPL DB keys (#1663)
  > Remove vxlanmgrd dependency on orchagent (#1647)
  > Keep attribute order in bulk mode (#1659)
  > [mux] VS test for neigh, route and fdb (#1656)
  > [linksync] Netdev oper status determination using IFF_RUNNING (#1568)
  > [portorch] parse on/off value from autoneg (#1658)
  > [intfsorch] Create subport with the entry contains necessary attributes (#1650)
  > [ci]: Purge swss before install (#1654)
  > Update StateDB with error if state change failed, Update APP_DB in all state chg req (#1662)
  > Added changes to handle dependency check in FdbSyncd and FpmSyncd for warm-boot (#1556)
  > [synchronous mode] Add failure notification for SAI failures in synchronous mode (#1596)
  > [acl] Enable VLAN ID qualifier for ACL rules (#1648)
  > Updated PFCWD to use single ACL table for PFCWD and MUX (#1620)
  > [orchagent] Increase SAI REDIS response timeout to support FW upgrade during init (Mellanox only). (#1637)
  > [vstest/nhg]: use dvs_route fixture to make test_nhg more robust
  > [vstest]: add dvs_route fixture
  > [vstest/subintf] Update vs tests to validate physical port host interface vlan tag attribute (#1634)
  > Remove useless header  in macsecorch (#1628)
  > Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (#1600)
  > fixed unsupported resource issue (#1641)
  > [test_virtual_chassis]: use wait_for to make test more robust (#1640)
  > spell check fixes (#1630)
  > [bufferorch] Handle NOT IMPLEMENTED status returned during set attr operation (#1639)
  > [ci]: run vstest
  > [test_virtual_chassis]: use wait_for function to improve test robustness
  > [Mux] Neighbor handling based on FDB entry (#1631)
  > [ci]: use build template (#1633)
  > Log level change from ERR to INFO for fetch systemports issue (#1632)
  > Migrate serdes programming to port serdes object (#1611)
  > [tests] Remove legacy saiattributelist.h dependency (#1608)
  > [buffermgr] Support maximum port headroom checking (#1607)
  > Support shared headroom pool on top of dynamic buffer calculation (#1581)
  > Fix the compiling errors in gcc9 (#1621)
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this pull request May 10, 2021
…ontainer auto-restart feature. (sonic-net#808)

* [Command-reference.md] Correct a typo.

Signed-off-by: Yong Zhao <[email protected]>

* [Command-Reference.md] Fix the link jump.

Signed-off-by: Yong Zhao <[email protected]>

* [Command-Reference.md] Fix the link jump.

Signed-off-by: Yong Zhao <[email protected]>

* [Command-Reference.md] Fix the link jump.

Signed-off-by: Yong Zhao <[email protected]>
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this pull request May 23, 2021
Update sonic-sairedis submodule and also update sonic-swss submodule as there are interdependent changes.

* src/sonic-sairedis 13474d1...bc58b0f (12):
  > Add gbsyncdmgrd; deprecate gbsyncd_startup.py (sonic-net#809)
  > Remove gbsyncd_start.sh (sonic-net#808)
  > [gbsyncd] Fix shebang in gbsyncd_startup.py; Make script executable (sonic-net#807)
  > [saiasiccmp] Add saiasiccmp tool to compare 2 asic views (sonic-net#791)
  > [configure] Add -Wno-psabi to remove "passing argument changed in GCC 7.1" (sonic-net#799)
  > Update FlexCounter.cpp, use m_pollInterval in MUTEX lock (sonic-net#797)
  > [vs] Add special warm boot logic to populate default attributes (sonic-net#796)
  > [ci]: add vstest (sonic-net#795)
  > [tests] Add macsec unittest (sonic-net#782)
  > [debian/control] libsairedis-dev depends on libzmq5-dev (sonic-net#794)
  > [ci]: use build template (sonic-net#793)
  > Rename duplicate file name (sonic-net#773)

* src/sonic-swss 0b0d24c...5adb73e (47):
  > Initialize system port type variable (sonic-net#1681)
  > [Dynamic Buffer Calc] Enhance the field checking in table handling (sonic-net#1680)
  > Handle the clear request for 'Q_SHARED_ALL' (sonic-net#1653)
  > [MuxOrch] FDB ageout safety check (sonic-net#1674)
  > Deactivate mirror session only when session status is true in updateLagMember (sonic-net#1666)
  > Revert "[buffermgr] Support maximum port headroom checking (sonic-net#1607)" (sonic-net#1675)
  > reduce severity of log to info in case of flush on non-existing member (sonic-net#1669)
  > Revert "[Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (sonic-net#1652)" (sonic-net#1676)
  > [Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (sonic-net#1652)
  > [acl] Move ACL table constants to acltable.h (sonic-net#1671)
  > [nbrmgrd] added function to parse IP address from APP_DB (sonic-net#1672)
  > [MUX/PFCWD] Use in_ports for acls instead of seperate ACL table (sonic-net#1670)
  > [vog/systemlag] Voq lagid allocator (sonic-net#1603)
  > Add table descriptions for dynamic buffer calculation to the documents (sonic-net#1664)
  > [vstest/subintf] Add vs test case to validate processing sequence of APPL DB keys (sonic-net#1663)
  > Remove vxlanmgrd dependency on orchagent (sonic-net#1647)
  > Keep attribute order in bulk mode (sonic-net#1659)
  > [mux] VS test for neigh, route and fdb (sonic-net#1656)
  > [linksync] Netdev oper status determination using IFF_RUNNING (sonic-net#1568)
  > [portorch] parse on/off value from autoneg (sonic-net#1658)
  > [intfsorch] Create subport with the entry contains necessary attributes (sonic-net#1650)
  > [ci]: Purge swss before install (sonic-net#1654)
  > Update StateDB with error if state change failed, Update APP_DB in all state chg req (sonic-net#1662)
  > Added changes to handle dependency check in FdbSyncd and FpmSyncd for warm-boot (sonic-net#1556)
  > [synchronous mode] Add failure notification for SAI failures in synchronous mode (sonic-net#1596)
  > [acl] Enable VLAN ID qualifier for ACL rules (sonic-net#1648)
  > Updated PFCWD to use single ACL table for PFCWD and MUX (sonic-net#1620)
  > [orchagent] Increase SAI REDIS response timeout to support FW upgrade during init (Mellanox only). (sonic-net#1637)
  > [vstest/nhg]: use dvs_route fixture to make test_nhg more robust
  > [vstest]: add dvs_route fixture
  > [vstest/subintf] Update vs tests to validate physical port host interface vlan tag attribute (sonic-net#1634)
  > Remove useless header  in macsecorch (sonic-net#1628)
  > Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (sonic-net#1600)
  > fixed unsupported resource issue (sonic-net#1641)
  > [test_virtual_chassis]: use wait_for to make test more robust (sonic-net#1640)
  > spell check fixes (sonic-net#1630)
  > [bufferorch] Handle NOT IMPLEMENTED status returned during set attr operation (sonic-net#1639)
  > [ci]: run vstest
  > [test_virtual_chassis]: use wait_for function to improve test robustness
  > [Mux] Neighbor handling based on FDB entry (sonic-net#1631)
  > [ci]: use build template (sonic-net#1633)
  > Log level change from ERR to INFO for fetch systemports issue (sonic-net#1632)
  > Migrate serdes programming to port serdes object (sonic-net#1611)
  > [tests] Remove legacy saiattributelist.h dependency (sonic-net#1608)
  > [buffermgr] Support maximum port headroom checking (sonic-net#1607)
  > Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1581)
  > Fix the compiling errors in gcc9 (sonic-net#1621)
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
Update sonic-sairedis submodule and also update sonic-swss submodule as there are interdependent changes.

* src/sonic-sairedis 13474d1...bc58b0f (12):
  > Add gbsyncdmgrd; deprecate gbsyncd_startup.py (sonic-net#809)
  > Remove gbsyncd_start.sh (sonic-net#808)
  > [gbsyncd] Fix shebang in gbsyncd_startup.py; Make script executable (sonic-net#807)
  > [saiasiccmp] Add saiasiccmp tool to compare 2 asic views (sonic-net#791)
  > [configure] Add -Wno-psabi to remove "passing argument changed in GCC 7.1" (sonic-net#799)
  > Update FlexCounter.cpp, use m_pollInterval in MUTEX lock (sonic-net#797)
  > [vs] Add special warm boot logic to populate default attributes (sonic-net#796)
  > [ci]: add vstest (sonic-net#795)
  > [tests] Add macsec unittest (sonic-net#782)
  > [debian/control] libsairedis-dev depends on libzmq5-dev (sonic-net#794)
  > [ci]: use build template (sonic-net#793)
  > Rename duplicate file name (sonic-net#773)

* src/sonic-swss 0b0d24c...5adb73e (47):
  > Initialize system port type variable (sonic-net#1681)
  > [Dynamic Buffer Calc] Enhance the field checking in table handling (sonic-net#1680)
  > Handle the clear request for 'Q_SHARED_ALL' (sonic-net#1653)
  > [MuxOrch] FDB ageout safety check (sonic-net#1674)
  > Deactivate mirror session only when session status is true in updateLagMember (sonic-net#1666)
  > Revert "[buffermgr] Support maximum port headroom checking (sonic-net#1607)" (sonic-net#1675)
  > reduce severity of log to info in case of flush on non-existing member (sonic-net#1669)
  > Revert "[Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (sonic-net#1652)" (sonic-net#1676)
  > [Dynamic buffer calc] Bug fix: Remove PGs from an administratively down port. (sonic-net#1652)
  > [acl] Move ACL table constants to acltable.h (sonic-net#1671)
  > [nbrmgrd] added function to parse IP address from APP_DB (sonic-net#1672)
  > [MUX/PFCWD] Use in_ports for acls instead of seperate ACL table (sonic-net#1670)
  > [vog/systemlag] Voq lagid allocator (sonic-net#1603)
  > Add table descriptions for dynamic buffer calculation to the documents (sonic-net#1664)
  > [vstest/subintf] Add vs test case to validate processing sequence of APPL DB keys (sonic-net#1663)
  > Remove vxlanmgrd dependency on orchagent (sonic-net#1647)
  > Keep attribute order in bulk mode (sonic-net#1659)
  > [mux] VS test for neigh, route and fdb (sonic-net#1656)
  > [linksync] Netdev oper status determination using IFF_RUNNING (sonic-net#1568)
  > [portorch] parse on/off value from autoneg (sonic-net#1658)
  > [intfsorch] Create subport with the entry contains necessary attributes (sonic-net#1650)
  > [ci]: Purge swss before install (sonic-net#1654)
  > Update StateDB with error if state change failed, Update APP_DB in all state chg req (sonic-net#1662)
  > Added changes to handle dependency check in FdbSyncd and FpmSyncd for warm-boot (sonic-net#1556)
  > [synchronous mode] Add failure notification for SAI failures in synchronous mode (sonic-net#1596)
  > [acl] Enable VLAN ID qualifier for ACL rules (sonic-net#1648)
  > Updated PFCWD to use single ACL table for PFCWD and MUX (sonic-net#1620)
  > [orchagent] Increase SAI REDIS response timeout to support FW upgrade during init (Mellanox only). (sonic-net#1637)
  > [vstest/nhg]: use dvs_route fixture to make test_nhg more robust
  > [vstest]: add dvs_route fixture
  > [vstest/subintf] Update vs tests to validate physical port host interface vlan tag attribute (sonic-net#1634)
  > Remove useless header  in macsecorch (sonic-net#1628)
  > Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (sonic-net#1600)
  > fixed unsupported resource issue (sonic-net#1641)
  > [test_virtual_chassis]: use wait_for to make test more robust (sonic-net#1640)
  > spell check fixes (sonic-net#1630)
  > [bufferorch] Handle NOT IMPLEMENTED status returned during set attr operation (sonic-net#1639)
  > [ci]: run vstest
  > [test_virtual_chassis]: use wait_for function to improve test robustness
  > [Mux] Neighbor handling based on FDB entry (sonic-net#1631)
  > [ci]: use build template (sonic-net#1633)
  > Log level change from ERR to INFO for fetch systemports issue (sonic-net#1632)
  > Migrate serdes programming to port serdes object (sonic-net#1611)
  > [tests] Remove legacy saiattributelist.h dependency (sonic-net#1608)
  > [buffermgr] Support maximum port headroom checking (sonic-net#1607)
  > Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1581)
  > Fix the compiling errors in gcc9 (sonic-net#1621)
AidanCopeland pushed a commit to Metaswitch/sonic-buildimage that referenced this pull request Apr 14, 2022
`gbsyncd_start.sh` was a simple wrapper which only called `exec "/usr/bin/gbsyncd_startup.py"`. This causes unnecessary extra complexity and maintenance. It makes things simpler to run `/usr/bin/gbsyncd_startup.py` directly, which is being done by sonic-net#7084. That PR has merged, so we can now merge this.
mssonicbld added a commit that referenced this pull request Sep 27, 2023
…omatically (#16696)

#### Why I did it
src/sonic-swss-common
```
* b0f148e - (HEAD -> master, origin/master, origin/HEAD) [chassis][voq] Add fabric monitoring tables definitions. (#808) (10 hours ago) [jfeng-arista]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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.

4 participants