Skip to content

Commit

Permalink
Temporary workaround for container permissions issues per sonic-net#143
Browse files Browse the repository at this point in the history
…. Executes chmod as required. Permanent fix will require some Docker mods.
  • Loading branch information
chrispsommers committed Jul 17, 2022
1 parent 3c15d95 commit 5928f61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 9 additions & 4 deletions dash-pipeline/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL = /bin/bash

all:p4 sai test
all:fix-perms p4 sai test

PWD := $(shell pwd)

Expand All @@ -20,13 +20,18 @@ DOCKER_RUN := docker run \
--rm \
$(DOCKER_FLAGS)

.PHONY: fix-perms
fix-perms:
@echo "### Applying Fix permissions workaround..."
sudo chmod -R o+rw SAI/ bmv2/ tests/

SAI/SAI:
@echo "Initializing SAI submodule..."
git submodule update --init

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:
Expand All @@ -48,7 +53,7 @@ $(P4_ARTIFACTS):
--p4runtime-files bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.json,bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.txt

.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
sudo rm -rf bmv2/dash_pipeline.bmv2
sudo make -C tests/vnet_out clean

Expand Down Expand Up @@ -79,7 +84,7 @@ kill-switch:

# TODO - create separate rules for headers, libsai.so
.PHONY:sai
sai: p4 | SAI/SAI
sai: fix-perms p4 | SAI/SAI
@echo "Generate SAI library headers and implementation..."
$(DOCKER_RUN) \
--name build_sai-$(USER) \
Expand Down
5 changes: 3 additions & 2 deletions dash-pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ The workflows described here are primarily driven by a [Makefile](Makefile) and
- [Committing new SAI submodule version](#committing-new-sai-submodule-version)

# Known Issues
* The vnet_out test via `make run-test` needs to be run to allow `run-ixiac-test` to pass. Need to understand why this is so.
* 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.

# TODOs
## Loose Ends
Expand Down Expand Up @@ -121,7 +122,7 @@ git checkout <branch>
## Super-quick approach for the adventurous!
In one terminal:
```
make clean all network run-switch
make clean && make all network run-switch
```
In another terminal:
```
Expand Down

0 comments on commit 5928f61

Please sign in to comment.