diff --git a/dash-pipeline/Makefile b/dash-pipeline/Makefile index df39811dc..daf3a7713 100644 --- a/dash-pipeline/Makefile +++ b/dash-pipeline/Makefile @@ -2,26 +2,26 @@ SHELL = /bin/bash HAVE_DPAPP ?= ifeq ($(HAVE_DPAPP),y) -VPP_LINK = veth4 -VPP_LINK_PEER = veth5 -SWITCH_PORT_VPP = --interface 2@$(VPP_LINK) +DPAPP_LINK = veth4 +DPAPP_LINK_PEER = veth5 +SWITCH_PORT_DPAPP = --interface 2@$(DPAPP_LINK) endif mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_dir := $(dir $(mkfile_path)) # "All" type targets for convenience -all:p4 sai saithrift-server docker-saithrift-client docker-saichallenger-client vpp test +all:p4 sai dpapp saithrift-server docker-saithrift-client docker-saichallenger-client test run-all-tests:run-libsai-test run-saithrift-client-tests run-saichallenger-tests run-saithrift-client-tests: run-saithrift-ptftests run-saithrift-pytests run-saithrift-client-dev-tests: run-saithrift-dev-ptftests run-saithrift-dev-pytests .PHONY:clean -clean: kill-all p4-clean sai-clean test-clean network-clean saithrift-server-clean vpp-clean +clean: kill-all p4-clean sai-clean dpapp-clean test-clean network-clean saithrift-server-clean rm -rf $(P4_OUTDIR) -kill-all: kill-saithrift-server kill-switch undeploy-ixiac kill-saichallenger-client kill-vpp +kill-all: kill-saithrift-server kill-dpapp kill-switch undeploy-ixiac kill-saichallenger-client PWD := $(realpath $(mkfile_dir)) DASH_USER ?=dashuser @@ -71,9 +71,9 @@ include dockerfiles/DOCKER_SAI_CHALLENGER_CLIENT_BLDR_IMG.env # SAIChallenger Client image built locally with saithrift client libs + PTF & Pytest frameworks DOCKER_SAI_CHALLENGER_CLIENT_IMG ?= local/dash-saichallenger-client:latest -# Run/compile vpp -# include file defines DOCKER_VPP_IMG -include dockerfiles/DOCKER_VPP_IMG.env +# Run/compile dpapp +# include file defines DOCKER_DPAPP_IMG +include dockerfiles/DOCKER_DPAPP_IMG.env # Set differently in CI scripts as needed, e.g. run switch container in -d mode DOCKER_FLAGS ?=-it @@ -263,9 +263,9 @@ run-saithrift-bldr-bash: /bin/bash ###################################### -# VPP date-plane app TARGETS +# bmv2 date-plane app TARGETS ###################################### -DOCKER_RUN_VPP = docker run\ +DOCKER_RUN_DPAPP = docker run\ $(DOCKER_FLAGS) \ -v $(PWD)/bmv2:/bmv2 \ -v $(PWD)/$(P4_OUTDIR)/dash_pipeline.json:/etc/dash/dash_pipeline.json \ @@ -277,37 +277,37 @@ DOCKER_RUN_VPP = docker run\ -u $(HOST_USER):$(HOST_GROUP) \ --rm \ -.PHONY:vpp vpp-clean -vpp-clean: - $(DOCKER_RUN_VPP) \ - --name dash-vpp-$(USER) \ - -w /dash/dash-pipeline/vpp-plugin $(DOCKER_VPP_IMG) \ +.PHONY:dpapp dpapp-clean +dpapp-clean: + $(DOCKER_RUN_DPAPP) \ + --name dash-dpapp-$(USER) \ + -w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \ make clean -vpp: - @echo "Compile vpp for date-plane app ..." - $(DOCKER_RUN_VPP) \ - --name dash-vpp-$(USER) \ - -w /dash/dash-pipeline/vpp-plugin $(DOCKER_VPP_IMG) \ +dpapp: + @echo "Compile dpapp for date-plane app ..." + $(DOCKER_RUN_DPAPP) \ + --name dash-dpapp-$(USER) \ + -w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \ make -run-vpp-bash: - $(DOCKER_RUN_VPP) \ +run-dpapp-bash: + $(DOCKER_RUN_DPAPP) \ --privileged \ - --name dash-vpp-$(USER) \ - -w /dash/dash-pipeline/vpp-plugin $(DOCKER_VPP_IMG) \ + --name dash-dpapp-$(USER) \ + -w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \ /bin/bash -run-vpp: $(VPP_LINK) - $(DOCKER_RUN_VPP) \ +run-dpapp: $(DPAPP_LINK) + $(DOCKER_RUN_DPAPP) \ --privileged \ -u root \ - --name dash-vpp-$(USER) \ - -w /dash/dash-pipeline/vpp-plugin $(DOCKER_VPP_IMG) \ - env HOST_INTERFACE=$(VPP_LINK_PEER) ./vpp.sh startup.conf + --name dash-dpapp-$(USER) \ + -w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \ + env HOST_INTERFACE=$(DPAPP_LINK_PEER) ./dpapp.sh startup.conf -kill-vpp: - -docker kill dash-vpp-$(USER) +kill-dpapp: + -docker kill dash-dpapp-$(USER) ###################################### # P4 Behavioral-model (switch) TARGETS @@ -325,7 +325,7 @@ run-switch: network simple_switch_grpc \ --interface 0@veth0 \ --interface 1@veth2 \ - $(SWITCH_PORT_VPP) \ + $(SWITCH_PORT_DPAPP) \ --log-console \ --no-p4 @@ -682,14 +682,14 @@ docker-publish-dash-grpc: ############################### -DOCKER_VPP_IMG_TAG = $(shell cat dockerfiles/Dockerfile.vpp | $(SHA1SUM)) -DOCKER_VPP_IMG = $(DOCKER_VPP_IMG_NAME):$(DOCKER_VPP_IMG_TAG) +DOCKER_DPAPP_IMG_TAG = $(shell cat dockerfiles/Dockerfile.dpapp | $(SHA1SUM)) +DOCKER_DPAPP_IMG = $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_TAG) -docker-dash-vpp: - { [ x$(ENABLE_DOCKER_PULL) == xy ] && docker pull $(DOCKER_VPP_IMG); } || \ +docker-dash-dpapp: + { [ x$(ENABLE_DOCKER_PULL) == xy ] && docker pull $(DOCKER_DPAPP_IMG); } || \ docker build \ - -f dockerfiles/Dockerfile.vpp \ - -t $(DOCKER_VPP_IMG) \ + -f dockerfiles/Dockerfile.dpapp \ + -t $(DOCKER_DPAPP_IMG) \ --build-arg user=$(DASH_USER) \ --build-arg group=$(DASH_GROUP) \ --build-arg uid=$(DASH_UID) \ @@ -697,23 +697,23 @@ docker-dash-vpp: --build-arg hostname=$(DASH_HOST) \ --build-arg available_processors=$(shell nproc) \ dockerfiles - [ -n $(DOCKER_VPP_IMG_CTAG) ] && \ - docker tag $(DOCKER_VPP_IMG) $(DOCKER_VPP_IMG_NAME):$(DOCKER_VPP_IMG_CTAG) + [ -n $(DOCKER_DPAPP_IMG_CTAG) ] && \ + docker tag $(DOCKER_DPAPP_IMG) $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_CTAG) -docker-pull-dash-vpp: - docker pull $(DOCKER_VPP_IMG) +docker-pull-dash-dpapp: + docker pull $(DOCKER_DPAPP_IMG) -docker-publish-dash-vpp: - @echo "Publish $(DOCKER_VPP_IMG) - requires credentials, can only do from DASH repo, not a fork" - docker push $(DOCKER_VPP_IMG) - [ -n $(DOCKER_VPP_IMG_CTAG) ] && \ - docker push $(DOCKER_VPP_IMG_NAME):$(DOCKER_VPP_IMG_CTAG) +docker-publish-dash-dpapp: + @echo "Publish $(DOCKER_DPAPP_IMG) - requires credentials, can only do from DASH repo, not a fork" + docker push $(DOCKER_DPAPP_IMG) + [ -n $(DOCKER_DPAPP_IMG_CTAG) ] && \ + docker push $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_CTAG) ############################### # BMV2-PKTGEN NETWORKING TARGETS ############################### -network:veth0 veth2 $(VPP_LINK) disable-ipv6 +network:veth0 veth2 $(DPAPP_LINK) disable-ipv6 veth0: /sys/class/net/veth0 /sys/class/net/veth0: @@ -733,25 +733,25 @@ veth2: /sys/class/net/veth2 sudo ip link set veth3 mtu 9500 ifeq ($(HAVE_DPAPP),y) -$(VPP_LINK): /sys/class/net/$(VPP_LINK) -/sys/class/net/$(VPP_LINK): - sudo ip link add name $(VPP_LINK) type veth peer name $(VPP_LINK_PEER) - sudo ip link set dev $(VPP_LINK) up - sudo ip link set dev $(VPP_LINK_PEER) up - sudo ip link set $(VPP_LINK) mtu 9500 - sudo ip link set $(VPP_LINK_PEER) mtu 9500 +$(DPAPP_LINK): /sys/class/net/$(DPAPP_LINK) +/sys/class/net/$(DPAPP_LINK): + sudo ip link add name $(DPAPP_LINK) type veth peer name $(DPAPP_LINK_PEER) + sudo ip link set dev $(DPAPP_LINK) up + sudo ip link set dev $(DPAPP_LINK_PEER) up + sudo ip link set $(DPAPP_LINK) mtu 9500 + sudo ip link set $(DPAPP_LINK_PEER) mtu 9500 endif disable-ipv6: - VPP_LINK=$(VPP_LINK) VPP_LINK_PEER=$(VPP_LINK_PEER) ./disable_veth_ipv6.sh + DPAPP_LINK=$(DPAPP_LINK) DPAPP_LINK_PEER=$(DPAPP_LINK_PEER) ./disable_veth_ipv6.sh # Delete veth's, test existence to avoid needless use of sudo network-clean: @-([ -e /sys/class/net/veth0 ] && sudo ip link delete dev veth0 && echo "Deleted veth0/1") || echo "No veth0, not deleting" @-([ -e /sys/class/net/veth2 ] && sudo ip link delete dev veth2 && echo "Deleted veth2/3") || echo "No veth2, not deleting" ifeq ($(HAVE_DPAPP),y) - @-([ -e /sys/class/net/$(VPP_LINK) ] && sudo ip link delete dev $(VPP_LINK) \ - && echo "Deleted $(VPP_LINK)") || echo "No $(VPP_LINK), not deleting" + @-([ -e /sys/class/net/$(DPAPP_LINK) ] && sudo ip link delete dev $(DPAPP_LINK) \ + && echo "Deleted $(DPAPP_LINK)") || echo "No $(DPAPP_LINK), not deleting" endif ############################### diff --git a/dash-pipeline/disable_veth_ipv6.sh b/dash-pipeline/disable_veth_ipv6.sh index 4e4ba9d6b..6d88b1349 100755 --- a/dash-pipeline/disable_veth_ipv6.sh +++ b/dash-pipeline/disable_veth_ipv6.sh @@ -21,16 +21,16 @@ sudo sysctl net.ipv6.conf.veth3.accept_ra=0 sudo sysctl net.ipv6.conf.veth3.accept_ra_pinfo=0 sudo sysctl net.ipv6.conf.veth3.router_solicitations=0 -if [ $VPP_LINK ]; then -sudo sysctl net.ipv6.conf.$VPP_LINK.autoconf=0 -sudo sysctl net.ipv6.conf.$VPP_LINK.accept_ra=0 -sudo sysctl net.ipv6.conf.$VPP_LINK.accept_ra_pinfo=0 -sudo sysctl net.ipv6.conf.$VPP_LINK.router_solicitations=0 +if [ $DPAPP_LINK ]; then +sudo sysctl net.ipv6.conf.$DPAPP_LINK.autoconf=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK.accept_ra=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK.accept_ra_pinfo=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK.router_solicitations=0 fi -if [ $VPP_LINK_PEER ]; then -sudo sysctl net.ipv6.conf.$VPP_LINK_PEER.disable_ipv6=1 -sudo sysctl net.ipv6.conf.$VPP_LINK_PEER.autoconf=0 -sudo sysctl net.ipv6.conf.$VPP_LINK_PEER.accept_ra=0 -sudo sysctl net.ipv6.conf.$VPP_LINK_PEER.accept_ra_pinfo=0 -sudo sysctl net.ipv6.conf.$VPP_LINK_PEER.router_solicitations=0 +if [ $DPAPP_LINK_PEER ]; then +sudo sysctl net.ipv6.conf.$DPAPP_LINK_PEER.disable_ipv6=1 +sudo sysctl net.ipv6.conf.$DPAPP_LINK_PEER.autoconf=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK_PEER.accept_ra=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK_PEER.accept_ra_pinfo=0 +sudo sysctl net.ipv6.conf.$DPAPP_LINK_PEER.router_solicitations=0 fi diff --git a/dash-pipeline/dockerfiles/DOCKER_VPP_IMG.env b/dash-pipeline/dockerfiles/DOCKER_DPAPP_IMG.env similarity index 58% rename from dash-pipeline/dockerfiles/DOCKER_VPP_IMG.env rename to dash-pipeline/dockerfiles/DOCKER_DPAPP_IMG.env index 4f62cc42c..a36e5dac8 100644 --- a/dash-pipeline/dockerfiles/DOCKER_VPP_IMG.env +++ b/dash-pipeline/dockerfiles/DOCKER_DPAPP_IMG.env @@ -1,5 +1,5 @@ # Define docker image repo/name:tag # Changing this will cause build/publish to occur in CI actions export DASH_ACR_REGISTRY=sonicdash.azurecr.io -export DOCKER_VPP_IMG_NAME?=${DASH_ACR_REGISTRY}/dash-vpp-bldr -export DOCKER_VPP_IMG_CTAG?=240814 +export DOCKER_DPAPP_IMG_NAME?=${DASH_ACR_REGISTRY}/dash-dpapp-bldr +export DOCKER_DPAPP_IMG_CTAG?=240827 diff --git a/dash-pipeline/dockerfiles/Dockerfile.vpp b/dash-pipeline/dockerfiles/Dockerfile.dpapp similarity index 96% rename from dash-pipeline/dockerfiles/Dockerfile.vpp rename to dash-pipeline/dockerfiles/Dockerfile.dpapp index bc4292431..0b90e0485 100644 --- a/dash-pipeline/dockerfiles/Dockerfile.vpp +++ b/dash-pipeline/dockerfiles/Dockerfile.dpapp @@ -1,4 +1,4 @@ -# This Dockerfile builds an image used to compile vpp for dash date-plane app. +# This Dockerfile builds an image used to compile/run dash date-plane app. FROM sonicdash.azurecr.io/dash-grpc:1.43.2 as grpc FROM p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32 LABEL maintainer="SONIC-DASH Community"