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] support warm/fast reboot for extension packages #7286

Merged
merged 35 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a624e0c
[dockers] Tag all docker images with a version number
stepanblyschak Sep 14, 2020
875650f
[dockers] Tag all docker images with a version number
stepanblyschak Sep 14, 2020
954cad9
[dockers] label SONiC Docker with manifest
stepanblyschak Nov 3, 2020
855fa60
[dockers] add package name to manifest
stepanblyschak Nov 16, 2020
44685ba
remove swss dependency from dhcp-relay & router-advertiser
stepanblyschak Nov 16, 2020
d337e08
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Jan 5, 2021
5eb48a9
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Jan 5, 2021
99d9d12
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Jan 13, 2021
ed1bd3f
remove sonic-sdk added by mistake in this change
stepanblyschak Jan 13, 2021
50237b4
Merge branch 'master' into dockers_version_tags
stepanblyschak Jan 13, 2021
caf5c9e
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Jan 18, 2021
31d4bbf
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Jan 21, 2021
823eede
[docker-macsec] add version number for docker-macsec
stepanblyschak Jan 21, 2021
bdf0113
Merge branch 'dockers_version_tags' of github.com:stepanblyschak/soni…
stepanblyschak Jan 21, 2021
05df4ed
[docker-macsec] add manifest for macsec docker
stepanblyschak Jan 21, 2021
e0735d2
[sonic_debian_extension.j2] fix merge conflict markers
stepanblyschak Jan 25, 2021
2066aa9
[dockers] use single manifest template
stepanblyschak Jan 29, 2021
422c245
tag SONiC images the old way
stepanblyschak Jan 30, 2021
5dd9278
Merge branch 'dockers_version_tags' into dockers_manifest
stepanblyschak Jan 30, 2021
888a0ea
check if docker has correct manifest after loading it
stepanblyschak Jan 30, 2021
53631d7
fix checking manifest
stepanblyschak Feb 15, 2021
a0d3124
Merge branch 'master' into dockers_manifest
stepanblyschak Mar 18, 2021
9d76601
Merge branch 'master' of github.com:azure/sonic-buildimage into docke…
stepanblyschak Mar 24, 2021
993d1c6
[SAE] warm/fast reboot services support
stepanblyschak Mar 24, 2021
808484b
add missing comma to manifest.json
stepanblyschak Mar 25, 2021
42109d7
fix finalize-warmboot
stepanblyschak Mar 25, 2021
3de0cb3
remove obsolete file
stepanblyschak Mar 25, 2021
a665d73
Merge branch 'dockers_manifest' of github.com:stepanblyschak/sonic-bu…
stepanblyschak Mar 25, 2021
5eff513
Merge branch 'dockers_manifest' into sae_p2_warm
stepanblyschak Mar 25, 2021
afc8473
[finalize-warmboot] fix bad substitution
stepanblyschak Mar 26, 2021
4431d7b
fix internal review comments
stepanblyschak Mar 30, 2021
58d4f21
Merge branch 'master' of github.com:azure/sonic-buildimage into sae_p…
stepanblyschak Apr 30, 2021
07b63ef
rebase on master
stepanblyschak Apr 30, 2021
6dd2062
remove redundant build-arg
stepanblyschak Apr 30, 2021
fb79f08
Merge branch 'master' of github.com:azure/sonic-buildimage into sae_p…
stepanblyschak Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion files/build_templates/manifest.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
"before": {{ before.split()|json if before is defined else [] }},
"dependent-of": {{ dependent_of.split()|json if dependent_of is defined else [] }},
"asic-service": {{ asic_service }},
"host-service": {{ host_service }}
"host-service": {{ host_service }},
"warm-shutdown": {
"after": {{ warm_shutdown_after.split()|json if warm_shutdown_after is defined else [] }},
"before": {{ warm_shutdown_before.split()|json if warm_shutdown_before is defined else [] }}
},
"fast-shutdown": {
"after": {{ fast_shutdown_after.split()|json if fast_shutdown_after is defined else [] }},
"before": {{ fast_shutdown_before.split()|json if fast_shutdown_before is defined else [] }}
}
},
"container": {
"privileged": {{ privileged if privileged else 'false' }},
Expand Down
3 changes: 3 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ j2 $BUILD_TEMPLATES/packages.json.j2 | sudo tee $FILESYSTEM_ROOT/$SONIC_PACKAGE_
# Copy docker_image_ctl.j2 for SONiC Package Manager
sudo cp $BUILD_TEMPLATES/docker_image_ctl.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/docker_image_ctl.j2

# Generate shutdown order
sudo LANG=C chroot $FILESYSTEM_ROOT /usr/local/bin/generate_shutdown_order.py

{% if include_kubernetes == "y" %}
## Pull in kubernetes docker images
echo "pulling universal k8s images ..."
Expand Down
7 changes: 7 additions & 0 deletions files/image_config/warmboot-finalizer/finalize-warmboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ declare -A RECONCILE_COMPONENTS=( \
["bgp"]="bgp" \
["nat"]="natsyncd" \
)

for reconcile_file in $(find /etc/sonic/ -iname '*_reconcile' -type f); do
file_basename=$(basename $reconcile_file)
docker_container_name=${file_basename%_reconcile}
RECONCILE_COMPONENTS[$docker_container_name]=$(cat $reconcile_file)
done

EXP_STATE="reconciled"

ASSISTANT_SCRIPT="/usr/local/bin/neighbor_advertiser"
Expand Down
4 changes: 4 additions & 0 deletions rules/docker-fpm-frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ $(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_FPM_FRR)_VERSION = 1.0.0
$(DOCKER_FPM_FRR)_PACKAGE_NAME = fpm-frr
$(DOCKER_FPM_FRR)_WARM_SHUTDOWN_BEFORE = swss
$(DOCKER_FPM_FRR)_WARM_SHUTDOWN_AFTER = radv
$(DOCKER_FPM_FRR)_FAST_SHUTDOWN_BEFORE = swss
$(DOCKER_FPM_FRR)_FAST_SHUTDOWN_AFTER = radv

SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR)

Expand Down
2 changes: 2 additions & 0 deletions rules/docker-lldp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ $(DOCKER_LLDP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_LLDP)_VERSION = 1.0.0
$(DOCKER_LLDP)_PACKAGE_NAME = lldp
$(DOCKER_LLDP)_WARM_SHUTDOWN_BEFORE = swss
$(DOCKER_LLDP)_FAST_SHUTDOWN_BEFORE = swss

SONIC_DOCKER_IMAGES += $(DOCKER_LLDP)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP)
Expand Down
2 changes: 2 additions & 0 deletions rules/docker-nat.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_NAT)_VERSION = 1.0.0
$(DOCKER_NAT)_PACKAGE_NAME = nat
$(DOCKER_NAT)_WARM_SHUTDOWN_BEFORE = swss
$(DOCKER_NAT)_FAST_SHUTDOWN_BEFORE = swss

ifeq ($(INCLUDE_NAT), y)
SONIC_DOCKER_IMAGES += $(DOCKER_NAT)
Expand Down
2 changes: 2 additions & 0 deletions rules/docker-orchagent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ $(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_ORCHAGENT)_VERSION = 1.0.0
$(DOCKER_ORCHAGENT)_PACKAGE_NAME = swss
$(DOCKER_ORCHAGENT)_WARM_SHUTDOWN_BEFORE = syncd
$(DOCKER_ORCHAGENT)_FAST_SHUTDOWN_BEFORE = syncd

SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT)
Expand Down
2 changes: 2 additions & 0 deletions rules/docker-router-advertiser.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_ROUTER_ADVERTISER)_VERSION = 1.0.0
$(DOCKER_ROUTER_ADVERTISER)_PACKAGE_NAME = radv
$(DOCKER_ROUTER_ADVERTISER)_WARM_SHUTDOWN_BEFORE = swss
$(DOCKER_ROUTER_ADVERTISER)_FAST_SHUTDOWN_BEFORE = swss

SONIC_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
Expand Down
2 changes: 2 additions & 0 deletions rules/docker-sflow.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ $(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_SFLOW)_VERSION = 1.0.0
$(DOCKER_SFLOW)_PACKAGE_NAME = sflow
$(DOCKER_SFLOW)_WARM_SHUTDOWN_BEFORE = swss
$(DOCKER_SFLOW)_FAST_SHUTDOWN_BEFORE = swss

SONIC_DOCKER_IMAGES += $(DOCKER_SFLOW)
ifeq ($(INCLUDE_SFLOW), y)
Expand Down
3 changes: 3 additions & 0 deletions rules/docker-teamd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ $(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)

$(DOCKER_TEAMD)_VERSION = 1.0.0
$(DOCKER_TEAMD)_PACKAGE_NAME = teamd
$(DOCKER_TEAMD)_WARM_SHUTDOWN_BEFORE = syncd
$(DOCKER_TEAMD)_WARM_SHUTDOWN_AFTER = swss
$(DOCKER_TEAMD)_FAST_SHUTDOWN_BEFORE = swss

SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD)
Expand Down
4 changes: 4 additions & 0 deletions rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ define generate_manifest
$(eval export after=$($(1).gz_SERVICE_AFTER))
$(eval export before=$($(1).gz_SERVICE_BEFORE))
$(eval export dependent_of=$($(1).gz_SERVICE_DEPENDENT_OF))
$(eval export warm_shutdown_after=$($*.gz_WARM_SHUTDOWN_AFTER))
$(eval export warm_shutdown_before=$($*.gz_WARM_SHUTDOWN_BEFORE))
$(eval export fast_shutdown_after=$($*.gz_FAST_SHUTDOWN_AFTER))
$(eval export fast_shutdown_before=$($*.gz_FAST_SHUTDOWN_BEFORE))
$(eval export privileged=$($(1).gz_CONTAINER_PRIVILEGED))
$(eval export volumes=$($(1).gz_CONTAINER_VOLUMES))
$(eval export tmpfs=$($(1).gz_CONTAINER_TMPFS))
Expand Down