Skip to content

Commit

Permalink
Merge pull request sonic-net#64 from mssonicbld/sonicbld/202205-merge
Browse files Browse the repository at this point in the history
[code sync] Merge code from sonic-net/sonic-buildimage:202205 to 202205
  • Loading branch information
mssonicbld authored Jul 14, 2023
2 parents b9bc814 + 56aabe0 commit 9b25536
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 16 deletions.
1 change: 1 addition & 0 deletions dockers/docker-config-engine-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN pip3 uninstall -y enum34

# Copy files
COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
COPY ["files/readiness_probe.sh", "/usr/bin/"]
COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"]

## Clean up
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-config-engine-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN pip3 uninstall -y enum34

# Copy files
COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
COPY ["files/readiness_probe.sh", "/usr/bin/"]
COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"]

## Clean up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bitarray==1.5.3
click==7.0
requests==2.31.0
requests==2.31.0
zipp==1.2.0
4 changes: 2 additions & 2 deletions files/build/versions/default/versions-git
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
https://chromium.googlesource.com/chromium/tools/depot_tools.git==247429efd9e04d492ff5fe756818661d7feb7889
https://chromium.googlesource.com/chromium/tools/depot_tools.git==e5277508c83c3dd1596504daf64b6ea8fe7d2dd1
https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f
https://github.com/CESNET/libyang.git==ea94c8b9f513f8a6ddc6ce1540fa41eaf4c8922a
https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6
https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b
https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287
https://github.com/flashrom/flashrom.git==b66f4766b5d7dc614ad609f27dd2794e06b5e2a4
https://github.com/FreeRADIUS/freeradius-server.git==02df5b27df68396150c6424d2a16618f361329af
https://github.com/FreeRADIUS/freeradius-server.git==b3b62feb5eb01ab0182b5962265b26b7715019e4
https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0
https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39
https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6
Expand Down
20 changes: 10 additions & 10 deletions files/build/versions/default/versions-mirror
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z
deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z
debian==20230708T000223Z
debian-security==20230708T000216Z
debian==20230711T000205Z
debian-security==20230711T000122Z
download.docker.com_linux_debian_dists_bullseye==2023-07-07T20:10:57Z
download.docker.com_linux_debian_dists_buster==2023-07-07T20:10:57Z
packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z
packages.trafficmanager.net_snapshot_debian-security_20230708T000216Z_dists_bullseye-security==2023-07-07T18:55:09Z
packages.trafficmanager.net_snapshot_debian-security_20230708T000216Z_dists_buster_updates==2023-07-07T18:55:09Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_bullseye==2023-06-10T08:52:21Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_bullseye-backports==2023-07-07T20:52:01Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_bullseye-updates==2023-07-07T20:52:01Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_buster==2023-06-10T08:53:33Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_buster-backports==2023-07-07T20:52:01Z
packages.trafficmanager.net_snapshot_debian_20230708T000223Z_dists_buster-updates==2023-06-10T08:55:10Z
packages.trafficmanager.net_snapshot_debian-security_20230711T000122Z_dists_bullseye-security==2023-07-10T21:32:37Z
packages.trafficmanager.net_snapshot_debian-security_20230711T000122Z_dists_buster_updates==2023-07-10T21:32:36Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_bullseye==2023-06-10T08:52:21Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_bullseye-backports==2023-07-10T20:15:45Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_bullseye-updates==2023-07-10T20:15:45Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_buster==2023-06-10T08:53:33Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_buster-backports==2023-07-10T20:15:45Z
packages.trafficmanager.net_snapshot_debian_20230711T000205Z_dists_buster-updates==2023-06-10T08:55:10Z
2 changes: 1 addition & 1 deletion platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LIBSAIBCM_XGS_VERSION = 7.1.36.4
LIBSAIBCM_XGS_VERSION = 7.1.54.4
LIBSAIBCM_DNX_VERSION = 7.1.42.4
LIBSAIBCM_BRANCH_NAME = REL_7.0_202205
LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)"
Expand Down
2 changes: 1 addition & 1 deletion platform/checkout/cisco-8000.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[module]
repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git
ref=202205.2.2.7
ref=202205.2.2.8
2 changes: 1 addition & 1 deletion rules/dhcprelay.dep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SPATH := $($(SONIC_DHCPRELAY)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dhcprelay.mk rules/dhcprelay.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files --recurse-submodules))

$(SONIC_DHCPRELAY)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_DHCPRELAY)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
Expand Down
1 change: 1 addition & 0 deletions rules/docker-config-engine-bullseye.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $(DOCKER_CONFIG_ENGINE_BULLSEYE)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE_PY3)
$(DOCKER_CONFIG_ENGINE_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_BASE_BULLSEYE)
$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $(SWSS_VARS_TEMPLATE)
$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT)
$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE)
$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT)

$(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_BASE_BULLSEYE)_DBG_DEPENDS) \
Expand Down
1 change: 1 addition & 0 deletions rules/docker-config-engine-buster.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $(DOCKER_CONFIG_ENGINE_BUSTER)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE_PY3)
$(DOCKER_CONFIG_ENGINE_BUSTER)_LOAD_DOCKERS += $(DOCKER_BASE_BUSTER)
$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $(SWSS_VARS_TEMPLATE)
$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT)
$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE)
$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT)

$(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS = $($(DOCKER_BASE_BUSTER)_DBG_DEPENDS) \
Expand Down
4 changes: 4 additions & 0 deletions rules/sonic-ctrmgrd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ $($(SONIC_CTRMGRD)_CFG_JSON)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH)
$(SONIC_CTRMGRD)_SERVICE = ctrmgrd.service
$($(SONIC_CTRMGRD)_SERVICE)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH)

$(SONIC_CTRMGRD)_HEALTH_PROBE = readiness_probe.sh
$($(SONIC_CTRMGRD)_HEALTH_PROBE)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH)

SONIC_PYTHON_WHEELS += $(SONIC_CTRMGRD)

$(SONIC_CTRMGRD)_FILES = $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT)
$(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT)
$(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_CFG_JSON)
$(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_SERVICE)
$(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE)

SONIC_COPY_FILES += $($(SONIC_CTRMGRD)_FILES)

35 changes: 35 additions & 0 deletions src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# This script is used by k8s to check the readiness of containers
# Check if the container is readiness or not, exit code 0 means readiness, others mean not readiness

#### exit code contract, k8s only cares zero or not none-zero, but we want to use none-zero code to indicate different error
# 0: readiness
# 1: if the hook script is python code, the default crash exit code is 1
# 2: supervisor start service doesn't exit normally
# other exit code: returned by post_check_script, define in the post_check_script, should not include 1,2

# check if the start service exists
# if the start service doesn't exist, do nothing
# if the start service exists, check if it exits normally
# if the start service doesn't exit normally, exit with code 2
pre_check_service_name="start"
no_process_string="ERROR (no such process)"
service_status=$(supervisorctl status $pre_check_service_name)
if [[ $service_status != *"$no_process_string"* ]] && [[ $(echo $service_status |awk '{print $2}') != 'EXITED' ]]; then
exit 2
fi

# feature owner can add their own readiness check script
# check if the post_check_script exists
# if the post_check_script exists, run it
# if the post_check_script exits with non-zero code, exit with the code
post_check_script="/usr/bin/readiness_probe_hook"
if [ -x $post_check_script ]; then
$post_check_script
post_check_result=$?
if [ $post_check_result != 0 ]; then
exit $post_check_result
fi
fi

exit 0

0 comments on commit 9b25536

Please sign in to comment.