Skip to content

Commit

Permalink
[ci] Enable cache for marvell-arm64 build in PR checks. (sonic-net#15449
Browse files Browse the repository at this point in the history
)

Why I did it
Enable build cache for marvell-arm64 build to decrease PR check duration.

Work item tracking
Microsoft ADO (number only): 26340500
How I did it
How to verify it
  • Loading branch information
liushilongbuaa authored Jan 9, 2024
1 parent 1c3bf41 commit e30782b
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- script: |
[ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS)
BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS"
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf|marvell-arm64)$"; then
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS"
fi
Expand Down
8 changes: 8 additions & 0 deletions platform/marvell-arm64/docker-saiserver-mrvl.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DPATH := $($(DOCKER_SAISERVER_MRVL)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-saiserver-mrvl.mk $(PLATFORM_PATH)/docker-saiserver-mrvl.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_SAISERVER_MRVL)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_SAISERVER_MRVL)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SAISERVER_MRVL)_DEP_FILES := $(DEP_FILES)
8 changes: 8 additions & 0 deletions platform/marvell-arm64/docker-syncd-mrvl-rpc.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DPATH := $($(DOCKER_SYNCD_MRVL_RPC)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_SYNCD_MRVL_RPC)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_SYNCD_MRVL_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SYNCD_MRVL_RPC)_DEP_FILES := $(DEP_FILES)
10 changes: 10 additions & 0 deletions platform/marvell-arm64/docker-syncd-mrvl.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DPATH := $($(DOCKER_SYNCD_BASE)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mrvl.mk $(PLATFORM_PATH)/docker-syncd-mrvl.dep $(PLATFORM_PATH)/sai.mk
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_SYNCD_BASE)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SYNCD_BASE)_DEP_FILES := $(DEP_FILES)

$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_BASE),$(DOCKER_SYNCD_BASE_DBG)))
11 changes: 11 additions & 0 deletions platform/marvell-arm64/libsaithrift-dev.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/libsaithrift-dev.mk $(PLATFORM_PATH)/libsaithrift-dev.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen
$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " )))))

$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA
$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES)
$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path)))
$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS)
9 changes: 9 additions & 0 deletions platform/marvell-arm64/mrvl-prestera.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MPATH := $($(MRVL_PRESTERA_DEB)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/mrvl-prestera.mk $(PLATFORM_PATH)/mrvl-prestera.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files))

$(MRVL_PRESTERA_DEB)_CACHE_MODE := GIT_CONTENT_SHA
$(MRVL_PRESTERA_DEB)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MRVL_PRESTERA_DEB)_DEP_FILES := $(DEP_FILES)
$(MRVL_PRESTERA_DEB)_SMDEP_FILES := $(SMDEP_FILES)
1 change: 1 addition & 0 deletions platform/marvell-arm64/one-image.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(SONIC_ONE_IMAGE)_CACHE_MODE := none
9 changes: 9 additions & 0 deletions platform/marvell-arm64/platform-marvell.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MPATH := $($(AC5X_RD98DX35xx_PLATFORM)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/platform-marvell.dep $(PLATFORM_PATH)/platform-marvell.mk
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files))

$(AC5X_RD98DX35xx_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA
$(AC5X_RD98DX35xx_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(AC5X_RD98DX35xx_PLATFORM)_DEP_FILES := $(DEP_FILES)
$(AC5X_RD98DX35xx_PLATFORM)_SMDEP_FILES := $(SMDEP_FILES)
8 changes: 8 additions & 0 deletions platform/marvell-arm64/platform-nokia.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MPATH := $($(NOKIA_7215_PLATFORM)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/platform-nokia.mk $(PLATFORM_PATH)/platform-nokia.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(MPATH))

$(NOKIA_7215_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA
$(NOKIA_7215_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(NOKIA_7215_PLATFORM)_DEP_FILES := $(DEP_FILES)
9 changes: 9 additions & 0 deletions platform/marvell-arm64/rules.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include $(PLATFORM_PATH)/docker-saiserver-mrvl.dep
include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep
include $(PLATFORM_PATH)/docker-syncd-mrvl.dep
include $(PLATFORM_PATH)/libsaithrift-dev.dep
include $(PLATFORM_PATH)/mrvl-prestera.dep
include $(PLATFORM_PATH)/one-image.dep
include $(PLATFORM_PATH)/platform-marvell.dep
include $(PLATFORM_PATH)/platform-nokia.dep
include $(PLATFORM_PATH)/sai.dep
8 changes: 8 additions & 0 deletions platform/marvell-arm64/sai.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SPATH := $($(MRVL_SAI)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/sai.mk $(PLATFORM_PATH)/sai.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

$(MRVL_SAI)_CACHE_MODE := GIT_CONTENT_SHA
$(MRVL_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MRVL_SAI)_DEP_FILES := $(DEP_FILES)

0 comments on commit e30782b

Please sign in to comment.