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

Build sonic-broadcom.bin using debug dockers for all stretch based dockers #2833

Merged
merged 29 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
941eb7d
Updated Makefile infrastructure to build debug images.
renukamanavalan Apr 5, 2019
042d51e
Dropped the regular binary using DBG_PACKAGES and a small name change…
renukamanavalan Apr 6, 2019
24f38f2
Tweaked the changes to retain the existing behavior w.r.t INSTALL_DEB…
renukamanavalan Apr 8, 2019
4443c70
1) slave.mk - Dropped unused Docker build args
renukamanavalan Apr 11, 2019
7b84e64
Reverted some changes, per review comments.
renukamanavalan Apr 11, 2019
c717e50
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 12, 2019
60a001c
Get in sync with the new update that filters out dockers to be built …
renukamanavalan Apr 12, 2019
cefc4b8
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 15, 2019
f659917
Mkae a template for each target that can be shared by all platforms.
renukamanavalan Apr 15, 2019
9d7aedb
A small change, that can fit better with other targets too.
renukamanavalan Apr 15, 2019
279084f
Extended debug to all stretch based docker images
renukamanavalan Apr 16, 2019
99783dd
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 18, 2019
a2297a3
1) Combined all orchagent makefiles into one platform independent mak…
renukamanavalan Apr 18, 2019
b4b30fd
Changes per review comments:
renukamanavalan Apr 18, 2019
575e43d
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 18, 2019
e504eb7
1) Corrected a copy/paste mistake
renukamanavalan Apr 18, 2019
0db6c0f
Fixed a copy/paste bug
renukamanavalan Apr 19, 2019
755dcee
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 22, 2019
6f1c92b
The base syncd dockers follow a template, which defines the base dock…
renukamanavalan Apr 22, 2019
3d74bcc
Fixed spelling mistake
renukamanavalan Apr 22, 2019
e537676
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 28, 2019
31fa832
Enable build of dbg-sonic-broadcom.bin, which uses dbg-dockers in pla…
renukamanavalan Apr 28, 2019
b9ced6f
Sync with master
renukamanavalan May 17, 2019
fbaabca
Merge remote-tracking branch 'upstream/master'
renukamanavalan May 20, 2019
af4d3da
Per review comments:
renukamanavalan May 20, 2019
fc019bb
Merge remote-tracking branch 'upstream/master'
renukamanavalan Jun 2, 2019
1ccee7d
Updated per comments.
renukamanavalan Jun 2, 2019
fe438f8
Removed changes that are no more warranted.
renukamanavalan Jun 2, 2019
3fcfc18
Merge branch 'master' into master
lguohan Jun 11, 2019
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
5 changes: 5 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ sudo chroot $FILESYSTEM_ROOT docker info
{% set imagename = imagefilename.split('.')|first -%}
sudo LANG=C chroot $FILESYSTEM_ROOT docker load < {{image}}
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagename}}:$(sonic_get_version)
{% if imagename.endswith('-dbg') %}
{% set imagebasename = imagename.replace('-dbg', '') -%}
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagebasename}}:$(sonic_get_version)
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagebasename}}:latest
{% endif %}
{% endfor %}
sudo chroot $FILESYSTEM_ROOT service docker stop
sudo rm $FILESYSTEM_ROOT/etc/init.d/docker
Expand Down
8 changes: 4 additions & 4 deletions onie-image.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ FILESYSTEM_DOCKERFS=dockerfs.tar.gz
DOCKERFS_DIR=docker

## Output file name for onie installer
OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE.bin
OUTPUT_ONIE_IMAGE=target/${IMAGE_PREFIX}sonic-$TARGET_MACHINE.bin

## Output file name for raw image
OUTPUT_RAW_IMAGE=target/sonic-$TARGET_MACHINE.raw
OUTPUT_RAW_IMAGE=target/${IMAGE_PREFIX}sonic-$TARGET_MACHINE.raw

## Raw image size in MB
RAW_IMAGE_DISK_SIZE=1024

## Output file name for kvm image
OUTPUT_KVM_IMAGE=target/sonic-$TARGET_MACHINE.img
OUTPUT_KVM_IMAGE=target/${IMAGE_PREFIX}sonic-$TARGET_MACHINE.img

## Kvm image size in GB
KVM_IMAGE_DISK_SIZE=16

## Output file name for aboot installer
OUTPUT_ABOOT_IMAGE=target/sonic-aboot-$TARGET_MACHINE.swi
OUTPUT_ABOOT_IMAGE=target/${IMAGE_PREFIX}sonic-aboot-$TARGET_MACHINE.swi
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is better to put dbg as a suffix instead of prefix. sonic-broadom-dbg.bin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


## Aboot boot image name
ABOOT_BOOT_IMAGE=.sonic-boot.swi
6 changes: 5 additions & 1 deletion platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sonic broadcom one image installer

SONIC_ONE_IMAGE = sonic-broadcom.bin
SONIC_ONE_IMAGE_STEM = sonic-broadcom
SONIC_ONE_IMAGE = $(SONIC_ONE_IMAGE_STEM).bin
$(SONIC_ONE_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
Expand Down Expand Up @@ -37,4 +38,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60A0_320FV2_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
$(SONIC_ONE_IMAGE)_DBG_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DBG_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
SONIC_DBG_INSTALLERS += $(DBG_IMAGE_MARK)-$(SONIC_ONE_IMAGE)
renukamanavalan marked this conversation as resolved.
Show resolved Hide resolved
98 changes: 98 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
PASSWORD="$(PASSWORD)" \
TARGET_MACHINE=$($*_MACHINE) \
IMAGE_TYPE=$($*_IMAGE_TYPE) \
IMAGE_PREFIX="" \
./build_image.sh $(LOG)

$(foreach docker, $($*_DOCKERS), \
Expand All @@ -664,6 +665,103 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \

SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS))

# targets for building debug installers with base image
$(addprefix $(TARGET_PATH)/, $(SONIC_DBG_INSTALLERS)) : $(TARGET_PATH)/$(DBG_IMAGE_MARK)-% : \
renukamanavalan marked this conversation as resolved.
Show resolved Hide resolved
.platform \
onie-image.conf \
build_debian.sh \
build_image.sh \
$$(addsuffix -install,$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_DEPENDS))) \
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_INSTALLS)) \
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_LAZY_INSTALLS)) \
$(addprefix $(STRETCH_DEBS_PATH)/,$(INITRAMFS_TOOLS) \
$(LINUX_KERNEL) \
$(SONIC_DEVICE_DATA) \
$(PYTHON_CLICK) \
$(LIBPAM_TACPLUS) \
$(LIBNSS_TACPLUS)) \
$$(addprefix $(TARGET_PATH)/,$$($$*_DBG_DOCKERS)) \
$$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \
$(addprefix $(STRETCH_FILES_PATH)/,$(IXGBE_DRIVER)) \
$(addprefix $(PYTHON_DEBS_PATH)/,$(SONIC_UTILS)) \
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) \
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2)) \
$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2))
$(HEADER)
# Pass initramfs and linux kernel explicitly. They are used for all platforms
export debs_path="$(STRETCH_DEBS_PATH)"
export python_debs_path="$(PYTHON_DEBS_PATH)"
export initramfs_tools="$(STRETCH_DEBS_PATH)/$(INITRAMFS_TOOLS)"
export linux_kernel="$(STRTCH_DEBS_PATH)/$(LINUX_KERNEL)"
export onie_recovery_image="$(FILES_PATH)/$(ONIE_RECOVERY_IMAGE)"
export kversion="$(KVERSION)"
export image_type="$($*_IMAGE_TYPE)"
export sonicadmin_user="$(USERNAME)"
export sonic_asic_platform="$(CONFIGURED_PLATFORM)"
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"
export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"
export installer_debs="$(addprefix $(STRETCH_DEBS_PATH)/,$($*_INSTALLS))"
export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(STRETCH_DEBS_PATH)/$(deb))))"
export installer_images="$(addprefix $(TARGET_PATH)/,$($*_DBG_DOCKERS))"
export config_engine_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE))"
export swsssdk_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SWSSSDK_PY2))"
export platform_common_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2))"
export redis_dump_load_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2))"

$(foreach docker, $($*_DBG_DOCKERS),\
export docker_image="$(docker)"
export docker_image_name="$(basename $(docker))"
export docker_container_name="$($(docker:-dbg.gz=.gz)_CONTAINER_NAME)"
$(eval $(docker:-dbg.gz=.gz)_RUN_OPT += $($(docker:-dbg.gz=.gz)_$($*_IMAGE_TYPE)_RUN_OPT))
export docker_image_run_opt="$($(docker:-dbg.gz=.gz)_RUN_OPT)"
j2 files/build_templates/docker_image_ctl.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
if [ -f files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 ]; then
j2 files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service
fi
chmod +x $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
)

export installer_start_scripts="$(foreach docker, $($*_DBG_DOCKERS),$(addsuffix .sh, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME)))"
export installer_services="$(foreach docker, $($*_DBG_DOCKERS),$(addsuffix .service, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME)))"
export installer_extra_files="$(foreach docker, $($*_DBG_DOCKERS), $(foreach file, $($(docker:-dbg.gz=.gz)_BASE_IMAGE_FILES), $($(docker:-dbg.gz=.gz)_PATH)/base_image_files/$(file)))"

j2 -f env files/initramfs-tools/union-mount.j2 onie-image.conf > files/initramfs-tools/union-mount
j2 -f env files/initramfs-tools/arista-convertfs.j2 onie-image.conf > files/initramfs-tools/arista-convertfs

j2 files/build_templates/updategraph.service.j2 > updategraph.service

$(if $($*_DBG_DOCKERS),
j2 files/build_templates/sonic_debian_extension.j2 > sonic_debian_extension.sh
chmod +x sonic_debian_extension.sh,
)

USERNAME="$(USERNAME)" \
PASSWORD="$(PASSWORD)" \
./build_debian.sh $(LOG)

USERNAME="$(USERNAME)" \
PASSWORD="$(PASSWORD)" \
TARGET_MACHINE=$($*_MACHINE) \
IMAGE_TYPE=$($*_IMAGE_TYPE) \
IMAGE_PREFIX="$(DBG_IMAGE_MARK)-" \
./build_image.sh $(LOG)

$(foreach docker, $($*_DBG_DOCKERS), \
rm -f $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
rm -f $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service
)

$(if $($*_DBG_DOCKERS),
rm sonic_debian_extension.sh,
)

chmod a+x $@
$(FOOTER)

SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_DBG_INSTALLERS))

###############################################################################
## Clean targets
###############################################################################
Expand Down