Skip to content

Save fast-reboot state into the db #3741

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

Merged
merged 8 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion dockers/docker-base-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ RUN apt-get update && \
vim-tiny \
# Install dependencies of supervisor
python-pkg-resources \
python-meld3
python-meld3 \
# dependencies of redis-tools
libatomic1 \
libjemalloc1 \
liblua5.1-0 \
lua-bitop \
lua-cjson

{% if CONFIGURED_ARCH == "armhf" %}
# ip and ifconfig utility missing in docker for armhf
Expand Down
7 changes: 0 additions & 7 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ RUN apt-get update && \
iproute2 \
ndisc6 \
tcpdump \
# Install redis-tools dependencies
# TODO: implicitly install dependencies
libatomic1 \
libjemalloc1 \
liblua5.1-0 \
lua-bitop \
lua-cjson \
libelf1 \
libmnl0 \
bridge-utils
Expand Down
9 changes: 1 addition & 8 deletions dockers/docker-sonic-telemetry/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ RUN apt-get update && \
apt-get install -f -y \
libdbus-1-3 \
libdaemon0 \
libjansson4 \
# Install redis-tools dependencies
# TODO: implicitly install dependencies
libatomic1 \
libjemalloc1 \
liblua5.1-0 \
lua-bitop \
lua-cjson
libjansson4

{% if docker_sonic_telemetry_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down
9 changes: 1 addition & 8 deletions dockers/docker-teamd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ RUN apt-get update && \
libdbus-1-3 \
libdaemon0 \
libjansson4 \
libpython2.7 \
# Install redis-tools dependencies
# TODO: implicitly install dependencies
libatomic1 \
libjemalloc1 \
liblua5.1-0 \
lua-bitop \
lua-cjson
libpython2.7

{% if docker_teamd_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down
5 changes: 5 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ function postStartAction()
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
fi

if [[ "$BOOT_TYPE" == "fast" ]]; then
# set the key to expire in 3 minutes
redis-cli -n 6 SET "FAST_REBOOT|system" "1" "EX" "180"
fi

redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
fi

Expand Down
7 changes: 6 additions & 1 deletion files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ function getBootType()
TYPE='fastfast'
;;
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
TYPE=$(awk '{ if ($1 <= 180) print "fast"; else print "cold" }' /proc/uptime)
# check that the key exists
if [[ $(redis-cli -n 6 GET "FAST_REBOOT|system") == "1" ]]; then
TYPE='fast'
else
TYPE='cold'
fi
;;
*)
TYPE='cold'
Expand Down
2 changes: 1 addition & 1 deletion rules/docker-base-stretch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_BASE_STRETCH = docker-base-stretch.gz
$(DOCKER_BASE_STRETCH)_PATH = $(DOCKERS_PATH)/docker-base-stretch
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SUPERVISOR)
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SUPERVISOR) $(REDIS_TOOLS)
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SOCAT)

GDB = gdb
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-quagga