From ad1c0ae8b0c5999bcca59a69714d293254fe1481 Mon Sep 17 00:00:00 2001 From: Chris Sommers Date: Sat, 16 Jul 2022 17:11:16 -0700 Subject: [PATCH] Temporary workaround for container permissions issues per https://github.com/Azure/DASH/issues/143. Executes chmod as required. Permanent fix will require some Docker mods. --- dash-pipeline/Makefile | 25 +++++++++++++++---------- dash-pipeline/README.md | 11 +++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/dash-pipeline/Makefile b/dash-pipeline/Makefile index e3b695177..13b3a9350 100644 --- a/dash-pipeline/Makefile +++ b/dash-pipeline/Makefile @@ -1,9 +1,14 @@ SHELL = /bin/bash -all:p4 sai test +all:fix-perms p4 sai test PWD := $(shell pwd) +.PHONY: fix-perms +fix-perms: + @echo "### Applying Fix permissions workaround..." + sudo chmod -R o+rw SAI/ bmv2/ tests/ + # Default Docker images, override from env var # https://hub.docker.com/r/p4lang/p4c # p4lang version 971MB - works: @@ -42,7 +47,7 @@ SAI/SAI: .PHONY:clean -clean: kill-switch p4-clean sai-clean test-clean network-clean undeploy-ixiac +clean: fix-perms kill-switch p4-clean sai-clean test-clean network-clean undeploy-ixiac rm -rf bmv2/dash_pipeline.bmv2 make -C tests/vnet_out clean @@ -52,7 +57,7 @@ clean: kill-switch p4-clean sai-clean test-clean network-clean undeploy-ixiac P4_ARTIFACTS=bmv2/dash_pipeline.bmv2/dash_pipeline.json bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.txt -p4: bmv2/dash_pipeline.bmv2/dash_pipeline.json +p4: fix-perms bmv2/dash_pipeline.bmv2/dash_pipeline.json .PHONY:p4-clean p4-clean: @@ -89,9 +94,9 @@ $(P4_ARTIFACTS): $(P4_SRC) # TODO - create separate rules for headers, libsai.so .PHONY:sai -sai:sai-headers libsai +sai:fix-perms sai-headers libsai -sai-headers: p4 | SAI/SAI +sai-headers: fix-perms p4 | SAI/SAI @echo "Generate SAI library headers and implementation..." $(DOCKER_RUN) \ --name build_sai-$(USER) \ @@ -99,17 +104,17 @@ sai-headers: p4 | SAI/SAI ./generate_dash_api.sh # TODO - add SAI header dependencies -libsai: +libsai: fix-perms @echo "build libsai.so..." $(DOCKER_RUN) -w /SAI/lib \ $(DOCKER_BMV2_BLDR_IMG) \ make -libsai-clean: +libsai-clean:fix-perms -rm -rf SAI/lib/libsai.so .PHONY:sai-clean -sai-clean: SAI/SAI libsai-clean +sai-clean: fix-perms SAI/SAI libsai-clean @echo "Restoring SAI subdirectories to baseline..." rm -rf SAI/SAI/inc SAI/SAI/experimental SAI/SAI/meta cd SAI/SAI && git checkout -- inc experimental meta @@ -149,7 +154,7 @@ DOCKER_RUN_SAITHRIFT =\ -v $(PWD)/..:/dash -w /dash/dash-pipeline/SAI/saithrift \ $(DOCKER_SAITHRIFT_BLDR_IMG) \ -sai-thrift-server: +sai-thrift-server:fix-perms $(DOCKER_RUN_SAITHRIFT) \ make $@ @@ -180,7 +185,7 @@ test-clean: .PHONY:sai-test -sai-test:SAI/SAI SAI/lib/libsai.so +sai-test: fix-perms SAI/SAI SAI/lib/libsai.so $(DOCKER_RUN) \ --name dash-build-test-$(USER) \ -w /tests $(DOCKER_BMV2_BLDR_IMG) \ diff --git a/dash-pipeline/README.md b/dash-pipeline/README.md index 2254c8a81..d2dedce32 100644 --- a/dash-pipeline/README.md +++ b/dash-pipeline/README.md @@ -33,8 +33,15 @@ This is a P4 model of the DASH overlay pipeline which uses the [bmv2](https://gi - [Install docker-compose](#install-docker-compose) # Known Issues +<<<<<<< HEAD * P4 code doesn't loop packets back to same port. * P4 code mark-to-drop not set when meta.drop is set. +======= +* The vnet_out test via `make run-test` needs to be run to allow `run-ixiac-test` to pass. +* Prebuilt Docker image is too large , see [Desired Optimizations](#desired-optimizations). +* Docker images have permissions and ownership issues, see https://github.com/Azure/DASH/issues/143. Use `make fix-perms` as temporary workaround. + +>>>>>>> 5928f61... Temporary workaround for container permissions issues per https://github.com/Azure/DASH/issues/143. Executes chmod as required. Permanent fix will require some Docker mods. # TODOs ## Loose Ends Small items to complete given the exsting features and state, e.g. excluing major roadmap items. @@ -80,7 +87,11 @@ Eager to see it work? Try this: In one terminal: ``` +<<<<<<< HEAD make clean all run-switch +======= +make clean && make all network run-switch +>>>>>>> 5928f61... Temporary workaround for container permissions issues per https://github.com/Azure/DASH/issues/143. Executes chmod as required. Permanent fix will require some Docker mods. ``` In another terminal: ```