diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers.json.j2
new file mode 120000
index 00000000000..117d740b0f5
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers.json.j2
@@ -0,0 +1 @@
+../ACS-MSN4600C/buffers.json.j2
\ No newline at end of file
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2
new file mode 100644
index 00000000000..ab9cdd8c00c
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2
@@ -0,0 +1,98 @@
+{% set default_cable = '5m' %}
+{% set ingress_lossless_pool_size = '57499648' %}
+{% set egress_lossless_pool_size = '60817392' %}
+{% set egress_lossy_pool_size = '57499648' %}
+
+{%- macro generate_port_lists(PORT_ALL) %}
+ {# Generate list of ports #}
+ {%- for port_idx in range(0, 32) %}
+ {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
+ {%- endfor %}
+{%- endmacro %}
+
+{%- macro generate_buffer_pool_and_profiles() %}
+ "BUFFER_POOL": {
+ "ingress_lossless_pool": {
+ "size": "{{ ingress_lossless_pool_size }}",
+ "type": "ingress",
+ "mode": "dynamic"
+ },
+ "egress_lossless_pool": {
+ "size": "{{ egress_lossless_pool_size }}",
+ "type": "egress",
+ "mode": "dynamic"
+ },
+ "egress_lossy_pool": {
+ "size": "{{ egress_lossy_pool_size }}",
+ "type": "egress",
+ "mode": "dynamic"
+ }
+ },
+ "BUFFER_PROFILE": {
+ "ingress_lossless_profile": {
+ "pool":"[BUFFER_POOL|ingress_lossless_pool]",
+ "size":"0",
+ "dynamic_th":"7"
+ },
+ "ingress_lossy_profile": {
+ "pool":"[BUFFER_POOL|ingress_lossy_pool]",
+ "size":"0",
+ "dynamic_th":"3"
+ },
+ "egress_lossless_profile": {
+ "pool":"[BUFFER_POOL|egress_lossless_pool]",
+ "size":"0",
+ "dynamic_th":"7"
+ },
+ "egress_lossy_profile": {
+ "pool":"[BUFFER_POOL|egress_lossy_pool]",
+ "size":"4096",
+ "dynamic_th":"7"
+ },
+ "q_lossy_profile": {
+ "pool":"[BUFFER_POOL|egress_lossy_pool]",
+ "size":"0",
+ "dynamic_th":"3"
+ }
+ },
+{%- endmacro %}
+
+{%- macro generate_profile_lists(port_names) %}
+ "BUFFER_PORT_INGRESS_PROFILE_LIST": {
+{% for port in port_names.split(',') %}
+ "{{ port }}": {
+ "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ },
+ "BUFFER_PORT_EGRESS_PROFILE_LIST": {
+{% for port in port_names.split(',') %}
+ "{{ port }}": {
+ "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ }
+{%- endmacro %}
+
+{%- macro generate_queue_buffers(port_names) %}
+ "BUFFER_QUEUE": {
+{% for port in port_names.split(',') %}
+ "{{ port }}|3-4": {
+ "profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
+ },
+{% endfor %}
+{% for port in port_names.split(',') %}
+ "{{ port }}|0-2": {
+ "profile" : "[BUFFER_PROFILE|q_lossy_profile]"
+ },
+{% endfor %}
+{% for port in port_names.split(',') %}
+ "{{ port }}|5-6": {
+ "profile" : "[BUFFER_PROFILE|q_lossy_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ }
+{%- endmacro %}
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2
new file mode 100644
index 00000000000..d47117501be
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2
@@ -0,0 +1,98 @@
+{% set default_cable = '5m' %}
+{% set ingress_lossless_pool_size = '52363264' %}
+{% set egress_lossless_pool_size = '60817392' %}
+{% set egress_lossy_pool_size = '52363264' %}
+
+{%- macro generate_port_lists(PORT_ALL) %}
+ {# Generate list of ports #}
+ {%- for port_idx in range(0, 32) %}
+ {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
+ {%- endfor %}
+{%- endmacro %}
+
+{%- macro generate_buffer_pool_and_profiles() %}
+ "BUFFER_POOL": {
+ "ingress_lossless_pool": {
+ "size": "{{ ingress_lossless_pool_size }}",
+ "type": "ingress",
+ "mode": "dynamic"
+ },
+ "egress_lossless_pool": {
+ "size": "{{ egress_lossless_pool_size }}",
+ "type": "egress",
+ "mode": "dynamic"
+ },
+ "egress_lossy_pool": {
+ "size": "{{ egress_lossy_pool_size }}",
+ "type": "egress",
+ "mode": "dynamic"
+ }
+ },
+ "BUFFER_PROFILE": {
+ "ingress_lossless_profile": {
+ "pool":"[BUFFER_POOL|ingress_lossless_pool]",
+ "size":"0",
+ "dynamic_th":"7"
+ },
+ "ingress_lossy_profile": {
+ "pool":"[BUFFER_POOL|ingress_lossy_pool]",
+ "size":"0",
+ "dynamic_th":"3"
+ },
+ "egress_lossless_profile": {
+ "pool":"[BUFFER_POOL|egress_lossless_pool]",
+ "size":"0",
+ "dynamic_th":"7"
+ },
+ "egress_lossy_profile": {
+ "pool":"[BUFFER_POOL|egress_lossy_pool]",
+ "size":"4096",
+ "dynamic_th":"7"
+ },
+ "q_lossy_profile": {
+ "pool":"[BUFFER_POOL|egress_lossy_pool]",
+ "size":"0",
+ "dynamic_th":"3"
+ }
+ },
+{%- endmacro %}
+
+{%- macro generate_profile_lists(port_names) %}
+ "BUFFER_PORT_INGRESS_PROFILE_LIST": {
+{% for port in port_names.split(',') %}
+ "{{ port }}": {
+ "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ },
+ "BUFFER_PORT_EGRESS_PROFILE_LIST": {
+{% for port in port_names.split(',') %}
+ "{{ port }}": {
+ "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ }
+{%- endmacro %}
+
+{%- macro generate_queue_buffers(port_names) %}
+ "BUFFER_QUEUE": {
+{% for port in port_names.split(',') %}
+ "{{ port }}|3-4": {
+ "profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
+ },
+{% endfor %}
+{% for port in port_names.split(',') %}
+ "{{ port }}|0-2": {
+ "profile" : "[BUFFER_PROFILE|q_lossy_profile]"
+ },
+{% endfor %}
+{% for port in port_names.split(',') %}
+ "{{ port }}|5-6": {
+ "profile" : "[BUFFER_PROFILE|q_lossy_profile]"
+ }{% if not loop.last %},{% endif %}
+
+{% endfor %}
+ }
+{%- endmacro %}
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini
new file mode 120000
index 00000000000..dc307e1020f
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini
@@ -0,0 +1 @@
+../ACS-MSN4600C/pg_profile_lookup.ini
\ No newline at end of file
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini
new file mode 100644
index 00000000000..eb4cdc35637
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini
@@ -0,0 +1,105 @@
+# name lanes alias index speed fec
+Ethernet0 0,1 etp1a 1 50000 none
+Ethernet2 2,3 etp1b 1 50000 none
+Ethernet8 8,9 etp2a 2 50000 none
+Ethernet10 10,11 etp2b 2 50000 none
+Ethernet16 16,17 etp3a 3 50000 none
+Ethernet18 18,19 etp3b 3 50000 none
+Ethernet24 24,25,26,27 etp4 4 100000 rs
+Ethernet32 32,33 etp5a 5 50000 none
+Ethernet34 34,35 etp5b 5 50000 none
+Ethernet40 40,41 etp6a 6 50000 none
+Ethernet42 42,43 etp6b 6 50000 none
+Ethernet48 48,49 etp7a 7 50000 none
+Ethernet50 50,51 etp7b 7 50000 none
+Ethernet56 56,57,58,59 etp8 8 100000 rs
+Ethernet64 64,65 etp9a 9 50000 none
+Ethernet66 66,67 etp9b 9 50000 none
+Ethernet72 72,73 etp10a 10 50000 none
+Ethernet74 74,75 etp10b 10 50000 none
+Ethernet80 80,81 etp11a 11 50000 none
+Ethernet82 82,83 etp11b 11 50000 none
+Ethernet88 88,89,90,91 etp12 12 100000 rs
+Ethernet96 96,97 etp13a 13 50000 none
+Ethernet98 98,99 etp13b 13 50000 none
+Ethernet104 104,105 etp14a 14 50000 none
+Ethernet106 106,107 etp14b 14 50000 none
+Ethernet112 112,113 etp15a 15 50000 none
+Ethernet114 114,115 etp15b 15 50000 none
+Ethernet120 120,121,122,123 etp16 16 100000 rs
+Ethernet128 128,129 etp17a 17 50000 none
+Ethernet130 130,131 etp17b 17 50000 none
+Ethernet136 136,137 etp18a 18 50000 none
+Ethernet138 138,139 etp18b 18 50000 none
+Ethernet144 144,145 etp19a 19 50000 none
+Ethernet146 146,147 etp19b 19 50000 none
+Ethernet152 152,153,154,155 etp20 20 100000 rs
+Ethernet160 160,161 etp21a 21 50000 none
+Ethernet162 162,163 etp21b 21 50000 none
+Ethernet168 168,169 etp22a 22 50000 none
+Ethernet170 170,171 etp22b 22 50000 none
+Ethernet176 176,177 etp23a 23 50000 none
+Ethernet178 178,179 etp23b 23 50000 none
+Ethernet184 184,185,186,187 etp24 24 100000 rs
+Ethernet192 192,193,194,195 etp25 25 100000 rs
+Ethernet200 200,201,202,203 etp26 26 100000 rs
+Ethernet208 208,209 etp27a 27 50000 none
+Ethernet210 210,211 etp27b 27 50000 none
+Ethernet216 216,217,218,219 etp28 28 100000 rs
+Ethernet224 224,225,226,227 etp29 29 100000 rs
+Ethernet232 232,233,234,235 etp30 30 100000 rs
+Ethernet240 240,241 etp31a 31 50000 none
+Ethernet242 242,243 etp31b 31 50000 none
+Ethernet248 248,249,250,251 etp32 32 100000 rs
+Ethernet256 256,257,258,259 etp33 33 100000 rs
+Ethernet264 264,265,266,267 etp34 34 100000 rs
+Ethernet272 272,273 etp35a 35 50000 none
+Ethernet274 274,275 etp35b 35 50000 none
+Ethernet280 280,281,282,283 etp36 36 100000 rs
+Ethernet288 288,289,290,291 etp37 37 100000 rs
+Ethernet296 296,297,298,299 etp38 38 100000 rs
+Ethernet304 304,305 etp39a 39 50000 none
+Ethernet306 306,307 etp39b 39 50000 none
+Ethernet312 312,313,314,315 etp40 40 100000 rs
+Ethernet320 320,321 etp41a 41 50000 none
+Ethernet322 322,323 etp41b 41 50000 none
+Ethernet328 328,329 etp42a 42 50000 none
+Ethernet330 330,331 etp42b 42 50000 none
+Ethernet336 336,337 etp43a 43 50000 none
+Ethernet338 338,339 etp43b 43 50000 none
+Ethernet344 344,345,346,347 etp44 44 100000 rs
+Ethernet352 352,353 etp45a 45 50000 none
+Ethernet354 354,355 etp45b 45 50000 none
+Ethernet360 360,361 etp46a 46 50000 none
+Ethernet362 362,363 etp46b 46 50000 none
+Ethernet368 368,369 etp47a 47 50000 none
+Ethernet370 370,371 etp47b 47 50000 none
+Ethernet376 376,377,378,379 etp48 48 100000 rs
+Ethernet384 384,385 etp49a 49 50000 none
+Ethernet386 386,387 etp49b 49 50000 none
+Ethernet392 392,393 etp50a 50 50000 none
+Ethernet394 394,395 etp50b 50 50000 none
+Ethernet400 400,401 etp51a 51 50000 none
+Ethernet402 402,403 etp51b 51 50000 none
+Ethernet408 408,409,410,411 etp52 52 100000 rs
+Ethernet416 416,417 etp53a 53 50000 none
+Ethernet418 418,419 etp53b 53 50000 none
+Ethernet424 424,425 etp54a 54 50000 none
+Ethernet426 426,427 etp54b 54 50000 none
+Ethernet432 432,433 etp55a 55 50000 none
+Ethernet434 434,435 etp55b 55 50000 none
+Ethernet440 440,441,442,443 etp56 56 100000 rs
+Ethernet448 448,449 etp57a 57 50000 none
+Ethernet450 450,451 etp57b 57 50000 none
+Ethernet456 456,457 etp58a 58 50000 none
+Ethernet458 458,459 etp58b 58 50000 none
+Ethernet464 464,465 etp59a 59 50000 none
+Ethernet466 466,467 etp59b 59 50000 none
+Ethernet472 472,473,474,475 etp60 60 100000 rs
+Ethernet480 480,481 etp61a 61 50000 none
+Ethernet482 482,483 etp61b 61 50000 none
+Ethernet488 488,489 etp62a 62 50000 none
+Ethernet490 490,491 etp62b 62 50000 none
+Ethernet496 496,497 etp63a 63 50000 none
+Ethernet498 498,499 etp63b 63 50000 none
+Ethernet504 504,505,506,507 etp64 64 100000 rs
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/qos.json.j2
new file mode 120000
index 00000000000..05394016a12
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/qos.json.j2
@@ -0,0 +1 @@
+../ACS-MSN4600C/qos.json.j2
\ No newline at end of file
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile
new file mode 100644
index 00000000000..15fccb416ef
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile
@@ -0,0 +1 @@
+SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_112x50g_8x100g.xml
diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml
new file mode 100644
index 00000000000..199c251fbee
--- /dev/null
+++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml
@@ -0,0 +1,510 @@
+
+
+
+
+
+ 00:02:03:04:05:80
+
+
+ 1
+
+
+ 64
+
+
+
+
+ 105
+ 2
+ 4
+ 0
+
+
+ 3
+
+
+ 384
+
+
+ 107
+ 2
+ 4
+ 1
+ 3
+ 384
+
+
+ 109
+ 2
+ 4
+ 2
+ 3
+ 384
+
+
+ 111
+ 4
+ 3
+ 3
+ 1536
+
+
+ 97
+ 2
+ 4
+ 4
+ 3
+ 384
+
+
+ 99
+ 2
+ 4
+ 5
+ 3
+ 384
+
+
+ 101
+ 2
+ 4
+ 6
+ 3
+ 384
+
+
+ 103
+ 4
+ 7
+ 3
+ 1536
+
+
+ 121
+ 2
+ 4
+ 8
+ 3
+ 384
+
+
+ 123
+ 2
+ 4
+ 9
+ 3
+ 384
+
+
+ 125
+ 2
+ 4
+ 10
+ 3
+ 384
+
+
+ 127
+ 4
+ 11
+ 3
+ 1536
+
+
+ 113
+ 2
+ 4
+ 12
+ 3
+ 384
+
+
+ 115
+ 2
+ 4
+ 13
+ 3
+ 384
+
+
+ 117
+ 2
+ 4
+ 14
+ 3
+ 384
+
+
+ 119
+ 4
+ 15
+ 3
+ 1536
+
+
+ 89
+ 2
+ 4
+ 16
+ 3
+ 384
+
+
+ 91
+ 2
+ 4
+ 17
+ 3
+ 384
+
+
+ 93
+ 2
+ 4
+ 18
+ 3
+ 384
+
+
+ 95
+ 4
+ 19
+ 3
+ 1536
+
+
+ 81
+ 2
+ 4
+ 20
+ 3
+ 384
+
+
+ 83
+ 2
+ 4
+ 21
+ 3
+ 384
+
+
+ 85
+ 2
+ 4
+ 22
+ 3
+ 384
+
+
+ 87
+ 4
+ 23
+ 3
+ 1536
+
+
+ 73
+ 4
+ 24
+ 3
+ 1536
+
+
+ 75
+ 4
+ 25
+ 3
+ 1536
+
+
+ 77
+ 2
+ 4
+ 26
+ 3
+ 384
+
+
+ 79
+ 4
+ 27
+ 3
+ 1536
+
+
+ 65
+ 4
+ 28
+ 3
+ 1536
+
+
+ 67
+ 4
+ 29
+ 3
+ 1536
+
+
+ 69
+ 2
+ 4
+ 30
+ 3
+ 384
+
+
+ 71
+ 4
+ 31
+ 3
+ 1536
+
+
+ 5
+ 4
+ 32
+ 3
+ 1536
+
+
+ 7
+ 4
+ 33
+ 3
+ 1536
+
+
+ 1
+ 2
+ 4
+ 34
+ 3
+ 384
+
+
+ 3
+ 4
+ 35
+ 3
+ 1536
+
+
+ 13
+ 4
+ 36
+ 3
+ 1536
+
+
+ 15
+ 4
+ 37
+ 3
+ 1536
+
+
+ 9
+ 2
+ 4
+ 38
+ 3
+ 384
+
+
+ 11
+ 4
+ 39
+ 3
+ 1536
+
+
+ 21
+ 2
+ 4
+ 40
+ 3
+ 384
+
+
+ 23
+ 2
+ 4
+ 41
+ 3
+ 384
+
+
+ 17
+ 2
+ 4
+ 42
+ 3
+ 384
+
+
+ 19
+ 4
+ 43
+ 3
+ 1536
+
+
+ 29
+ 2
+ 4
+ 44
+ 3
+ 384
+
+
+ 31
+ 2
+ 4
+ 45
+ 3
+ 384
+
+
+ 25
+ 2
+ 4
+ 46
+ 3
+ 384
+
+
+ 27
+ 4
+ 47
+ 3
+ 1536
+
+
+ 53
+ 2
+ 4
+ 48
+ 3
+ 384
+
+
+ 55
+ 2
+ 4
+ 49
+ 3
+ 384
+
+
+ 49
+ 2
+ 4
+ 50
+ 3
+ 384
+
+
+ 51
+ 4
+ 51
+ 3
+ 1536
+
+
+ 61
+ 2
+ 4
+ 52
+ 3
+ 384
+
+
+ 63
+ 2
+ 4
+ 53
+ 3
+ 384
+
+
+ 57
+ 2
+ 4
+ 54
+ 3
+ 384
+
+
+ 59
+ 4
+ 55
+ 3
+ 1536
+
+
+ 37
+ 2
+ 4
+ 56
+ 3
+ 384
+
+
+ 39
+ 2
+ 4
+ 57
+ 3
+ 384
+
+
+ 33
+ 2
+ 4
+ 58
+ 3
+ 384
+
+
+ 35
+ 4
+ 59
+ 3
+ 1536
+
+
+ 45
+ 2
+ 4
+ 60
+ 3
+ 384
+
+
+ 47
+ 2
+ 4
+ 61
+ 3
+ 384
+
+
+ 41
+ 2
+ 4
+ 62
+ 3
+ 384
+
+
+ 43
+ 4
+ 63
+ 3
+ 1536
+
+
+
+
diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai_4700.xml b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai_4700.xml
index 177a79d13d6..e3d0e4ea723 100644
--- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai_4700.xml
+++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai_4700.xml
@@ -5,6 +5,9 @@
00:02:03:04:05:00
+
+ 1
+
32
diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2
index 1959bb56cb7..2d7bd887d2e 100644
--- a/dockers/docker-base-buster/Dockerfile.j2
+++ b/dockers/docker-base-buster/Dockerfile.j2
@@ -64,7 +64,9 @@ RUN apt-get update && \
net-tools \
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
python-setuptools \
- python-wheel
+ python-wheel \
+# for processing/handling json files in bash environment
+ jq
# For templating
RUN pip install j2cli
diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2
index f573e94b78d..f563aee8d9e 100644
--- a/dockers/docker-base-stretch/Dockerfile.j2
+++ b/dockers/docker-base-stretch/Dockerfile.j2
@@ -62,7 +62,9 @@ RUN apt-get update && \
net-tools \
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
python-setuptools \
- python-wheel
+ python-wheel \
+# for processing json files in bash environment
+ jq
# For templating
RUN pip install j2cli
diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2
index 03e209621dd..94f4d73c968 100644
--- a/dockers/docker-sflow/Dockerfile.j2
+++ b/dockers/docker-sflow/Dockerfile.j2
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
-FROM docker-config-engine-stretch
+FROM docker-config-engine-buster
ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
diff --git a/dockers/docker-sonic-telemetry/Dockerfile.j2 b/dockers/docker-sonic-telemetry/Dockerfile.j2
index d3b95c3b400..b878266f1c6 100644
--- a/dockers/docker-sonic-telemetry/Dockerfile.j2
+++ b/dockers/docker-sonic-telemetry/Dockerfile.j2
@@ -22,7 +22,7 @@ RUN apt-get clean -y && \
apt-get autoremove -y && \
rm -rf /debs
-COPY ["start.sh", "telemetry.sh", "dialout.sh", "/usr/bin/"]
+COPY ["start.sh", "telemetry.sh", "dialout.sh", "telemetry_vars.j2", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]
diff --git a/dockers/docker-sonic-telemetry/telemetry.sh b/dockers/docker-sonic-telemetry/telemetry.sh
index b8f7fffb3eb..18356e0945e 100755
--- a/dockers/docker-sonic-telemetry/telemetry.sh
+++ b/dockers/docker-sonic-telemetry/telemetry.sh
@@ -2,36 +2,38 @@
# Try to read telemetry and certs config from ConfigDB.
# Use default value if no valid config exists
-X509=`sonic-cfggen -d -v "DEVICE_METADATA['x509']"`
-gnmi=`sonic-cfggen -d -v "TELEMETRY['gnmi']"`
-certs=`sonic-cfggen -d -v "TELEMETRY['certs']"`
+TELEMETRY_VARS=$(sonic-cfggen -d -t telemetry_vars.j2)
+TELEMETRY_VARS=${TELEMETRY_VARS//[\']/\"}
+X509=$(echo $TELEMETRY_VARS | jq -r '.x509')
+GNMI=$(echo $TELEMETRY_VARS | jq -r '.gnmi')
+CERTS=$(echo $TELEMETRY_VARS | jq -r '.certs')
TELEMETRY_ARGS=" -logtostderr"
export CVL_SCHEMA_PATH=/usr/sbin/schema
-if [ -n "$certs" ]; then
- SERVER_CRT=`sonic-cfggen -d -v "TELEMETRY['certs']['server_crt']"`
- SERVER_KEY=`sonic-cfggen -d -v "TELEMETRY['certs']['server_key']"`
+if [ -n "$CERTS" ]; then
+ SERVER_CRT=$(echo $CERTS | jq -r '.server_crt')
+ SERVER_KEY=$(echo $CERTS | jq -r '.server_key')
if [ -z $SERVER_CRT ] || [ -z $SERVER_KEY ]; then
TELEMETRY_ARGS+=" --insecure"
else
TELEMETRY_ARGS+=" --server_crt $SERVER_CRT --server_key $SERVER_KEY "
fi
- CA_CRT=`sonic-cfggen -d -v "TELEMETRY['certs']['ca_crt']"`
+ CA_CRT=$(echo $CERTS | jq -r '.ca_crt')
if [ ! -z $CA_CRT ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi
elif [ -n "$X509" ]; then
- SERVER_CRT=`sonic-cfggen -d -v "DEVICE_METADATA['x509']['server_crt']"`
- SERVER_KEY=`sonic-cfggen -d -v "DEVICE_METADATA['x509']['server_key']"`
+ SERVER_CRT=$(echo $X509 | jq -r '.server_crt')
+ SERVER_KEY=$(echo $X509 | jq -r '.server_key')
if [ -z $SERVER_CRT ] || [ -z $SERVER_KEY ]; then
TELEMETRY_ARGS+=" --insecure"
else
TELEMETRY_ARGS+=" --server_crt $SERVER_CRT --server_key $SERVER_KEY "
fi
- CA_CRT=`sonic-cfggen -d -v "DEVICE_METADATA['x509']['ca_crt']"`
+ CA_CRT=$(echo $X509 | jq -r '.ca_crt')
if [ ! -z $CA_CRT ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi
@@ -40,19 +42,20 @@ else
fi
# If no configuration entry exists for TELEMETRY, create one default port
-if [ -z "$gnmi" ]; then
- sonic-db-cli CONFIG_DB hset "TELEMETRY|gnmi" port 8080
+if [ -z "$GNMI" ]; then
+ PORT=8080
+ sonic-db-cli CONFIG_DB hset "TELEMETRY|gnmi" port $PORT
+else
+ PORT=$(echo $GNMI | jq -r '.port')
fi
-
-PORT=`sonic-cfggen -d -v "TELEMETRY['gnmi']['port']"`
TELEMETRY_ARGS+=" --port $PORT"
-CLIENT_AUTH=`sonic-cfggen -d -v "TELEMETRY['gnmi']['client_auth']"`
+CLIENT_AUTH=$(echo $GNMI | jq -r '.client_auth')
if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then
TELEMETRY_ARGS+=" --allow_no_client_auth"
fi
-LOG_LEVEL=`sonic-cfggen -d -v "TELEMETRY['gnmi']['log_level']"`
+LOG_LEVEL=$(echo $GNMI | jq -r '.log_level')
if [ ! -z $LOG_LEVEL ]; then
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
else
diff --git a/dockers/docker-sonic-telemetry/telemetry_vars.j2 b/dockers/docker-sonic-telemetry/telemetry_vars.j2
new file mode 100644
index 00000000000..687781e1b9b
--- /dev/null
+++ b/dockers/docker-sonic-telemetry/telemetry_vars.j2
@@ -0,0 +1,5 @@
+{
+ "certs": "{% if "certs" in TELEMETRY.keys() %}{{ TELEMETRY["certs"] }}{% endif %}",
+ "gnmi" : "{% if "gnmi" in TELEMETRY.keys() %}{{ TELEMETRY["gnmi"] }}{% endif %}",
+ "x509" : "{% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% endif %}"
+}
diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk
index 04700349fba..db16aad8b20 100644
--- a/rules/docker-sflow.mk
+++ b/rules/docker-sflow.mk
@@ -7,22 +7,20 @@ DOCKER_SFLOW_DBG = $(DOCKER_SFLOW_STEM)-$(DBG_IMAGE_MARK).gz
$(DOCKER_SFLOW)_PATH = $(DOCKERS_PATH)/$(DOCKER_SFLOW_STEM)
$(DOCKER_SFLOW)_DEPENDS += $(SWSS) $(HSFLOWD) $(SFLOWTOOL) $(PSAMPLE)
-$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
+$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS)
$(DOCKER_TEAMD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG)
-$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
+$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES)
-$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
+$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
SONIC_DOCKER_IMAGES += $(DOCKER_SFLOW)
ifeq ($(ENABLE_SFLOW), y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SFLOW)
-SONIC_STRETCH_DOCKERS += $(DOCKER_SFLOW)
endif
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SFLOW_DBG)
ifeq ($(ENABLE_SFLOW), y)
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SFLOW_DBG)
-SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SFLOW_DBG)
endif
$(DOCKER_SFLOW)_CONTAINER_NAME = sflow
diff --git a/rules/redis.mk b/rules/redis.mk
index f4732d1ecbb..53566b5cdf8 100644
--- a/rules/redis.mk
+++ b/rules/redis.mk
@@ -1,30 +1,30 @@
# redis package
-
-REDIS_VERSION = 5.0.3-3~bpo9+2
-
-REDIS_TOOLS = redis-tools_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
-$(REDIS_TOOLS)_SRC_PATH = $(SRC_PATH)/redis
-$(REDIS_TOOLS)_DEPENDS += $(LIBHIREDIS_DEV)
-$(REDIS_TOOLS)_RDEPENDS += $(LIBHIREDIS)
# TODO: docker-sonic-p4 depends on redis-tools in Jessie.
# Remove this file and src/redis after that resolved.
ifneq ($(BLDENV),buster)
-SONIC_MAKE_DEBS += $(REDIS_TOOLS)
-endif
-REDIS_TOOLS_DBG = redis-tools-dbgsym_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
-$(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_TOOLS_DBG)))
+ REDIS_VERSION = 5.0.3-3~bpo9+2
-REDIS_SERVER = redis-server_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
-$(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SERVER)))
+ REDIS_TOOLS = redis-tools_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
+ $(REDIS_TOOLS)_SRC_PATH = $(SRC_PATH)/redis
+ $(REDIS_TOOLS)_DEPENDS += $(LIBHIREDIS_DEV)
+ $(REDIS_TOOLS)_RDEPENDS += $(LIBHIREDIS)
+ SONIC_MAKE_DEBS += $(REDIS_TOOLS)
-REDIS_SENTINEL = redis-sentinel_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
-$(REDIS_SENTINEL)_DEPENDS += $(REDIS_SERVER)
-$(REDIS_SENTINEL)_RDEPENDS += $(REDIS_SERVER)
-$(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SENTINEL)))
+ REDIS_TOOLS_DBG = redis-tools-dbgsym_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
+ $(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_TOOLS_DBG)))
-# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
-# are archived into debug one image to facilitate debugging.
-#
-DBG_SRC_ARCHIVE += redis
+ REDIS_SERVER = redis-server_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
+ $(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SERVER)))
+ REDIS_SENTINEL = redis-sentinel_$(REDIS_VERSION)_$(CONFIGURED_ARCH).deb
+ $(REDIS_SENTINEL)_DEPENDS += $(REDIS_SERVER)
+ $(REDIS_SENTINEL)_RDEPENDS += $(REDIS_SERVER)
+ $(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SENTINEL)))
+
+ # The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
+ # are archived into debug one image to facilitate debugging.
+ #
+ DBG_SRC_ARCHIVE += redis
+
+endif