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 components #3269

Closed

Conversation

theasianpianist
Copy link
Contributor

@theasianpianist theasianpianist commented Aug 1, 2019

- What I did

  • 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 onie_platform in /host/machine.conf
  • add Systemd service to create network namespaces
  • 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

- How to verify it
Build should succeed - running the image on a single-ASIC platform should perform normally.
- Description for the changelog

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

Lawrence Lee added 4 commits July 30, 2019 13:14
* indicate 'virsh' should be run as sudo
* add instructions to get DHCP lease for SSH connections

Signed-off-by: Lawrence Lee <[email protected]>
* 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]>
…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]>
* 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]>
@@ -0,0 +1,2 @@
FROM debian:stretch
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this docker?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can use the database as the namespace container, all other containers will use the same namespace as the database container. we do not need a separate namespace container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have this since I start the namespaces, then the topology service is started, then the other containers start. I wanted to have the topology set up before any SONiC containers were started.

Copy link
Collaborator

Choose a reason for hiding this comment

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

topology service is only required for kvm image. it is not necessary to have topology build before all containers start. We can build topology after database docker started. in fact, the bgp session will not be able to setup until host interfaces are created.

the only hard requirement I see is that the peer links has to be start before the syncd docker starts. since syncd will link the peer device with the host interface.

platform/vs/sonic.xml Outdated Show resolved Hide resolved
platform/vs/sonic.xml Outdated Show resolved Hide resolved
--build-arg frr_user_uid=$(FRR_USER_UID) \
--build-arg frr_user_gid=$(FRR_USER_GID) \
--label Tag=$(SONIC_GET_VERSION) \
-t $* $($*.gz_PATH) $(LOG)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed if we want to keep the namespace container, since the docker build fails when it tries to squash the container

Copy link
Collaborator

Choose a reason for hiding this comment

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

so, it is tight to namespace container, let me resolve this in the conversation above.

slave.mk Outdated Show resolved Hide resolved
@@ -12,10 +12,12 @@
#define MAX_NUM_TARGETS 5
#define MAX_NUM_INSTALL_LINES 5
#define MAX_NUM_UNITS 128
#define NUM_ASICS 6
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 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.

I'm not really sure how else to get this information to the generator - later on it can probably read from a file somewhere.

@@ -0,0 +1,13 @@
DOCKER_NAMESPACE = docker-namespace.gz
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should remove this file

* remove extra line from slave.mk
* change namespace names to 'asic#'

Signed-off-by: Lawrence Lee <[email protected]>
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Aug 2, 2019
* use 'asic' as namespace prefix instead of 'namespace' in accordance
with PR sonic-net#3269

Signed-off-by: Lawrence Lee <[email protected]>
SuvarnaMeenakshi pushed a commit that referenced this pull request Dec 12, 2019
* use 'asic' as namespace prefix instead of 'namespace' in accordance
with PR #3269

Signed-off-by: Lawrence Lee <[email protected]>
(cherry picked from commit c1444e3)
@lguohan lguohan closed this May 21, 2020
mssonicbld added a commit that referenced this pull request Oct 11, 2024
…lly (#20457)

#### Why I did it
src/sonic-swss
```
* 766e7553 - (HEAD -> master, origin/master, origin/HEAD) Fix port up/bfd sessions bringup notification delay issue. (#3269) (35 hours ago) [Hua Liu]
```
#### How I did it
#### How to verify it
#### Description for the changelog
sschlafman pushed a commit to sschlafman/sonic-buildimage that referenced this pull request Oct 15, 2024
…lly (sonic-net#20457)

#### Why I did it
src/sonic-swss
```
* 766e7553 - (HEAD -> master, origin/master, origin/HEAD) Fix port up/bfd sessions bringup notification delay issue. (sonic-net#3269) (35 hours ago) [Hua Liu]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Oct 15, 2024
…lly (#20499)

#### Why I did it
src/sonic-swss
```
* b0ed969c - (HEAD -> 202405, origin/202405) Fix portmgr write partial port config to app DB issue. (#3304) (7 hours ago) [Hua Liu]
* b4e04631 - Fix port up/bfd sessions bringup notification delay issue. (#3269) (7 hours ago) [Hua Liu]
* 7ac0d4fc - Fix the issue where the test case randomly fails due to not waiting after updating the config DB. (#3323) (11 hours ago) [Hua Liu]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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