Commit Graph

3676 Commits

Author SHA1 Message Date
Joe LeVeque
1587889b7a
[caclmgrd] remove default DROP rule on FORWARD chain (#5034) 2020-07-24 11:59:46 -07:00
isabelmsft
55d3ecd267
Update Kubernetes and kubernetes-cni versions (#5024)
This PR updates kubernetes version to 1.18.6 and kubernetes-cni version to 0.8.6

signed-off by: Isabel Li isabel.li@microsoft.com

Why I did it
Previous kubernetes-cni version (0.7.5) introduced Kubernetes Man In The Middle Vulnerability. “A vulnerability was found in all versions of containernetworking/plugins before version 0.8.6, that allows malicious containers in Kubernetes clusters to perform man-in-the-middle (MitM) attacks. A malicious container can exploit this flaw by sending rogue IPv6 router advertisements to the host or other containers, to redirect traffic to the malicious container.”

How I did it
Defined kubernetes-cni version to be 0.8.6 and updated kubernetes version to be 1.18.6

How to verify it
Check versions by running dpkg -l | grep kube
2020-07-24 10:14:24 -07:00
Andriy Kokhan
c4748e8fb7
[bfn] Updated SDK packages to SAI v1.6.4 (#5021)
* Update SDK packages to SAI 1.6.4
* Add SAI_SWITCH_TYPE_NPU attribute support

Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
2020-07-23 12:47:02 -07:00
shlomibitton
bbb91715a8
[Mellanox] Change fan tolerance to 50% (#5018)
Mellanox platforms fan tolerance should change to 50%

Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
2020-07-23 11:18:26 -07:00
Joe LeVeque
639ad1895d
[sonic-utilities] Update submodule (#5023)
* src/sonic-utilities 82dfe50...995cf39 (1):
  > [config] Restart telemetry service upon config (re)load (#992)
2020-07-23 00:42:23 -07:00
shi-su
adacf1addd
[sonic-swss-common] Update submodule (#5020)
Update the sonic-swss-common submodule. The following are the commits in the submodule.

Fix sai api loglevel
ed9c497316e73bc5d4a6dfbe9f3507d5e92c15f3

Add support for attribute capability query in lua script
f58ea1e7a692eadd8695b4dcf89290c5e9018aae

Copp changes
4e50be7728d1e68582ac4dc369323ec5ab7b81dd

fix pytest for python3
c76d3b3a6dacae7fde14622c41e41b717876924a

use sysconfig instead of distutils.sysconfig
1772581f9b9f25e5ab2b790d7d517ea2b2010a78

CONFIG_DB table name for BUM Storm-control feature
c39c958bea445e650353651fcbae5c228114f86d

Fine Grained ECMP schema changes
1974d2e1547464a3b0279b5d63fc40eda94fa780
2020-07-22 22:00:20 -07:00
Joe LeVeque
2890670de2
[sonic-telemetry][sonic-mgmt-common] Update submodules (#4986)
* src/sonic-telemetry fa8d498...3bd7ca3 (4):
  > Update gnmi deps (#40)
  > [testdata] Update SFP keys to align with new standard (#39)
  > Fixed the parameters for subscribe APIs (#38)
  > Azure ro mode (#34)

* src/sonic-mgmt-common 444aa9a...cc01ce4 (4):
  > Make gnmi dep version the same as in telemetry repo (#17)
  > Cleanup translib and cvl go test cases (#13)
  > Package update and enhancements/fixes in YGOT, and Request Binder (#12)
  > Translib phase I changes (#11)

Note: sonic-telemetry submodule update is dependent upon sonic-mgmt-common submodule update, thus updating both in this patch
2020-07-22 11:51:15 -07:00
Kebo Liu
f3091c91a6
[Mellanox] remove code which instructs hw-mgmt to skip mlsw_minimal probing in fast-boot flow (#5011) 2020-07-22 12:21:11 +03:00
anish-n
da017f4ec9
[bgpcfgd]: Add Vlan prefix list to the FRR templates (#5005)
add the Vlan prefix list to the FRR templates
2020-07-21 19:26:19 -07:00
Aravind Mani
f72aaf3463
DellEMC S6100: Add script files to executable directory (#5012) 2020-07-21 19:25:24 -07:00
Sangita Maity
ebdfb4bef1
Enable DPB dependency check using YANG model in VS container (#45) (#4990)
Added required packages to enabled YANG dependency check for Dynamic Port Breakout in VS container.

[sonic-utilities PR #766](https://github.com/Azure/sonic-utilities/pull/766) has a dependency on it.
Getting error like the following without this fix: `ImportError: No module named yang - required module not found`

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
2020-07-21 10:33:43 -07:00
lguohan
1870c181c5
Update PULL_REQUEST_TEMPLATE.md 2020-07-21 03:05:00 -07:00
anish-n
07d559103f
[bgpcfgd]: Add fix to bgpcfgd to ignore NEIGHBOR_METADATA entries for dynamic peers (#5008)
This fix removes the requirement to have a NEIGHBOR_METADATA for dynamic peers. The change is made since it is not necessary for NEIGHBOR_METADATA entries be present for the dynamic neighbors
2020-07-21 02:55:42 -07:00
Joe LeVeque
43b5832e0c
[sudoers] Add sonic-installer list to read-only commands (#4996)
`sonic-installer list` is a read-only command. Specify it as such in the sudoers file.

This will also ensure the new `show boot` command, which calls `sudo sonic-installer list` under the hood doesn't fail due to permissions.
2020-07-20 11:23:05 -07:00
Joe LeVeque
6ef199ffdd
[sonic-utilities] Update submodule (#5004)
* src/sonic-utilities a23479e...82dfe50 (3):
  > [sonic-installer] Update group name for 'verify-next-image' subcommand (#/995)
  > [acl_loader] Fix bugs in acl_loader (#991)
  > [show] Add support for QSFP-DD cables on 'show' command (#989)

This submodule update resolves https://github.com/Azure/sonic-utilities/issues/997 by including PR https://github.com/Azure/sonic-utilities/pull/995
2020-07-20 11:21:24 -07:00
Volodymyr Boiko
52c3a238bb
[barefoot][platform] increase init timeout in eeprom.py (#5006)
Because of platform-specific reasons I have to increase init timeout in (platform-plugin)/eeprom.py
2020-07-20 11:11:51 -07:00
lguohan
c6027ab46f
[submodule]: update sonic-swss (#5002)
* d2bab10 2020-07-19 | [vstest]: use BytesIO for file operations [lguohan]
* 982c9a3 2020-07-18 | [vstest]: fix vstest for python3 (#1354) [lguohan]
* ffa0dc3 2020-07-16 | [vstest]: clean up processes in server namespace at start (#1353) [lguohan]
* b16368c 2020-07-15 | [aclorch.cpp] Handle all the ACL redirect requests in AclRuleL3::validateAddAction()  (#1278) [madhanmellanox]
* 310e0aa 2020-07-15 | [portsorch,intfsorch] add port, rif rates FC groups (#1201) [Mykola F]
* 5ddea37 2020-07-09 |  [NAT]: Update NAT conntrack entries from natmgr instead of natorch (#1274) [Akhilesh Samineni]
* 94c622f 2020-07-07 | [aclorch] Use IPv6 Next Header internally for protocol number on MLNX platform (#1343) [Danny Allen]
*   82d36c4 2020-07-07 | support swss vstest in python3 [lguohan]
|\
| * ff04e6d 2020-06-27 | [doc]: update instruction to run vstest under python3 [Guohan Lu]
| * c90b281 2020-07-05 | [vstest]: reuse dvs setReadOnlyAttr in test_crm.py [Guohan Lu]
| * 8807b40 2020-07-05 | [vstest]: fix string format compatibility issue for python2 and swig [Guohan Lu]
| * 26efbcf 2020-07-04 | [vstest]: change float division to integer division [Guohan Lu]
| * 6adaf2e 2020-07-04 | [vstest]: change time.clock() to time.time() [Guohan Lu]
| * 9c71203 2020-07-04 | [vstest]: let redis decodes the response to be string instead of bytes [Guohan Lu]
| * c7c63ee 2020-06-27 | [vstest]: change from platform to distro [Guohan Lu]
| * d7ff1ad 2020-06-27 | [vstest]: upgrade swss vs tests to python3 [Guohan Lu]
* | 2ebd44e 2020-07-03 | [sonic-swss] ARMHF warning fixes (#1325) [arheneus@marvell.com]
* | 10ad70c 2020-07-02 | [swss] Add support for gearbox phys (#1321) [Syd Logan]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-07-20 02:59:55 -07:00
Stepan Blyshchak
5d753b8d43
[services] remove swss from WantedBy for nat service (#4991)
Otherwise, it may cause issues for warm restarts, warm reboot.
Warm restart of swss will start nat which is not expected for warm
restart. Also it is observed that during warm-reboot script execution
nat container gets started after it was killed. This causes removal of
nat dump generated by nat previously:

A check [ -f /host/warmboot/nat/nat_entries.dump ] || echo "NAT dump
does not exists" was added right before kexec:

```
Fri Jul 17 10:47:16 UTC 2020 Prepare MLNX ASIC to fastfast-reboot:
install new FW if required
Fri Jul 17 10:47:18 UTC 2020 Pausing orchagent ...
Fri Jul 17 10:47:18 UTC 2020 Stopping nat ...
Fri Jul 17 10:47:18 UTC 2020 Stopped nat ...
Fri Jul 17 10:47:18 UTC 2020 Stopping radv ...
Fri Jul 17 10:47:19 UTC 2020 Stopping bgp ...
Fri Jul 17 10:47:19 UTC 2020 Stopped bgp ...
Fri Jul 17 10:47:21 UTC 2020 Initialize pre-shutdown ...
Fri Jul 17 10:47:21 UTC 2020 Requesting pre-shutdown ...
Fri Jul 17 10:47:22 UTC 2020 Waiting for pre-shutdown ...
Fri Jul 17 10:47:24 UTC 2020 Pre-shutdown succeeded ...
Fri Jul 17 10:47:24 UTC 2020 Backing up database ...
Fri Jul 17 10:47:25 UTC 2020 Stopping teamd ...
Fri Jul 17 10:47:25 UTC 2020 Stopped teamd ...
Fri Jul 17 10:47:25 UTC 2020 Stopping syncd ...
Fri Jul 17 10:47:35 UTC 2020 Stopped syncd ...
Fri Jul 17 10:47:35 UTC 2020 Stopping all remaining containers ...
Warning: Stopping telemetry.service, but it can still be activated by:
  telemetry.timer
Fri Jul 17 10:47:37 UTC 2020 Stopped all remaining containers ...
NAT dump does not exists
Fri Jul 17 10:47:39 UTC 2020 Rebooting with /sbin/kexec -e to
SONiC-OS-201911.140-08245093 ...
```

With this change, executed warm-reboot 10 times without hitting this
issue, while without this change the issue is easily reproducible almost
every warm-reboot run.

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
2020-07-19 21:50:26 -07:00
vdahiya12
c9983df062
[daemon_base] fix to not reregister signal handler (#4998)
* [daemon_base] fix to not reregister signal handler

-src/sonic-daemon-base/sonic_daemon_base/daemon_base.py
Problem:
Currently all daemons inherit from daemon_base class, and for
signal handling functionality they register the signal_handler() by
overriding the siganl_handler() in daemon_base by their own
implmentation.
But some sonic_platform instances also can invoke the daemon_base
constructor while trying to instantiate the common utilities
for example
platform_chassis = sonic_platform.platform.Platform().get_chassis()
This will cause the re registration of signal_handler which will
cause base class signal_handler() to be invoked when the daemon
gets a signal, whereas their own signal_handler should have been
invoked.

Fix:
We only register the siganl_handler once, and if signal_handler has
been registered, not re register it.

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

* [daemon_base] fix to not reregister signal handler

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
2020-07-19 20:58:52 -07:00
Guohan Lu
aa9e1e2f43 [vstest]: convert the tests to python3
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-07-19 03:39:49 +00:00
ciju-juniper
b3ae7858ca
[Juniper][QFX5200] Adding qos.json (#4982)
Adding buffers.json.j2, buffers_defaults_t1.j2 and
qos.json.j2 for qfx5200 platform.

Signed-off-by: Ciju Rajan K <crajank@juniper.net>
2020-07-18 04:52:05 -07:00
Stepan Blyshchak
16a37d8c17
[dockers] update mellanox syncd and pmon to buster (#4818)
Upgrade to libsensors5

Updated sonic-sairedis pointer:
    d54bfb4 [SAI] update pointer (#636)
    1885a8c [syncd] Fix notification on shutdown request (#635)
    9e57ba2 Fixing hostif For Genetlink host interfaces (#633)
    449a092 sonic-sairedis: Add support to sonic-sairedis for gearbox phys (#632)

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
2020-07-18 03:46:15 -07:00
joyas-joseph
78945766fc
[docker-iccpd]: Upgrade docker-iccpd to buster (#4984)
Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
2020-07-18 00:12:59 -07:00
lguohan
25c3900085
[docker-sonic-vs]: upgrade docker-sonic-vs to buster (#4979)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-07-18 00:11:09 -07:00
Nazarii Hnydyn
a3f4c31193
[orchagent]: Fix platform string export. (#4993)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
2020-07-18 00:05:10 -07:00
Samuel Angebault
d8a79bc71e
[secureboot] Fix some installation behavior for secureboot (#4980) 2020-07-17 15:07:12 -07:00
Joe LeVeque
04615ca98c
[sonic-snmpagent][sonic-py-swsssdk] Update submodules (#4968)
* src/sonic-snmpagent 89b7b2c...c702a57 (7):
  > Revert "[rfc1213] Interface MIB add l3 vlan interfaces & aggregate rif counters (#133)" (#151)
  > Update transceiver info DB key names (#146)
  > Fix LGTM reported alert of PR#141 (#142)
  > [Namespace] Fix interfaces counters in InterfacesMIB RFC 2863 (#141)
  > [Namespace]: Fix SNMP AgentX  socket connection timeout when using Namespace.get_all()  (#140)
  > [rfc1213] Interface MIB add l3 vlan interfaces & aggregate rif counters (#133)
  > Fix undefined variable and warning message (#134)

* src/sonic-py-swsssdk a83366e...2df4f40 (3):
  > Allowing TCP connections with namespace as well. (#81)
  > [port_util] add get_rif_port_map, get_vlan_interface_oid_map (#78)
  > Updates to the namespace API's for test_moduleLoad.py (#77)

Note that sonic-snmpagent submodule update is dependent upon sonic-py-swsssdk update, so updating both submodules in this PR.
2020-07-17 11:20:39 -07:00
Joe LeVeque
d6925499f1
[caclmgrd] Filter DHCP packets based on dest port only (#4995) 2020-07-17 11:16:19 -07:00
lguohan
458b4aef48
[vstest]: remove kill exabgp command from the test (#4978)
the command kills all exabgp processes on the host.
since the namespaces are newly added, there should
be no prior exabgp processes.

if it is existing namespace, it is also the dvs
framework job to clean up all prior processes.
2020-07-16 17:19:21 -07:00
Joe LeVeque
9905d9382d
[devices] Update SFP keys to align with new standard (#4975)
Align SFP key names with new standard defined in https://github.com/Azure/sonic-platform-common/pull/97

- hardwarerev -> hardware_rev
- serialnum -> serial
- manufacturename -> manufacturer
- modelname -> model
- Connector -> connector
2020-07-16 13:03:50 -07:00
joyas-joseph
18bfa6df08
[docker-nat]: upgrade docker-nat to buster (#4943)
move iptables to 1.8.2-4 (version in buster)

Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
2020-07-15 22:48:09 -07:00
taochengyi
1ca47da40d
[build][arm] Adding a backport source to arm to resolve docker-base-stretch install redis-tools=5:5.0.3-3~bpo9+2 failure issue (#4950) 2020-07-15 12:23:20 -07:00
yozhao101
83738fca2f
[dockers] Default container autorestart feature to "enabled" for all except database (#4853)
Set the default auto_restart state to "enabled" in init_cfg.json for all containers except database

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
2020-07-15 11:49:14 -07:00
heidinet2007
de51b9e424
BGP warm reboot script to service (#3992)
* [sonic-buildimage] Move BGP warm reboot scripts into BGP service /usr/local/bin

* Revert "[sonic-buildimage] Move BGP warm reboot scripts into BGP service /usr/local/bin"

This reverts commit d16d163fc4.

* [sonic-buildimage] Move BGP warm reboot script to BGP service

* [sonic-buildimage] Move BGP warm reboot script to BGP service

* [sonic-buildimage] Move BGP warm reboot script to BGP service
- access DB correctly

* Address code review comments, also change file mode of bgp.sh (+x)

* Address code review comments, also change the file mode of bgp.sh (+x)

* BGP warm reboot script to service, also handle fast boot as indicated by flag saved in StateDB

* BGP warm reboot script to service, code review comments on space alignment

* BGP warm reboot script to service: remove uncesseary space

* BGP warm reboot script to service: replace tab with space

* Code review comments: -) use new multi-db api -) add ignore error from zebra in case it's not configured

* Integrate with multi-ASIC changes committed recently

Co-authored-by: heidi.ou@alibaba-inc.com <heidi.ou@alibaba-inc.com>
2020-07-15 11:46:23 -07:00
shlomibitton
545fe3ecd0
Add support for QSFP-DD cables on MLNX platform API (#4965)
Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
2020-07-15 11:09:46 -07:00
madhanmellanox
ade634090d
[caclmgrd] Log error message if IPv4 ACL table contains IPv6 rule and vice-versa (#4498)
* Defect 2082949: Handling Control Plane ACLs so that IPv4 rules and IPv6 rules are not added to the same ACL table

* Previous code review comments of coming up with functions for is_ipv4_rule and is_ipv6_rule is addressed and also raising Exceptions instead of simply aborting when the conflict occurs is handled

* Addressed code review comment to replace duplicate code with already existing functions

* removed raising Exception when rule conflict in Control plane ACLs are found

* added code to remove the rule_props if it is conflicting ACL table versioning rule

* addressed review comment to add ignoring rule in the error statement

Co-authored-by: Madhan Babu <madhan@arc-build-server.mtr.labs.mlnx>
2020-07-15 20:24:44 +03:00
Sangita Maity
6ebcfb226b
[docker-vs] Install dependencies for testing DPB (#4960)
Added xmltodict and jsondiff packages needed to run vs test cases successfully for DPB.
sonic-utilities PR #766 has a dependency on these packages.

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
2020-07-14 15:52:03 -07:00
Tamer Ahmed
5f3c4fac4b
[docker-orchagent] Call sonic-cfggen Once (#4936)
Optimizing number of calls made to sonic-cfggen during service
start up as it adds to total system boot up time.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>

**- Why I did it**
sonic-cfggen call is slow and it adds to system start up time

**- How I did it**
places all required variable into single template and called into sonic-cfggen using this template

**- How to verify it**
***-Test 1***
there is an average saving of .5 to 1 sec between old script and new script
```
root@str-s6000-acs-14:/# time ./orchagent_old.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m3.546s
user	0m2.365s
sys	0m0.585s

root@str-s6000-acs-14:/# time ./orchagent_new.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m2.058s
user	0m1.650s
sys	0m0.363s
```
***-Test 2***
Built an image with this change and orchagent is running with intended params:
```
admin@str-s6000-acs-14:~$ ps -ef | grep orchagent
root      2988  1901  1 02:09 pts/0    00:00:02 /usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d
```

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
2020-07-14 15:36:47 -07:00
rkdevi27
df740b3653
[baseimage]: /host unmount failed in VM during reboot (#4865)
Added a check further to make the services to stop appropriately before unmount.

Fix #4651
2020-07-14 15:34:19 -07:00
ciju-juniper
46cc6968d7
[Juniper][QFX52xx] Platform fixes/enhancements (#4953)
1) Fixing the issues while applying platform TxCTLE settings in sfputil.py for QFX5200
 2) Adding the support for transceiver dom threshold info in sfputil.py for both  QFX5210 & QFX5200 platforms
 3) Updating the sfputil.py for QFX5210 & QFX5200 platforms
4) Adding a new platform specific command 'show_thresholds' to display the FAN dutycycle percentage for various temperature ranges (for both AFI & AFO QFX5200 systems).

Signed-off-by: Ciju Rajan K <crajank@juniper.net>
2020-07-14 14:20:41 -07:00
Joe LeVeque
f929b00eaa
[sonic-utilities] Update submodule (#4963)
* src/sonic-utilities 9715244...a23479e (7):
  > [sonic-installer] Hyphens instead of underscores in command and subcommands (#983)
  >  Fix the None Type Exception when Interface Table does not exist (cold boot) as part of db migration (#986)
  > Support to verify reboot for secure boot (#979)
  > [filter-fdb] Fix For Vlan Defined With No CIDR (#976)
  > Intf table migration for APP_DB entries during warmboot (#980)
  > Enable HW watchdog before fast-reboot (#977)
  > [Multi NPU] Time Improvements to the config reload/load_minigraph commands  (#917)
2020-07-14 11:56:54 -07:00
taochengyi
de16e6f14d
[build][centec] update sai to v1.6.3 (#4951)
update sai to v1.6.3 for centec E582 platform(x86 CPU)
2020-07-13 22:56:42 -07:00
Sujin Kang
bf45e11d27
Add pcie-check service to check PCIe devices at boot (#4771)
* PCIe Monitor service

* Add rescan to pcie-mon.service when it fails to get all pcie devices

* space

* Clean up

* review comments

* update the pcie status in state db

* update the failed pcie status once at the end

* Update the pcie_status in STATE_DB and rename the service

* Add log to exit the service if the configuration file doesn't exist.

* fix the build failure

* Redo the pcie rescan for pcie-check failed case.

* review comments

* review comments

* review comments
2020-07-13 14:15:09 -07:00
Junchao-Mellanox
76d68ad1f5
[Mellanox] Add support for set/get system led status (#4829)
System health feature needs to set/get system led status

- Add a led object in chassis class and initialize it when the API is called on host side
- Read/write system led system fs to get/set the status
2020-07-13 10:22:39 -07:00
Junchao-Mellanox
e1f7fb135b
[Mellanox] Add system health configuration file for Mellanox platforms (#4834)
The new feature system health support a platform based configuration file. Add configuration files for all Mellanox platform.

Add a configuration file for SN2700, other platform will use a soft link to it.
2020-07-13 10:20:22 -07:00
Volodymyr Boiko
39941f0ae2 [BFN] Update SAI and platform packages to 20200710 (#4942)
Barefoot, updated SAI and platform packages to 20200710

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2020-07-12 18:08:52 +00:00
Prince Sunny
a0236f7cbb [bgpcfgd] - Fix a key error during delete (#4946) 2020-07-12 18:08:52 +00:00
joyas-joseph
71e93d921c [docker-team]: upgrade docker-teamd to buster (#4914)
Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
2020-07-12 18:08:52 +00:00
Stephen Sun
0db05e35b0 [watermark] Fix error: BUFFER_POOL_WATERMARK isn't enabled by default (#4882)
* Fix error: watermarkstat -t buffer_pool doesn't work

Signed-off-by: Stephen Sun <stephens@mellanox.com>
2020-07-12 18:08:52 +00:00
Tamer Ahmed
3197c2dfac [mgmt-framework] Call sonic-cfggen Once (#4937)
Optimizing number of calls made to sonic-cfggen during service
start up as it adds to total system boot up time.

***-Test 1***
there is an average saving of 1 to 1.5 sec between old script and new script
```
root@str-s6000-acs-14:/# time /usr/bin/rest-server-old.sh
Generating temporary TLS server certificate ...
2020/07/09 19:03:33 wrote cert.pem
2020/07/09 19:03:33 wrote key.pem
REST_SERVER_ARGS = -ui /rest_ui -logtostderr -cert /tmp/cert.pem -key /tmp/key.pem
/usr/sbin/rest_server -ui /rest_ui -logtostderr -cert /tmp/cert.pem -key /tmp/key.pem

real	0m8.790s
user	0m7.993s
sys	0m0.584s
root@str-s6000-acs-14:/# time /usr/bin/rest-server-new.sh
Generating temporary TLS server certificate ...
2020/07/09 19:03:45 wrote cert.pem
2020/07/09 19:03:45 wrote key.pem
REST_SERVER_ARGS = -ui /rest_ui -logtostderr -cert /tmp/cert.pem -key /tmp/key.pem
/usr/sbin/rest_server -ui /rest_ui -logtostderr -cert /tmp/cert.pem -key /tmp/key.pem

real	0m6.940s
user	0m5.670s
sys	0m0.386s
```
***-Test 2***
Built an image with this change and rest server is running with params as described in test 1 above
```
admin@str-s6000-acs-14:~$ ps -ef | grep rest_server
root      3301  2866  2 02:09 pts/0    00:00:10 /usr/sbin/rest_server -ui /rest_ui -logtostderr -cert /tmp/cert.pem -key /tmp/key.pem

```

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
2020-07-12 18:08:52 +00:00