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

Added rules to build syncd and orchagent containers for Cavium target #152

Merged
merged 5 commits into from
Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions platform/cavium/cavm-sai.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Cavium SAI

CAVM_LIBSAI = libsai.deb
$(CAVM_LIBSAI)_PATH = $(PLATFORM_PATH)/cavm_sdk
CAVM_SAI = sai.deb
$(CAVM_SAI)_PATH = $(PLATFORM_PATH)/cavm_sdk
XP_TOOLS = xp-tools.deb
$(XP_TOOLS)_PATH = $(PLATFORM_PATH)/cavm_sdk
XPSHELL = xpshell.deb
$(XPSHELL)_PATH = $(PLATFORM_PATH)/cavm_sdk

SONIC_COPY_DEBS += $(CAVM_LIBSAI) $(CAVM_SAI) $(XP_TOOLS) $(XPSHELL)
7 changes: 7 additions & 0 deletions platform/cavium/cavm_sdk/filelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Get vendor SAI SDK
## https:/Azure/sonic-buildimage/blob/master/README.md#3-get-vendor-sai-sdk

libsai.deb
sai.deb
xp-tools.deb
xpshell.deb
7 changes: 7 additions & 0 deletions platform/cavium/docker-orchagent-cavm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker image for orchagent

DOCKER_ORCHAGENT_CAVM = docker-orchagent-cavm.gz
$(DOCKER_ORCHAGENT_CAVM)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM)
7 changes: 7 additions & 0 deletions platform/cavium/docker-syncd-cavm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker image for cavium syncd

DOCKER_SYNCD_CAVM = docker-syncd-cavm.gz
$(DOCKER_SYNCD_CAVM)_PATH = $(PLATFORM_PATH)/docker-syncd-cavm
$(DOCKER_SYNCD_CAVM)_DEPENDS += $(SYNCD) $(CAVM_LIBSAI) $(XP_TOOLS) $(XPSHELL) $(REDIS_TOOLS)
$(DOCKER_SYNCD_CAVM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CAVM)
18 changes: 18 additions & 0 deletions platform/cavium/docker-syncd-cavm/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM docker-base

RUN apt-get update

COPY deps /deps

RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev

SED_DPKG
Copy link
Collaborator

Choose a reason for hiding this comment

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

SED_DPKG is superceded by jinj2 template in commit 66aebb3


COPY ["start.sh", "/usr/bin/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /deps

ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]
23 changes: 23 additions & 0 deletions platform/cavium/docker-syncd-cavm/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

export XP_ROOT=/usr/bin/

service rsyslog start

while true; do

# Check if redis-server starts

result=$(redis-cli ping)

if [ "$result" == "PONG" ]; then

redis-cli FLUSHALL
syncd -p /etc/ssw/AS7512/profile.ini -N
break

fi

sleep 1

done
26 changes: 9 additions & 17 deletions platform/cavium/rules.mk
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
include $(PLATFORM_GENERIC_PATH)/rules.mk

CAVM_LIBSAI = libsai.deb
$(CAVM_LIBSAI)_PATH = $(PLATFORM_PATH)/cavm_sdk
CAVM_SAI = sai.deb
$(CAVM_SAI)_PATH = $(PLATFORM_PATH)/cavm_sdk
XP_TOOLS = xp-tools.deb
$(XP_TOOLS)_PATH = $(PLATFORM_PATH)/cavm_sdk
XPSHELL = xpshell.deb
$(XPSHELL)_PATH = $(PLATFORM_PATH)/cavm_sdk
include $(PLATFORM_PATH)/cavm-sai.mk
include $(PLATFORM_PATH)/docker-syncd-cavm.mk
include $(PLATFORM_PATH)/docker-orchagent-cavm.mk

SONIC_COPY_DEBS += $(CAVM_LIBSAI) $(CAVM_SAI) $(XP_TOOLS) $(XPSHELL)
SONIC_ALL += $(DOCKER_SYNCD_CAVM) \
$(DOCKER_ORCHAGENT_CAVM)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You'll also need this line for building common dockers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, why do I need to replicate "$(DOCKER_SYNCD_CAVM)_DEPENDS" here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You need this one
include $(PLATFORM_GENERIC_PATH)/rules.mk
see e3b1268

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooh
Its already there
My fault, sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review

Copy link
Collaborator

Choose a reason for hiding this comment

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

This line was added in last commit
You just have to merge changes introduced in e3b1268

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


# TODO: Put dependencies for SDK packages
# Inject cavium sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(CAVM_SAI) $(CAVM_LIBSAI)

SONIC_ALL += $(SONIC_GENERIC) $(DOCKER_SYNCD_CAVM) $(DOCKER_ORCHAGENT) \
$(DOCKER_FPM)
# Runtime dependency on cavium sai is set only for syncd
$(SYNCD)_RDEPENDS += $(CAVM_SAI)

# Inject cavm sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(CAVM_LIBSAI)

# Runtime dependency on cavm sai is set only for syncd
$(SYNCD)_RDEPENDS += $(CAVM_LIBSAI)