-
Notifications
You must be signed in to change notification settings - Fork 1.5k
syslog changes Multi NPU platforms #4738
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
Changes from 2 commits
a4a10a7
795b2b0
3616a5f
16c6b3d
1deb8a0
b760de0
222489d
84aa4b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,10 @@ start() { | |
done | ||
fi | ||
{%- endif %} | ||
# single NPU systems and container running on the host network continue to use the json-file as log-driver | ||
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} | ||
LOG_OPTS="--log-opt max-size=2M --log-opt max-file=5" | ||
{%- endif %} | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to change this line #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in latest commit |
||
# This part of code is applicable for Multi-ASIC platforms. Here we mount the namespace specific | ||
# redis directory into the docker running in that namespace. Below eg: is for namespace "asic1" | ||
|
@@ -238,7 +242,9 @@ start() { | |
redis_dir=`echo $redis_dir_list | cut -d " " -f $id` | ||
REDIS_MNT=" -v $redis_dir:$redis_dir:rw " | ||
fi | ||
|
||
# Containers in the docker network will use the syslog-driver as log-driver. This is mainly applicable for Multi NPU system | ||
LOG_OPTS="--log-driver=syslog --log-opt syslog-address=udp://127.0.0.1:514 --log-opt syslog-format=rfc5424 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be a check to make sure docker_image_run_opt does not have--log-driver=json-file ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SuvarnaMeenakshi syslogs will not work if the log-driver is json on containers running the docker bridge network, so I think we can ignore --log-driver=json-file in this case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you giver proof or reference that "syslogs will not work if the log-driver is json on containers running the docker bridge network"? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Logs docker logs for swss running in namespace asic0.
same logs not available in syslog file
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see your point. Syslogs will not work if the log-driver is json and this is not related to docker bridge network and applicable to previous single ASIC use case. Do you want to fix both single ASIC and multiple ASIC? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didnt change the Single ASIC I didnt want to break any backward compatibility for some applications, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then you need to check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in the latest commit |
||
--log-opt syslog-facility=daemon --log-opt tag={{docker_container_name}}$DEV" | ||
{%- if docker_container_name == "database" %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to change this line #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in latest commit |
||
NET="bridge" | ||
{%- else %} | ||
|
@@ -262,9 +268,7 @@ start() { | |
{%- if install_debug_image == "y" %} | ||
-v /src:/src:ro -v /debug:/debug:rw \ | ||
{%- endif %} | ||
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} | ||
--log-opt max-size=2M --log-opt max-file=5 \ | ||
{%- endif %} | ||
$LOG_OPTS \ | ||
{%- if sonic_asic_platform == "mellanox" %} | ||
{%- if docker_container_name == "syncd" %} | ||
-v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The different behavior of single NPU vs multiple NPU is confusing and complex deign.
What about moving all use cases to log-driver, or all use cases to json-file as before? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use json-file for all cases