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

SONiC Application Extension HLD #682

Merged
merged 40 commits into from
May 13, 2021

Conversation

stepanblyschak
Copy link
Contributor

No description provided.

@stepanblyschak stepanblyschak force-pushed the sonic-app-ext-3 branch 5 times, most recently from 75c555e to e4ce54f Compare October 2, 2020 12:49
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Stepan Blyshchak added 2 commits October 9, 2020 14:29
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Stepan Blyshchak and others added 7 commits October 16, 2020 16:14
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
…inition

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
more clearly.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@mikelazar
Copy link
Contributor

mikelazar commented Oct 30, 2020

A few of comments/questions:

  1. This approach assumes that extensions need to follow the SONiC convention (use supervisord to start processes, use a per container rsyslogd to log, use systemd unit files to start containers at system). There are useful situations/use cases where this is not true - for instance when SONiC switches are used as "compute nodes" for applications designed to work in a generic container environment. In that case, using supervisord and rsyslog is not necessarily the case - there can be one microservice / container and no rsyslog (such applications use docker log drivers to log, for instance). Furthermore, such applications are designed to benefit from the automatic restart options of docker (e.g. --restart=unless-stopped) rather than the heavier systemd unit files. In other words, this approach forces users of SONiC to design their applications to be very SONiC centric, rather than generic.
  2. It will also be beneficial to allow the life cycle management (install and upgrade) of extension applications to be independent of SONiC. With the current approach, the assumption is that all extensions need to be reinstalled after SONiC is upgrade - or that they be included in the SONiC installation/upgrade.
  3. Is there an assumption that application extensions are supposed to use the SONiC Redis DB ? Could they use a completely different DB ?

I can imagine that we can address (1) by simply installing any container image in SONiC, however, it will also be useful to be able to integrate its CLI or management API's with SONiC, without the need for the application to follow the SONiC approach for using supervisord, rsyslogd and systemd unit files. However, (2) is harder to address - AFAIK the docker local registry in /var/lib/docker is completely overwritten during an upgrade. It would help to find a means to address this.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Contributor Author

@mikelazar

Hi, thank you for comments, here are my thoughts:

  1. The design was developed mainly for SONiC Docker container in mind. That is true, however, looking forward we understand the need to users to run non-SONiC Dockers. So, we enable users to install Dockers which are not SONiC specific - section in HLD. Hower, we need to think about potential limitations of such approach. The Application Extension infrastructure does not put any requirement on the Docker image itself - like, running specifically supervisord, use rsyslogd, etc, unless a manifest is provided by the user during installation as shown in the HLD section. However, there are other features in SONiC wich may add some requirements to the Docker image - like kubernetes support does about container state recording. Regarding, '--restart' docker option - this is not a constraint for a docker image, this is how SONiC manages container today, regardless of what container it is. If SONiC changes in the future to use docker auto-restart instead of systemd auto-restart then the Application Extension will auto-generate the start script to append '--restart' to the docker run options. In general, the use of systemd is necessary here if we want to use management CLI for generic dockers in the same way as for other SONiC dockers - e.g "config feature" CLI. My point is that Docker image does not care about who and how will start/stop/restart it.

  2. With the approach described in HLD SONiC-2-SONiC upgrade we will allow users to install arbitrary Docker images with "sonic-package-manager" and if user does the whole SONiC image upgrade then those user installed images will be installed automatically in the new image by "sonic_installer".

  3. The application is required to use SONiC database only if there is a requirement to support SONiC configuration model though CONFIG DB. If this is not the case then the Docker may not use SONiC database at all.
    Although, there is another question - what if the Docker requires data persistency? Let's say a Docker spawns it's own database process and the data should persist in case of restarts, reboots, upgrades. In such case I would suggest to choose a persistent storage on SONiC like /host or /etc/sonic or /var/log (depending of what this data actually is) and specify a mount in the manifest. Also, you can put a logic that will dump this data to this mounted path by writing a one-line bash script in 'pre-shutdown-action' field in the manifest. This is how I see data persistency could be achieved.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
-v /var/run/redis$DEV:/var/run/redis:rw \
$REDIS_MNT \
-v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \
-v /usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV:/usr/share/sonic/hwsku:ro \
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may not need these mount volumes for 3rd party dockers as they may not depend on SONiC resources? can we make it an optional field (e.g SONiC dependent docker vs non-dependent docker) in the manifest 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.

This is mentioned in https://github.com/Azure/SONiC/pull/682/files#diff-be6a02b89b88eb9dd23104151d3b06081dbc49c58c610f5f2aa5dfc5d1d4e13aR1298.

Normally, if you don't need these volume mounts you will not specify "depends": ["database"], or any other sonic container that has a dependency on database. In this case sonic-package-manager will know that these mounts are not needed.

Please, note, 3rd party dockers are not part of phase 1 implementation

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, thanks.


## Base OS API that a package uses

- SONiC utilities; Until CLI autogeneration, sonic utilities plugin system API incompatibility must be recorded by base OS major version increment

Choose a reason for hiding this comment

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

I think we should de-link the CLI autogeneration from this. If we think the sonic-utilities is part of the base-os, we should list here. Alternately, we can let other individual dockers to register their dependencies on sonic-utilities.

CLI is just one form of management, and even for CLI there are multiple models (linux-like, cisco-like etc). The base-os should not have any awareness of the CLI, or any UI.

So, I suggest we look at whether we need sonic-util as part of base-os, independent of a specific CLI model


- Package release ***happens on SONiC release/branch-out*** or on demand for single Docker image: ***sub-release***
- Manual version update ***is required*** when SONiC Package releases
- Within a release major and minor version ***must*** not change

Choose a reason for hiding this comment

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

Just to aid clarity - Within a SONIC release, the major and minor versions of the feature package must not change, i.e., any newer version of the feature package for that SONIC release, remains fully backward compatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, only bug fixes are allowed as usually for release branches

stepanblyschak and others added 8 commits February 12, 2021 17:42
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
renukamanavalan pushed a commit to sonic-net/sonic-utilities that referenced this pull request Apr 29, 2021
…anager (#1527)

What I did
Implemented sonic-package-manager utility to manager SONiC Packages as per HLD sonic-net/SONiC#682.
Implemented optional logic to migrate packages into new SONiC image in sonic-installer.

How I did it
Implemented as per HLD sonic-net/SONiC#682.

How to verify it
(Doc: sonic-net/SONiC#682)

install package
uninstall package
upgrade package
S2S upgrade

THANK YOU, Stepan!
renukamanavalan pushed a commit to sonic-net/sonic-utilities that referenced this pull request May 12, 2021
…#1378)

- What I did
Remove dhcp relay commands from sonic-utilities. dhcp-relay commands will come as a plugin with dhcp-relay docker installation.
See sonic-net/SONiC#682

- How I did it
Remove dhcp-relay commands from vlan. Make "show vlan brief" command table output extendable.

- How to verify it
Install dhcp-relay docker as app.ext. Verify that "config vlan dhcp-relay" and "show vlan brief" show dhcp data.
@liat-grozovik
Copy link
Collaborator

@renukamanavalan I believe it is time to merge this PR as the code is almost done and merged. Any objection?

@renukamanavalan renukamanavalan merged commit 10be585 into sonic-net:master May 13, 2021
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
…anager (sonic-net#1527)

What I did
Implemented sonic-package-manager utility to manager SONiC Packages as per HLD sonic-net/SONiC#682.
Implemented optional logic to migrate packages into new SONiC image in sonic-installer.

How I did it
Implemented as per HLD sonic-net/SONiC#682.

How to verify it
(Doc: sonic-net/SONiC#682)

install package
uninstall package
upgrade package
S2S upgrade

THANK YOU, Stepan!
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
…sonic-net#1378)

- What I did
Remove dhcp relay commands from sonic-utilities. dhcp-relay commands will come as a plugin with dhcp-relay docker installation.
See sonic-net/SONiC#682

- How I did it
Remove dhcp-relay commands from vlan. Make "show vlan brief" command table output extendable.

- How to verify it
Install dhcp-relay docker as app.ext. Verify that "config vlan dhcp-relay" and "show vlan brief" show dhcp data.
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 11, 2021
…packages (#7286)

#### Why I did it

I made this change to support warm/fast reboot for SONiC extension packages as per HLD sonic-net/SONiC#682.

#### How I did it

I extended manifest.json.j2 with new warm/fast reboot related fields and also extended sonic_debian_extension.j2 script template to generate the shutdown order files for warm and fast reboot.
judyjoseph pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Aug 7, 2021
…packages (#7286)

#### Why I did it

I made this change to support warm/fast reboot for SONiC extension packages as per HLD sonic-net/SONiC#682.

#### How I did it

I extended manifest.json.j2 with new warm/fast reboot related fields and also extended sonic_debian_extension.j2 script template to generate the shutdown order files for warm and fast reboot.
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…packages (sonic-net#7286)

#### Why I did it

I made this change to support warm/fast reboot for SONiC extension packages as per HLD sonic-net/SONiC#682.

#### How I did it

I extended manifest.json.j2 with new warm/fast reboot related fields and also extended sonic_debian_extension.j2 script template to generate the shutdown order files for warm and fast reboot.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…anager (#1527)

What I did
Implemented sonic-package-manager utility to manager SONiC Packages as per HLD sonic-net/SONiC#682.
Implemented optional logic to migrate packages into new SONiC image in sonic-installer.

How I did it
Implemented as per HLD sonic-net/SONiC#682.

How to verify it
(Doc: sonic-net/SONiC#682)

install package
uninstall package
upgrade package
S2S upgrade

THANK YOU, Stepan!
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
… (#1378)

- What I did
Remove dhcp relay commands from sonic-utilities. dhcp-relay commands will come as a plugin with dhcp-relay docker installation.
See sonic-net/SONiC#682

- How I did it
Remove dhcp-relay commands from vlan. Make "show vlan brief" command table output extendable.

- How to verify it
Install dhcp-relay docker as app.ext. Verify that "config vlan dhcp-relay" and "show vlan brief" show dhcp data.
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.

6 participants