Skip to content

Commit

Permalink
Merge pull request #122 from Azure/201811
Browse files Browse the repository at this point in the history
201811
  • Loading branch information
Alex-Dai authored Oct 17, 2019
2 parents c6655b8 + e98be74 commit 841385d
Show file tree
Hide file tree
Showing 103 changed files with 3,392 additions and 268 deletions.
43 changes: 14 additions & 29 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,31 +307,8 @@ sudo sed -i 's/^ListenAddress ::/#ListenAddress ::/' $FILESYSTEM_ROOT/etc/ssh/ss
sudo sed -i 's/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' $FILESYSTEM_ROOT/etc/ssh/sshd_config

## Config monit
sudo sed -i '
s/^# set logfile syslog/set logfile syslog/;
s/^\s*set logfile \/var/# set logfile \/var/;
s/^# set httpd port/set httpd port/;
s/^# use address localhost/ use address localhost/;
s/^# allow localhost/ allow localhost/;
s/^# allow admin:monit/ allow admin:monit/;
s/^# allow @monit/ allow @monit/;
s/^# allow @users readonly/ allow @users readonly/
' $FILESYSTEM_ROOT/etc/monit/monitrc

sudo tee -a $FILESYSTEM_ROOT/etc/monit/monitrc > /dev/null <<'EOF'
check filesystem root-overlay with path /
if space usage > 90% for 5 times within 10 cycles then alert
check filesystem var-log with path /var/log
if space usage > 90% for 5 times within 10 cycles then alert
check system $HOST
if memory usage > 50% for 5 times within 10 cycles then alert
if cpu usage (user) > 90% for 5 times within 10 cycles then alert
if cpu usage (system) > 90% for 5 times within 10 cycles then alert
check process rsyslog with pidfile /var/run/rsyslogd.pid
start program = "/bin/systemctl start rsyslog.service"
stop program = "/bin/systemctl stop rsyslog.service"
if totalmem > 800 MB for 5 times within 10 cycles then restart
EOF
sudo cp files/image_config/monit/monitrc $FILESYSTEM_ROOT/etc/monit/
sudo chmod 600 $FILESYSTEM_ROOT/etc/monit/monitrc

## Config sysctl
sudo mkdir -p $FILESYSTEM_ROOT/var/core
Expand Down Expand Up @@ -422,6 +399,17 @@ build_number: ${BUILD_NUMBER:-0}
built_by: $USER@$BUILD_HOSTNAME
EOF

## Copy over clean-up script
sudo cp ./files/scripts/core_cleanup.py $FILESYSTEM_ROOT/usr/bin/core_cleanup.py

## Copy ASIC config checksum
python files/build_scripts/generate_asic_config_checksum.py
if [[ ! -f './asic_config_checksum' ]]; then
echo 'asic_config_checksum not found'
exit 1
fi
sudo cp ./asic_config_checksum $FILESYSTEM_ROOT/etc/sonic/asic_config_checksum

if [ -f sonic_debian_extension.sh ]; then
./sonic_debian_extension.sh $FILESYSTEM_ROOT $PLATFORM_DIR
fi
Expand Down Expand Up @@ -452,10 +440,7 @@ then
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/debug is mounted in each docker' >> /etc/motd"

sudo mkdir -p $FILESYSTEM_ROOT/src
pushd src
../dbg_files.sh | sudo tar -cvzf ../$FILESYSTEM_ROOT/src/sonic_src.tar.gz -T -
popd

sudo cp $DEBUG_SRC_ARCHIVE_FILE $FILESYSTEM_ROOT/src/
sudo mkdir -p $FILESYSTEM_ROOT/debug

fi
Expand Down
11 changes: 7 additions & 4 deletions dbg_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# Provide file paths to archive for debug image as relative to src subdir
#
for i in $debug_src_archive
do
find $i/ -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -type f
done
if [ "$DEBUG_IMG" == "y" ]
then
for i in $DEBUG_SRC_ARCHIVE_DIRS
do
find src/$i/ -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -type f
done | tar -czf $DEBUG_SRC_ARCHIVE_FILE -T -
fi

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"3995680"
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"3995680"
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"3995680"
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"3995680"
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"3995680"
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ portmap_9=17:100
robust_hash_disable_egress_vlan=1
robust_hash_disable_mpls=1
robust_hash_disable_vlan=1
sram_scan_enable=0
stable_size=0x5500000
stable_size=0x5500000
tdma_timeout_usec=15000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"static_th":"11075584"
"static_th":"44302336"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"10587408"
"static_th":"42349632"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
50000 5m 1248 1248 56160 -3 2496
100000 5m 1248 1248 96928 -3 2496
50000 40m 1248 1248 56160 -3 2496
100000 40m 1248 1248 96928 -3 2496
50000 300m 1248 1248 56160 -3 2496
100000 300m 1248 1248 96928 -3 2496
# speed cable size xon xoff threshold xon_offset
50000 5m 1248 1248 56160 -3 2496
100000 5m 1248 1248 96928 -3 2496
50000 40m 1248 1248 96096 -3 2496
100000 40m 1248 1248 177632 -3 2496
50000 300m 1248 1248 141856 -3 2496
100000 300m 1248 1248 268736 -3 2496
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ port_init_cl72_hg=1
robust_hash_disable_egress_vlan=1
robust_hash_disable_mpls=1
robust_hash_disable_vlan=1
sram_scan_enable=0
stable_size=0x5500000
stable_size=0x5500000
tdma_timeout_usec=15000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"static_th":"11075584"
"static_th":"44302336"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"10587408"
"static_th":"42349632"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
40000 5m 1248 1248 56160 -3 2496
50000 5m 1248 1248 56160 -3 2496
100000 5m 1248 1248 96928 -3 2496
40000 40m 1248 1248 56160 -3 2496
50000 40m 1248 1248 56160 -3 2496
100000 40m 1248 1248 96928 -3 2496
40000 300m 1248 1248 56160 -3 2496
50000 300m 1248 1248 56160 -3 2496
100000 300m 1248 1248 96928 -3 2496
# speed cable size xon xoff threshold xon_offset
40000 5m 1248 1248 56160 -3 2496
50000 5m 1248 1248 56160 -3 2496
100000 5m 1248 1248 96928 -3 2496
40000 40m 1248 1248 71552 -3 2496
50000 40m 1248 1248 96096 -3 2496
100000 40m 1248 1248 177632 -3 2496
40000 300m 1248 1248 108160 -3 2496
50000 300m 1248 1248 141856 -3 2496
100000 300m 1248 1248 268736 -3 2496
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ portmap_9=17:40
robust_hash_disable_egress_vlan=1
robust_hash_disable_mpls=1
robust_hash_disable_vlan=1
sram_scan_enable=0
stable_size=0x5500000
stable_size=0x5500000
tdma_timeout_usec=15000000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- set default_topo = 't1' %}
{%- include 'buffers_config.j2' %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

{%- set default_cable = '5m' %}

{%- set ports2cable = {
'torrouter_server' : '300m',
'leafrouter_torrouter' : '300m',
'spinerouter_leafrouter' : '300m'
}
-%}

{%- 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 * 4)) %}{%- endif %}
{%- endfor %}
{%- endmacro %}

{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "10875072",
"type": "ingress",
"mode": "dynamic",
"xoff": "4194112"
},
"egress_lossy_pool": {
"size": "9243812",
"type": "egress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "15982720",
"type": "egress",
"mode": "static"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

{%- set default_cable = '40m' %}

{%- set ports2cable = {
'torrouter_server' : '300m',
'leafrouter_torrouter' : '300m',
'spinerouter_leafrouter' : '300m'
}
-%}

{%- 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 * 4)) %}{%- endif %}
{%- endfor %}
{%- endmacro %}

{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "10875072",
"type": "ingress",
"mode": "dynamic",
"xoff": "4194112"
},
"egress_lossy_pool": {
"size": "9243812",
"type": "egress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "15982720",
"type": "egress",
"mode": "static"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"1518",
"static_th":"15982720"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
10000 5m 1248 2288 35776 -3 2288
25000 5m 1248 2288 53248 -3 2288
40000 5m 1248 2288 66560 -3 2288
50000 5m 1248 2288 90272 -3 2288
100000 5m 1248 2288 165568 -3 2288
10000 40m 1248 2288 37024 -3 2288
25000 40m 1248 2288 53248 -3 2288
40000 40m 1248 2288 71552 -3 2288
50000 40m 1248 2288 96096 -3 2288
100000 40m 1248 2288 177632 -3 2288
10000 300m 1248 2288 46176 -3 2288
25000 300m 1248 2288 79040 -3 2288
40000 300m 1248 2288 108160 -3 2288
50000 300m 1248 2288 141856 -3 2288
100000 300m 1248 2288 268736 -3 2288
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name lanes alias speed index
Ethernet0 65,66,67,68 etp1 100000 1
Ethernet4 69,70,71,72 etp2 100000 2
Ethernet8 73,74,75,76 etp3 100000 3
Ethernet12 77,78,79,80 etp4 100000 4
Ethernet16 33,34,35,36 etp5 100000 5
Ethernet20 37,38,39,40 etp6 100000 6
Ethernet24 41,42,43,44 etp7 100000 7
Ethernet28 45,46,47,48 etp8 100000 8
Ethernet32 49,50,51,52 etp9 100000 9
Ethernet36 53,54,55,56 etp10 100000 10
Ethernet40 57,58,59,60 etp11 100000 11
Ethernet44 61,62,63,64 etp12 100000 12
Ethernet48 81,82,83,84 etp13 100000 13
Ethernet52 85,86,87,88 etp14 100000 14
Ethernet56 89,90,91,92 etp15 100000 15
Ethernet60 93,94,95,96 etp16 100000 16
Ethernet64 97,98,99,100 etp17 100000 17
Ethernet68 101,102,103,104 etp18 100000 18
Ethernet72 105,106,107,108 etp19 100000 19
Ethernet76 109,110,111,112 etp20 100000 20
Ethernet80 1,2,3,4 etp21 100000 21
Ethernet84 5,6,7,8 etp22 100000 22
Ethernet88 9,10,11,12 etp23 100000 23
Ethernet92 13,14,15,16 etp24 100000 24
Ethernet96 17,18,19,20 etp25 100000 25
Ethernet100 21,22,23,24 etp26 100000 26
Ethernet104 25,26,27,28 etp27 100000 27
Ethernet108 29,30,31,32 etp28 100000 28
Ethernet112 113,114,115,116 etp29 100000 29
Ethernet116 117,118,119,120 etp30 100000 30
Ethernet120 121,122,123,124 etp31 100000 31
Ethernet124 125,126,127,128 etp32 100000 32
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{# Get sai.profile based on switch_role #}
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined -%}
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
{%- if switch_role.lower() == 'torrouter' %}
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t0.config.bcm' -%}
{%- else %}
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t1.config.bcm' -%}
{%- endif %}
{%- else %}
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t1.config.bcm' -%}
{%- endif %}
{# Write the contents of sai_ profile_filename to sai.profile file #}
{{ sai_profile_contents }}
Loading

0 comments on commit 841385d

Please sign in to comment.