Skip to content

[config] Support for running config reload in background #1290

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

Open
wants to merge 129 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
9bf1dd8
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
45acb38
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
8878d28
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
171f2fb
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
214c6d2
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
2f0789b
Added -b option for config reload command to run in background mode
anand-kumar-subramanian Mar 2, 2021
7b91f9c
Fast-reboot: add a new flag to ignore ASIC config checksum verificati…
vaibhavhd Dec 7, 2020
0499823
[fast-reboot] Fix fast-reboot when NDP entries are present (#1295)
shlomibitton Dec 8, 2020
dd8cfc5
[config/console][consutil] Support enable/disable console switch (#1275)
Blueve Dec 9, 2020
f582b2d
[sflow] Fix traceback seen for show sflow interface (#1282)
GarrickHe Dec 9, 2020
ddb4848
[unit test][CLI][pfcwd] Added pfcwd config tests for single and multi…
smaheshm Dec 9, 2020
effcae2
Add show and clear commands for headroom pool watermark (#1144)
neethajohn Dec 9, 2020
715e682
[acl_loader] Fix default DENY rule for V6 dataplane ACLs (#1281)
daall Dec 10, 2020
4b35407
Fix show ip route summary on pizzabox platforms (#1302)
gechiang Dec 11, 2020
a73ad10
Added 'detailed' option for 'show interface counters' command (#1299)
AkhileshSamineni Dec 13, 2020
737f625
[pcieutil] Remove 'pcie-' prefix from arguments (#1297)
jleveque Dec 13, 2020
0b46a0d
[kdump]: Parse sonic_platform kernel command line parameter to read t…
rajendra-dendukuri Dec 13, 2020
a2280a0
show tech with platform dump option (#1158)
sujinmkang Dec 15, 2020
65535f4
[Dynamic buffer calc] Support dynamic buffer calculation (#973)
stephenxs Dec 15, 2020
da72dac
Mgmt vrf/SNMP agent validations and bug fixes (#1289)
sumanbrcm Dec 16, 2020
bafd258
[fast-reboot-dump] Fix exception in struct.pack (#1309)
bingwang-ms Dec 17, 2020
76fb28a
[config vlan]: Remove `-t` flag from docker exec command (#1317)
theasianpianist Dec 17, 2020
fe0bd80
[Multi-asic] Enhanced Feature Table configuration for multi-asic plat…
abdosi Dec 17, 2020
24f0b69
VXLAN config and show utilities (#870)
srj102 Dec 19, 2020
5d53771
Kubernetes support commands update (#1133)
renukamanavalan Dec 21, 2020
8f2dfd2
[dropcounters] Fix clear for non-root users (#1253)
daall Dec 22, 2020
297bbb7
[config] Add unit tests for 'config interface breakout' command (#1223)
Dec 22, 2020
f19500e
Fix exception handling in python3 (#1324)
bingwang-ms Dec 22, 2020
5369607
Retain fgnhg state db table entry during warm reboot (#1315)
weixchen1215 Dec 22, 2020
368a7c2
[CRM]Add support for snat, dnat and ipmc crm resources (#1258)
PrabhuSreenivasan Dec 23, 2020
c6fdf3a
[pytest][qos][config] Added pytests for "config qos reload" commands …
smaheshm Dec 23, 2020
ddcfcf8
Added show ip/v6 route summary support for multi-asic platform (#1320)
gechiang Dec 23, 2020
4d57fc6
[fast-reboot]: Update fast-reboot-dump.py to handle invalid parsing o…
jangidrk Dec 23, 2020
f34ec9b
[fast-reboot]: Stop sflow during fast-reboot (#1296)
jangidrk Dec 23, 2020
1ecad10
Revert "[pytest][qos][config] Added pytests for "config qos reload" c…
lguohan Dec 27, 2020
51cbf42
[route_check]: ignore routes pointing to Loopback interface (#1337)
lguohan Dec 28, 2020
3f0ada8
[unit test][pfcwd] Fix tests that require sudo access (#1340)
smaheshm Dec 29, 2020
04b207f
Add FW dump with new SAI implementation (#1338)
shlomibitton Jan 3, 2021
7006ed4
Adding global-timeout, individual command timeout, log files collecti…
FuzailBrcm Jan 4, 2021
dec5e13
[storyteller] adding a grep wrapper with predefined scenarios (#1349)
yxieca Jan 8, 2021
3098098
[route_check.py] - update includes checks on subscriptions (#1344)
renukamanavalan Jan 11, 2021
edc32ab
Validations checks while adding a member to PortChannel and removing …
AkhileshSamineni Jan 12, 2021
983d340
[show] Add subcommand to show midplane status for modular chassis (#1…
mprabhu-nokia Jan 12, 2021
d98f4a5
[pytest][qos][config] Added pytests for "config qos reload" commands"…
smaheshm Jan 14, 2021
cc2f788
Drop explict 3 seconds pause between two object updates/deletes. (#1359)
renukamanavalan Jan 15, 2021
0065d08
[show]fix for show muxcable status by replacing "hostname" to "peer_s…
vdahiya12 Jan 15, 2021
9a965e4
[PFCWD] Fix 'start' pfcwd command (#1345)
shlomibitton Jan 17, 2021
3db3a80
[generate_dump]: fix syntax error
lguohan Jan 19, 2021
dee1e66
[show] Fix show arp in case with FDB entries, linked to default VLAN …
Jan 19, 2021
9f79b90
[config] Fix Breakout mode option and BREAKOUT_CFG table check method…
samaity Jan 20, 2021
3f282d9
Validations checks while creating and deleting a Portchannel (#1326)
AkhileshSamineni Jan 20, 2021
68b3241
[show]: Use TCP Connection For Muxcable Commands (#1371)
tahmed-dev Jan 20, 2021
ffe686d
[ecnconfig] handle backend port names when extracting port I/F ID fro…
smaheshm Jan 20, 2021
8caf833
[sfpshow] Enhance QSFP-DD DOM information (#1207)
shlomibitton Jan 21, 2021
6a0420e
[ecn] Add tests for ecnconfig command (#1372)
neethajohn Jan 21, 2021
20ad859
add vlan_intf_object only if there are ipv4 or ipv6 mappings (#1377)
sumukhatv Jan 21, 2021
8d8b47e
[config_mgmt.py]: Set leaf-list to empty list while port breakout. (#…
Jan 22, 2021
07ee8a2
Prevent configuring IP interface on a port which is a member of VLAN …
deran1980 Jan 25, 2021
70f7a9a
[show] Fix warnings, related to gearbox, while show commands executio…
Jan 26, 2021
b0628c3
Improve robustness of consutil plugin loading (#1353)
Staphylo Jan 26, 2021
fd1b803
[pcieutil] Add 'pcie-aer' sub-command to display AER stats (#1169)
ArunSaravananBalachandran Jan 26, 2021
9728309
Prevent user from adding more then a single untagged VLAN to an inter…
deran1980 Jan 27, 2021
8aec073
[show] fix "show interfaces breakout" command (#1198)
dmytroxshevchuk Jan 27, 2021
7086f95
[sonic-installer] Add information to syslog (#1369)
d-dashkov Jan 28, 2021
f1ea921
[ecnconfig] Allow ecn unit test to run without sudo (#1390)
neethajohn Jan 29, 2021
149d0a9
[show] Run fwutil with sudo (#1364)
vboykox Feb 1, 2021
7eba5f0
Use SonicV2Connector/ConfigDBConnector/SonicDBConfig from swsscommon …
qiluo-msft Feb 2, 2021
d1a02f9
[vrf]: Fix freezing during interface binding (#1325)
Feb 2, 2021
65b376b
[storyteller] allow storyteller to work on downloaded logs (#1388)
yxieca Feb 3, 2021
9899a9e
do not parse stderr to get correct routing stack (#1398)
lguohan Feb 3, 2021
4b361cd
Skip route check for tun0 interfaces (#1399)
prsunny Feb 3, 2021
a68e34c
[config][show] cli support for retrieving ber, eye-info and configuri…
vdahiya12 Feb 4, 2021
35e94d8
[show] Fix int status when portchannel is in the system (#1376)
d-dashkov Feb 5, 2021
5c3e19b
[storyteller] Enhance the storyteller utility (#1400)
daall Feb 5, 2021
bbf00ac
Advertise ipv6 link local address (#1402)
sumukhatv Feb 5, 2021
bee2bec
[config reload]: Restart mux container (#1401)
theasianpianist Feb 5, 2021
bb0ba2e
Set up CI with Azure Pipelines
lguohan Feb 6, 2021
76487e3
[show] Use proper variable to avoid exception in natshow script (#1383)
Feb 6, 2021
adcdd2d
Fix unsupported fs.squashfs extraction in sonic-installer (#1366)
Staphylo Feb 6, 2021
d930a21
Support shared headroom pool on top of dynamic buffer calculation (#1…
stephenxs Feb 8, 2021
473d5a1
Fix: initialize SonicDBConfig differently for single or multi_asic (#…
qiluo-msft Feb 8, 2021
adf5856
[pcieutil] Remove the warning message and change the config file loca…
sujinmkang Feb 9, 2021
3ea25bd
[config reload]: Restart macsec container (#1410)
Pterosaur Feb 9, 2021
5e60fce
Revert "Add FW dump with new SAI implementation (#1338)" (#1407)
deran1980 Feb 9, 2021
f39d32f
Import 'mock' module from 'unittest' library (#1415)
jleveque Feb 10, 2021
11cef6a
[GitHub] Tweak PR and issue templates (#1419)
jleveque Feb 10, 2021
058ae7f
[ci] Test and build package using Azure Pipelines (#1406)
jleveque Feb 10, 2021
cd65200
[show mux]: Sort output by intf name (#1418)
theasianpianist Feb 10, 2021
3c977ea
[multi-asic] show ip interface changes for multi asic (#1396)
arlakshm Feb 11, 2021
07045e9
Fix: initialize SonicDBConfig differently for single or multi_asic (c…
qiluo-msft Feb 11, 2021
4e68a2e
Fix deprecation warnings (#1423)
jleveque Feb 12, 2021
e2d342c
[storyteller] sort output by time and improve lag support (#1430)
yxieca Feb 12, 2021
b25cc42
[ci]: download from sonic-buildimage.vs artifact (#1428)
lguohan Feb 12, 2021
ee540be
[consutil] Look for udevprefix.conf file under platform dir, not plug…
jleveque Feb 13, 2021
d856bda
[decode-syseeprom] Refactor to utilize sonic-platform package (#1435)
jleveque Feb 16, 2021
1b7c338
[psuutil] Refactor to utilize sonic-platform package (#1434)
jleveque Feb 16, 2021
1bc647f
[show] Issue in CLI output alignment with shorter alias names in intf…
maulik-marvell Feb 16, 2021
d70bdab
[config] Prevent deleting VLAN with IP addresses. (#1429)
d-dashkov Feb 16, 2021
c72acb9
Add new cli for SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS count…
ayurkiv-nvda Feb 17, 2021
a5ffbe7
[sfpshow] Cleanup (#1405)
jleveque Feb 18, 2021
0926b11
[sfputil] Refactor to utilize sonic-platform package (#1421)
jleveque Feb 18, 2021
9d7c287
Refactor neighbor_advertiser script and use mock for testing (#1427)
sumukhatv Feb 19, 2021
23e12b6
[ci] No longer pass '--privileged' option to slave container (#1446)
jleveque Feb 19, 2021
4b437f0
Added CLI reference for buffer-pool watermark|persistent-watermark co…
maulik-marvell Feb 20, 2021
730272e
Update SonicDBConfig APIs for centralize_database (#1441)
vaibhavhd Feb 22, 2021
71fd13b
[doc] Add documentation for console feature switch (#1456)
Blueve Feb 23, 2021
15c2a68
[dpb|config] Fix the validation logic of breakout mode (#1440)
Feb 23, 2021
cdeed27
[decode-syseeprom] Refactor use of swsscommon; Add unit tests (#1444)
jleveque Feb 24, 2021
e373c46
[vlan] Vlan deletion is not allowed when there are members assigned t…
deran1980 Feb 24, 2021
1a97a3f
[route_check]: Dropped redundant code. (#1463)
renukamanavalan Feb 25, 2021
ed5c3b9
[Mellanox] Add support for SN4600 system (#1462)
DavidZagury Feb 25, 2021
402e8a3
[generate_dump] allow to extend dump with plugin scripts. (#1335)
stepanblyschak Feb 25, 2021
2dc94a8
[show] cli support for show muxcable cableinfo (#1448)
vdahiya12 Feb 25, 2021
e862fc5
[psushow] Add more output columns; Add option to output in JSON forma…
jleveque Feb 25, 2021
5a9913d
[CLI][techsupport] Add NOOP option for commands that did not have tha…
smaheshm Feb 25, 2021
b678e49
[reboot] Add platform-specific reboot cause update hook (#1454)
rkdevi27 Feb 28, 2021
4c74ef4
[reload] Improve reload by using sonic.target. (#1199)
stepanblyschak Mar 1, 2021
9259878
Add soft-reboot reboot type (#1453)
sujinmkang Mar 2, 2021
949763d
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
7f08480
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
f58b5c4
Config reload enhancements. Support for running the command in backgr…
anand-kumar-subramanian Dec 4, 2020
ee855c6
Added -b option for config reload command to run in background mode
anand-kumar-subramanian Mar 2, 2021
6645942
Merge branch 'master' into config-reload-enhancements
anand-kumar-subramanian Mar 2, 2021
bc4e8b7
Update config_test.py
anand-kumar-subramanian Mar 2, 2021
3016fc0
Update main.py
anand-kumar-subramanian Mar 2, 2021
f532b4f
Update main.py
anand-kumar-subramanian Mar 2, 2021
d9eaad0
Update main.py
anand-kumar-subramanian Mar 2, 2021
bf91bc3
Update main.py
anand-kumar-subramanian Mar 2, 2021
00492a5
Update main.py
anand-kumar-subramanian Mar 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 10 additions & 25 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
CFG_LOOPBACK_NAME_TOTAL_LEN_MAX = 11
CFG_LOOPBACK_ID_MAX_VAL = 999
CFG_LOOPBACK_NO="<0-999>"
PIPE_FILE = "/tmp/reload.txt"
RELOAD_PIPE_FILE = "/tmp/reload.txt"


asic_type = None
Expand Down Expand Up @@ -1014,21 +1014,9 @@ def handle_signal(signum, frame):
os.kill(child_pid, signal.SIGTERM)
sys.exit()

def ignore_signal(signum, frame):
infd = open(os.devnull, 'r')
os.dup2(infd.fileno(), sys.stdin.fileno())

outfd = open(PIPE_FILE, 'a+')
os.dup2(outfd.fileno(), sys.stderr.fileno())
os.dup2(outfd.fileno(), sys.stdout.fileno())

cmd = "command execution is continued, received signal {}".format(signum)
log.log_info(cmd)
return

# tail the output of reload command
def config_reload_log_thread(pid, outfd):
os.system("tail -f --pid={} {}".format(pid, PIPE_FILE))
os.system("tail -f --pid={} {}".format(pid, RELOAD_PIPE_FILE))

@config.command()
@click.option('-y', '--yes', is_flag=True)
Expand All @@ -1048,9 +1036,6 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart):
if not yes:
click.confirm(message, abort=True)

global child_pid
global PIPE_FILE

num_asic = multi_asic.get_num_asics()
cfg_files = []

Expand All @@ -1066,9 +1051,9 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart):
click.echo("Input {} config file(s) separated by comma for multiple files ".format(num_cfg_file))
return

if os.path.isfile(PIPE_FILE):
os.remove(PIPE_FILE)
outfd = open(PIPE_FILE, 'w+')
if os.path.isfile(RELOAD_PIPE_FILE):
os.remove(RELOAD_PIPE_FILE)
outfd = open(RELOAD_PIPE_FILE, 'w+')

child_pid=os.fork()
# Parent: wait for child to exit
Expand All @@ -1080,8 +1065,8 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart):
thread_service_event = threading.Thread(target=config_reload_log_thread, name='reload', args=(child_pid, outfd,))
thread_service_event.start()
pid, status = os.waitpid(child_pid, 0)
if os.path.isfile(PIPE_FILE):
os.remove(PIPE_FILE)
if os.path.isfile(RELOAD_PIPE_FILE):
os.remove(RELOAD_PIPE_FILE)
thread_service_event.join()
if pid:
sys.exit(status >> 8)
Expand All @@ -1105,7 +1090,7 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart):
if err:
click.echo("Could not get the HWSKU from config file, exiting")
log.log_error("Could not get the HWSKU from config file, exiting, err: {}".format(err))
os.remove(PIPE_FILE)
os.remove(RELOAD_PIPE_FILE)
sys.exit(1)
else:
cfg_hwsku = cfg_hwsku.strip()
Expand Down Expand Up @@ -1205,8 +1190,8 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart):
log.log_error("'reload' failed, error: {}".format(e))
rv = 1

if os.path.isfile(PIPE_FILE):
os.remove(PIPE_FILE)
if os.path.isfile(RELOAD_PIPE_FILE):
os.remove(RELOAD_PIPE_FILE)

if rv != 0:
click.echo('Error encountered while starting one or more services.')
Expand Down