Skip to content
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

Support building multi-asic component #3856

Merged
merged 27 commits into from
Jan 26, 2020

Conversation

SuvarnaMeenakshi
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi commented Dec 6, 2019

  • What I did
  1. Move single instance services into their own folder
  2. Generate Systemd templates for any multi-instance service files in slave.mk
  3. detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
  4. update container hostname after creation instead of during creation (docker_image_ctl)
  5. run Docker containers in a network namespace if specified
  6. add a service to create a simulated multi-ASIC topology on the virtual switch platform
  • How to verify it
    Single asic build was generated and loaded on the device to make sure the changes don't impact single asic image.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Lawrence Lee and others added 10 commits November 26, 2019 16:19
* indicate 'virsh' should be run as sudo
* add instructions to get DHCP lease for SSH connections

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit 4afe564)
* prepare slave.mk to build multi-asic services
* move systemd services into single and multi instance folders
* prepare sonic_debian_extension to copy over single and multi instance
services
* detect single or multi-asic platform in systemd-sonic-generator and
enable correct services

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit 0fdb595)
…ulti-instance container support

[build_templates]:

* add network namespace creation/linking to docker_image_ctl.j2
* add support for multi-instance containers to docker_image_ctl.j2
* add support for hostnames in multi-asic containers
* don't try and copy single instance version of namespace service in
sonic_debian_extension

[rules]:

* add rule for creating network namespace docker
* removes "--net=host" from DOCKER_RUN_OPTS in all other docker rules (it now lives in docker_image_ctl.j2)

[build]:

* retry docker build without squashing if squashing fails

[platform/vs]: add network interfaces to virtual switch

* add 32 more network interfaces, for a total of 64

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit ba7b7e0)
* add script to configure virtual switch internal topology
* create service to manage topology
* install topology service in sonic_debian_extension

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit bf7b16d)
* remove extra line from slave.mk
* change namespace names to 'asic#'

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit 95bef6e)
platform specific conf file during boot up.
creation and use database docker network for multi asic platform.
Copy link
Collaborator

Choose a reason for hiding this comment

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

why hard code numbers here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed to dynamically update dependency based on number of asics

platform/vs/sonic.xml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
slave.mk Outdated Show resolved Hide resolved
@lguohan
Copy link
Collaborator

lguohan commented Dec 7, 2019

can you make description more informative? refer to PR that is not going to be merged is not a good idea.

@SuvarnaMeenakshi
Copy link
Contributor Author

retest this please

@SuvarnaMeenakshi
Copy link
Contributor Author

retest vsimage please

1 similar comment
@SuvarnaMeenakshi
Copy link
Contributor Author

retest vsimage please

NET="host"
else
{%- if docker_container_name == "database" %}
NET="bridge"
Copy link
Collaborator

Choose a reason for hiding this comment

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

you are using tab, but other places you are using space in the same file. can you change to space and make the spacing consistent acrosss the 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.

Corrected spacing

@SuvarnaMeenakshi
Copy link
Contributor Author

retest vsimage please

1 similar comment
@lguohan
Copy link
Collaborator

lguohan commented Jan 24, 2020

retest vsimage please

@lguohan lguohan merged commit c948379 into sonic-net:master Jan 26, 2020
abdosi pushed a commit that referenced this pull request Feb 4, 2020
- move single instance services into their own folder
- generate Systemd templates for any multi-instance service files in slave.mk
- detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
- update container hostname after creation instead of during creation (docker_image_ctl)
- run Docker containers in a network namespace if specified
- add a service to create a simulated multi-ASIC topology on the virtual switch platform

Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Suvarna Meenakshi <[email protected]>
if [ x"$HOSTNAME" != x"$CURRENT_HOSTNAME" ]; then
updateHostName "$HOSTNAME"
fi
postStartAction
updateHostName "$HOSTNAME"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for late comment.
Why it is needed to call updateHostName even though it is called in the condition right above?

echo "Failed to docker run" >&1
exit 4
}

preStartAction
docker start {{docker_container_name}}
postStartAction
updateHostName "$HOSTNAME"
Copy link
Collaborator

Choose a reason for hiding this comment

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

same question here

pphuchar pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Mar 9, 2020
- move single instance services into their own folder
- generate Systemd templates for any multi-instance service files in slave.mk
- detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
- update container hostname after creation instead of during creation (docker_image_ctl)
- run Docker containers in a network namespace if specified
- add a service to create a simulated multi-ASIC topology on the virtual switch platform

Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Suvarna Meenakshi <[email protected]>
CharlieChenEC added a commit to CharlieChenEC/sonic-buildimage that referenced this pull request Mar 20, 2020
… "--net" options in the docker create command

In the file "files/build_templates/docker_image_ctl.j2", it adds the option
"--net" to the docker create command through the commit
"abe7ef7e2e2e1215c97cee19a83aab0b130cebe5" (sonic-net#3856).

Remove the "--net" option in "docker-syncd-brcm-rpc.mk" to avoid
specifying duplicated "--net" options.

Signed-off-by: charlie_chen <[email protected]>
lguohan pushed a commit that referenced this pull request Mar 22, 2020
…m syncd rpc (#4296)

In the file "files/build_templates/docker_image_ctl.j2", it adds the option
"--net" to the docker create command through the commit
"abe7ef7e2e2e1215c97cee19a83aab0b130cebe5" (#3856).

Remove the "--net" option in "docker-syncd-brcm-rpc.mk" to avoid
specifying duplicated "--net" options.

Signed-off-by: charlie_chen <[email protected]>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 24, 2020
- move single instance services into their own folder
- generate Systemd templates for any multi-instance service files in slave.mk
- detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
- update container hostname after creation instead of during creation (docker_image_ctl)
- run Docker containers in a network namespace if specified
- add a service to create a simulated multi-ASIC topology on the virtual switch platform

Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Suvarna Meenakshi <[email protected]>
@SuvarnaMeenakshi SuvarnaMeenakshi deleted the sumeenak_multi_asic_1 branch December 14, 2020 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants