-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[sonic-buildimage] sync timezone to docker, so the docker has the cor… #1434
Conversation
…rect timestamp in log Signed-off-by: chenhu <chenhu@didichuxing.com>
@@ -56,6 +56,7 @@ start() { | |||
--log-opt max-size=2M --log-opt max-file=5 \ | |||
{%- endif %} | |||
-v /var/run/redis:/var/run/redis:rw \ | |||
-v /etc/timezone:/etc/timezone: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.
do you need to configure as rw? can you mount as ro? since you want the timezone in docker to be in sync with baseimage, then you do not really want to change the timezone in the baseimage, right?
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.
I tried ro, but dpkg-reconfigure -f noninteractive tzdata need write permission, or it will not update ok. this command will not change the file content.
how about using -e TZ=timezone approach, seems easier. moby/moby#12084 Just need to change the docker_image_ctl.j2. |
if using -e TZ=timezone approach, we should start new container each every time. |
are you saying each every time we change time zone, we need to restart the container? |
'docker start' not support flag -e, so if we we want to do it here, we need delete the docker container first, then start an new container. as we delete the container the modification the history log will be deleted too, so I don't know if this is acceptable.
|
How often would you need to change your switches' timezones? Taking into account that docker containers are by default synchronized with the host, and that you typically set the timezone during switch installation/deployment, i wouldn't expect this to be a common operation. If that's the case, i would rather go with the "docker run -e" option, even though that requires the elimination/creation of the containers. Personally, i prefer that option over the current one of mounting yet-another host-system file as RW. |
the risk of mount /etc/timezone as rw is the the docker application can then modify the file, which can affect the base image and other dockers as well. I am still not quite clear about the requirement here. is this just one timer change or everytime we change the host timezone we also need to change the timezone within the docker container? @richard28530 , Can you help to clarify the requirement so that we are all on the same page? |
@lguohan the requirement is when I set the timezone on the host, I restart host or restart all the services, after that the logs in the host and the docker container will have the correct timestamp. this should be repeatable. When we build the installer image, we have the default timezone UTC, at first startup we create an docker container with UTC. use -e flags is ok for me, if you all think is ok too, I will try this way. |
Avoid adding loopback interface (ip link add) when setting nat zone on loopback interface (#1434) [acl] Remove Ethertype from L3V6 qualifiers (#1433) Sflow fixes during DEL processing (#1427) Fix #3971 by skipping create-only SAI attributes when modifying buffer pools or profiles in orchagent (#1430) Fix issue: bufferorch only pass the first attribute to sai when setting attribute (#1442) Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
…n loopback interface (sonic-net#1434) Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
- swss: * 459d09b 2021-02-22 | [acl] Enable VLAN ID qualifier for ACL rules (sonic-net#1648) (HEAD -> 202012) [Danny Allen] * 60859b1 2021-02-08 | [buffermgr] Support maximum port headroom checking (sonic-net#1607) [Stephen Sun] * 3161cbb 2021-02-17 | Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (sonic-net#1600) [Andriy Yurkiv] * 256ed9c 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1581) [Stephen Sun] - utilities: * 30d7069 2021-02-16 | [decode-syseeprom] Refactor to utilize sonic-platform package (sonic-net#1435) (HEAD -> 202012, tag: foo) [Joe LeVeque] * 891fef4 2021-02-16 | [psuutil] Refactor to utilize sonic-platform package (sonic-net#1434) [Joe LeVeque] * 8c5e505 2021-02-17 | [sfputil] Refactor to utilize sonic-platform package (sonic-net#1421) [Joe LeVeque] * ca5dd2c 2021-02-17 | [sfpshow] Cleanup (sonic-net#1405) [Joe LeVeque] * bf489ea 2021-02-17 | Add new cli for SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter in counterpoll utility (sonic-net#1355) [Andriy Yurkiv] * 25feed3 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (sonic-net#1348) [Stephen Sun] * aaa323a 2021-02-02 | [vrf]: Fix freezing during interface binding (sonic-net#1325) [maksymbelei95] * cc0bb6e 2021-01-27 | [show] fix "show interfaces breakout" command (sonic-net#1198) [Dmytro Shevchuk] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
- swss: * 459d09b 2021-02-22 | [acl] Enable VLAN ID qualifier for ACL rules (#1648) (HEAD -> 202012) [Danny Allen] * 60859b1 2021-02-08 | [buffermgr] Support maximum port headroom checking (#1607) [Stephen Sun] * 3161cbb 2021-02-17 | Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (#1600) [Andriy Yurkiv] * 256ed9c 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (#1581) [Stephen Sun] - utilities: * 30d7069 2021-02-16 | [decode-syseeprom] Refactor to utilize sonic-platform package (#1435) (HEAD -> 202012, tag: foo) [Joe LeVeque] * 891fef4 2021-02-16 | [psuutil] Refactor to utilize sonic-platform package (#1434) [Joe LeVeque] * 8c5e505 2021-02-17 | [sfputil] Refactor to utilize sonic-platform package (#1421) [Joe LeVeque] * ca5dd2c 2021-02-17 | [sfpshow] Cleanup (#1405) [Joe LeVeque] * bf489ea 2021-02-17 | Add new cli for SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter in counterpoll utility (#1355) [Andriy Yurkiv] * 25feed3 2021-02-08 | Support shared headroom pool on top of dynamic buffer calculation (#1348) [Stephen Sun] * aaa323a 2021-02-02 | [vrf]: Fix freezing during interface binding (#1325) [maksymbelei95] * cc0bb6e 2021-01-27 | [show] fix "show interfaces breakout" command (#1198) [Dmytro Shevchuk] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
#### What I did Refactor psuutil to use sonic-platform package in lieu of old, deprecated platform plugins. The psuutil utility is still useful, as psushow only reads and displays PSU data from State DB. However, this utility provides us the ability to read directly from the PSUs which is helpful for debugging. #### How I did it - Complete refactor to use sonic-platform package - Add more output columns to display (Model, Serial, Voltage, Current, Power) - Bump version to 2.0 - Add basic unit tests
…tically (#20540) #### Why I did it src/sonic-sairedis ``` * e394ced7 - (HEAD -> master, origin/master, origin/HEAD) Fix compilation on Buster (#1449) (11 hours ago) [Saikrishna Arcot] * 4d504ff8 - Rename file name to fit case insensitive file system. (#1444) (2 days ago) [Liu Shilong] * fe650bb7 - [syncd] Add workaround for port error status notification (#1430) (6 days ago) [Kamil Cudnik] * cd2773a3 - [syncd] Fix inspect asic command (#1434) (7 days ago) [Kamil Cudnik] * 2d873766 - [syncd] Make sure notification queue release memory when drained (#1427) (8 days ago) [Kamil Cudnik] * b8a8856a - Fix adding flex counter to wrong context (#1421) (8 days ago) [byu343] * 40979e0b - [fastboot] Notify SAI that fastboot is done (#1396) (8 days ago) [Junchao-Mellanox] * 952ee406 - [codeql] Change pull_request_target to pull_request (#1442) (9 days ago) [Kamil Cudnik] * 697d86b5 - [syncd] Create neighbor entries before next hop (#1432) (9 days ago) [Kamil Cudnik] * fa76ca13 - [codeql] Remove git ancestry (#1441) (10 days ago) [Kamil Cudnik] * 3838d7ee - [codeql] Show git ancestry graph (#1440) (10 days ago) [Kamil Cudnik] * 2e7d946b - [codeql] Show gcc version before compile (#1438) (10 days ago) [Kamil Cudnik] * a1e93f58 - [submodule] Update SAI to latest master (#1431) (2 weeks ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog
- What I did
sync timezone to docker
- How to verify it
change the switch timezone, reload the config to check the date time is correct
admin@SONiC:
$ date$Thu Mar 1 14:39:14 HKT 2018
admin@SONiC:
admin@SONiC:
$$admin@SONiC:
admin@SONiC:~$ docker exec -it bgp bash
root@SONiC:/# date
Thu Mar 1 14:39:28 HKT 2018
root@SONiC:/#