Skip to content

Let bgp docker generate configuration by itself#173

Closed
taoyl-ms wants to merge 1 commit intosonic-net:masterfrom
taoyl-ms:taoyl/config
Closed

Let bgp docker generate configuration by itself#173
taoyl-ms wants to merge 1 commit intosonic-net:masterfrom
taoyl-ms:taoyl/config

Conversation

@taoyl-ms
Copy link
Contributor

A temp solution and call for comments.

Ideally python scripts and config.py should be put into docker-base or another layer of base image as the same logic will be shared by different dockers

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move them to docker base as all the docker are going to use them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @lguohan @taoyl-ms, not to move to docker-base. Instead, package it and install in all the related docker images.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true


COPY daemons /etc/quagga/
COPY ["*.j2", "config.sh", "template_list", "*.py", "/etc/swss/"]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we embed the mountpoint here, e.g.,

VOLUME ['/etc/sonic']

Then, in the base image, we can put minigraph in the /etc/sonic/,

also, the VOLUME is in baseimage as it is shared by all dockers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some concerns about

  1. duplicate the minigraph parsers in every containers.
  2. runtime overhead to generate config files on each bootup

The requirement is as:

  1. there is no change of minigraph.xml after deployment
  2. so, it is possible to create config files on host, copy to docker containers after they are just created. only the first bootup will be slower (if possible, we can run this step before reboot)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 1, we are considering move those config-related scripts into docker-base after they are stabilized.

For 2, Guohan has some concern on potential changes of config file schema update container version update, thus we want to keep the capability of generating config file in the container itself.

Maybe Guohan could give more comments on this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for 1, we can move it do the docker-base and stablized there.

for 2, configuration generate should be part of the docker container's job. For example, if we switch quagga to gobgp, the configuration template for them is going to be very different, where should be store the config template? I feel should be stored in the container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minigraph_facts.py could be a python library that could be used by other config generators

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the configuration generation code should be inside each container.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etc [](start = 54, length = 3)

/etc is not a good place for scripts.

Copy link
Collaborator

@qiluo-msft qiluo-msft Dec 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filters [](start = 8, length = 7)

How many kinds of filters will we use? If many, we should consider implementation and maintenance cost. One option is to reuse ansible implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ansible implementation is of GPLv3. There might be copyright concerns.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this command too complex to read?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, use variable name would make it more readable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nisolate.j2 [](start = 1, length = 11)

suggest implement this feature as:

  1. make fake config files in Dockerfile, set the correct ownership, groupship and mode. I guess the vanilla ones are already good.
  2. copy file and maintain the target file attribute. ref: http://serverfault.com/questions/273949/cp-not-want-to-overwrite-permissions/273956

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As comments.

@lguohan
Copy link
Collaborator

lguohan commented Dec 30, 2016

apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
rm -rf /deps

COPY daemons /etc/quagga/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

daemons [](start = 5, length = 7)

where is this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's already there. somebody add it in a previous version.
and, it's actually not a template

@svc-acs
Copy link
Collaborator

svc-acs commented Dec 30, 2016

No test results found.

1 similar comment
@svc-acs
Copy link
Collaborator

svc-acs commented Dec 30, 2016

No test results found.

@taoyl-ms taoyl-ms closed this Jan 3, 2017
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
monaliusa pushed a commit to monaliusa/sonic-buildimage that referenced this pull request Aug 7, 2020
…-temp-access

[platform/questone2bd] Remove SPD temperature sensors from platform
dmytroxshevchuk pushed a commit to dmytroxshevchuk/sonic-buildimage that referenced this pull request Aug 31, 2020
Sabareesh-Kumar-Anandan pushed a commit to Sabareesh-Kumar-Anandan/sonic-buildimage that referenced this pull request Dec 18, 2020
[marvell-armhf] Armada A385 soc support sonic-net#176
backport macsec xpn support to 4.19 kernel (sonic-net#174)
add internal patch marker (sonic-net#173)
Improve netfilter fullclone nat support patch sonic-net#171

Signed-off-by: Sabareesh Kumar Anandan <sanandan@marvell.com>
lguohan pushed a commit that referenced this pull request Dec 19, 2020
[marvell-armhf] Armada A385 soc support #176
backport macsec xpn support to 4.19 kernel (#174)
add internal patch marker (#173)
Improve netfilter fullclone nat support patch #171

Signed-off-by: Sabareesh Kumar Anandan <sanandan@marvell.com>
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Mar 7, 2021
this PR updates the following commits
1673d25 [y_cable] refactor upgrade firmware API's; Fix vendor and part number API's read size for read_eeprom (sonic-net#174)
ed93a15 [sonic_platform_base] Proper use of class and instance attributes (sonic-net#173)
691de92 [sonic_y_cable] add stub function for upgrade firmware of Y cable and split the get_part_number and get_vendor API's (sonic-net#171)
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
jleveque pushed a commit that referenced this pull request Mar 8, 2021
Includes the following commits:

1673d25 [y_cable] refactor upgrade firmware API's; Fix vendor and part number API's read size for read_eeprom (#174)
ed93a15 [sonic_platform_base] Proper use of class and instance attributes (#173)
691de92 [sonic_y_cable] add stub function for upgrade firmware of Y cable and split the get_part_number and get_vendor API's (#171)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
lguohan pushed a commit that referenced this pull request Mar 10, 2021
Includes the following commits:

1673d25 [y_cable] refactor upgrade firmware API's; Fix vendor and part number API's read size for read_eeprom (#174)
ed93a15 [sonic_platform_base] Proper use of class and instance attributes (#173)
691de92 [sonic_y_cable] add stub function for upgrade firmware of Y cable and split the get_part_number and get_vendor API's (#171)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Apr 16, 2021
[muxcable] Fix Redis Selectable Processing (sonic-net#173)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Feb 23, 2023
linkmgrd:
* d2227d8 2023-02-22 | [active-standby] Toggle to standby if link down and config auto (sonic-net#173) (HEAD -> 202205) [Longxiang Lyu]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
yxieca added a commit that referenced this pull request Feb 23, 2023
linkmgrd:
* d2227d8 2023-02-22 | [active-standby] Toggle to standby if link down and config auto (#173) (HEAD -> 202205) [Longxiang Lyu]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
qiluo-msft pushed a commit that referenced this pull request Apr 4, 2023
Include commit: 
```
6ea1f03 Jing Zhang      Tue Mar 28 08:42:44 2023 -0700  [202012] remove chatty log message for peer link event (#192)
198292d Jing Zhang      Tue Mar 21 17:53:11 2023 -0700  [active-standby] avoid unnecessary mux state probe after configuring to `auto` (#183)
47de88e Jing Zhang      Mon Mar 20 18:14:25 2023 -0700  [202012] Avoid unnecessary error logs from `handleGetServerMacAddressNotification` #96 (#185)
8a33319 Jing Zhang      Mon Mar 6 11:53:27 2023 -0800   loose link down swithcover condition (#178)
c2bf08d Jing Zhang      Thu Mar 16 18:59:10 2023 -0700  fix ActiveStandbyStateMachine referrence (#186)
99d26af Jing Zhang      Thu Mar 16 18:58:48 2023 -0700  [ci] Fix apt-get install unable locate package issue. (#177) (#187)
d893be9 Longxiang Lyu   Wed Feb 22 12:55:44 2023 +0800  [active-standby] Toggle to standby if link down and config auto (#173)
```
snider-nokia pushed a commit to snider-nokia/sonic-buildimage that referenced this pull request Apr 6, 2023
…nic-net#173)

#### Description
- Use class and instance attributes properly. Only use class attributes for data which should be shared among all instances.
- Import all modules in `__init__.py`
- Remove unused imports
- Clean up whitespace

#### Motivation and Context
Proper object-oriented programming. This could prevent issues where attributes are shared between instances when they were not meant to be.

This also fixes a bug with `PsuBase.psu_master_led_color`, where it is defined as both a class attribute and an instance attribute.

With this change, some vendors' APIs can be cleaned up, because they redefined class attributes as instance attributes. That code can be removed.

However, note that vendor APIs MUST call the base class initializer in their initializer methods, or the instance attributes will not be available and will raise exceptions.
vivekrnv pushed a commit to vivekrnv/sonic-buildimage that referenced this pull request Apr 28, 2023
all internal patches will be added below the marker. This eases
internal patch management when public patches change

Signed-off-by: Guohan Lu <lguohan@gmail.com>
mssonicbld added a commit that referenced this pull request Dec 14, 2023
…lly (#17436)

#### Why I did it
src/sonic-gnmi
```
* 88e82d4 - (HEAD -> master, origin/master, origin/HEAD) Replace PFC_WD_TABLE with PFC_WD (#173) (8 days ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Feb 16, 2024
…lly (#18104)

#### Why I did it
src/sonic-gnmi
```
* 50849ce - (HEAD -> 202305, origin/202305) Replace PFC_WD_TABLE with PFC_WD (#173) (22 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Apr 5, 2024
…lly (#18574)

#### Why I did it
src/sonic-gnmi
```
* 4b12af9 - (HEAD -> 202305, origin/202305) Merge pull request #209 from zbud-msft/revert_pfcwd_202305 (2 minutes ago) [StormLiangMS]
* 802dbb7 - Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (28 hours ago) [Zain Budhwani]
* e1397c4 - Revert "Account for GLOBAL key in PFC_WD (#178)" (28 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Apr 9, 2024
…lly (#18600)

#### Why I did it
src/sonic-gnmi
```
* cf52c74 - (HEAD -> 202311, origin/202311) Replace PFC_WD_TABLE with PFC_WD (#173) (21 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request May 2, 2024
…lly (#18824)

#### Why I did it
src/sonic-gnmi
```
* 530c6bb - (HEAD -> 202311, origin/202311) Merge pull request #220 from sonic-net/revert-211-cherry/202311/173 (3 days ago) [Ying Xie]
* db6f983 - (origin/revert-211-cherry/202311/173) Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (8 days ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Jul 30, 2024
…lly (#19731)

#### Why I did it
src/sonic-gnmi
```
* 4e6f5b1 - (HEAD -> 202405, origin/202405) Merge pull request #277 from zbud-msft/revert_pfcwd_202405 (3 hours ago) [bingwang-ms]
* 547241a - Rerun pipeline (25 hours ago) [Zain Budhwani]
* 9785246 - Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (25 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Sep 6, 2024
…lly (#20158)

#### Why I did it
src/sonic-gnmi
```
* 95f4400 - (HEAD -> master, origin/master, origin/HEAD) Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (#284) (2 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Nov 1, 2024
…utomatically (#20668)

#### Why I did it
src/sonic-host-services
```
* 13a5419 - (HEAD -> master, origin/master, origin/HEAD) Correct real time CPU Utilization calculation (#173) (3 hours ago) [Feng-msft]
* f95b7cd - Optimize state_db update into batch way. (#176) (3 hours ago) [Feng-msft]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Jul 10, 2025
…omatically (#23270)

#### Why I did it
src/sonic-mgmt-common
```
* 0ca4d8d - (HEAD -> master, origin/master, origin/HEAD) [ci] Upgrade agent pool from ubuntu 20.04 to latest. (#173) (12 hours ago) [Liu Shilong]
```
#### How I did it
#### How to verify it
#### Description for the changelog
YairRaviv pushed a commit to YairRaviv/sonic-buildimage that referenced this pull request Jul 15, 2025
…omatically (sonic-net#23270)

#### Why I did it
src/sonic-mgmt-common
```
* 0ca4d8d - (HEAD -> master, origin/master, origin/HEAD) [ci] Upgrade agent pool from ubuntu 20.04 to latest. (sonic-net#173) (12 hours ago) [Liu Shilong]
```
#### How I did it
#### How to verify it
#### Description for the changelog
patrickmacarthur pushed a commit to patrickmacarthur/sonic-buildimage that referenced this pull request Aug 6, 2025
…AD automatically (sonic-net#1076)

#### Why I did it
src/sonic-utilities
```
* f24cc0cd - (HEAD -> 202405, origin/202405) [chassis][show_tech]Fix show queue counters to only run on host (sonic-net#173) (2 hours ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
patrickmacarthur pushed a commit to patrickmacarthur/sonic-buildimage that referenced this pull request Dec 11, 2025
…tomatically (sonic-net#1857)

#### Why I did it
src/sonic-swss
```
* bfceee55 - (HEAD -> 202405, origin/202405) Add support for port media_type (sonic-net#173) (28 minutes ago) [saksarav-nokia]
* b2317d77 - [msft-2405] Populate the Voq system Port information for the local port when the Port is removed and created when the Speed is changed dynamically via GCU (sonic-net#167) (31 minutes ago) [saksarav-nokia]
* b2dd6bf7 - [202405] ignore ref counting for buffer queue for voq systems (sonic-net#161) (70 minutes ago) [Arvindsrinivasan Lakshmi Narasimhan]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Jan 17, 2026
…ically (#25040)

#### Why I did it
src/sonic-restapi
```
* 5c8f3d7 - (HEAD -> 202505, origin/202505) Changing the wildcard matching logic for client cert common names (#178) (27 hours ago) [mssonicbld]
* efbffea - Adding support for wildcard CN matching during client cert authentication (#176) (28 hours ago) [mssonicbld]
* 747af03 - [202505] upgrade debian to bookworm (#173) (4 days ago) [yijingyan2]
```
#### How I did it
#### How to verify it
#### Description for the changelog
jianyuewu pushed a commit to jianyuewu/sonic-buildimage that referenced this pull request Feb 10, 2026
**What I did**
Correct real time CPU Utilization calculation

**Why I did it**
Now in procdockerstatsd script we iterate all processes every 2 minutes and ingest into state_db, 
https://psutil.readthedocs.io/en/latest/#psutil.cpu_percent, psutil supports both blocking and non-blocking way, and we prefer to use non-blocking way, thus now psutil.cpu_percent() used is to calculate CPU utilization since last time being triggered, current implementation will create new process object in below lines every time:
for process in psutil.process_iter(['pid', 'ppid', 'memory_percent', 'cpu_percent', 'create_time', 'cmdline']):

In order to get correct CPU utilization from last 2 minutes, we need store process object into some variable, so that every iteration will first lookup all_process_obj member and use existing process object, otherwise create new object for further use. And clean up the dead process object in case some process crashes.

**How I verified it**
Verified by UT and will check by ksoftirqd reproduced case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants