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

[mellanox]: Integrate CRIU tool to SYNCD docker container #2061

Merged
merged 1 commit into from
Sep 19, 2018
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
8 changes: 8 additions & 0 deletions platform/mellanox/criu.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CRIU_VERSION = 3.10

export CRIU_VERSION

CRIU = criu_$(CRIU_VERSION)-1_amd64.deb
$(CRIU)_SRC_PATH = $(PLATFORM_PATH)/criu
$(CRIU)_DEPENDS += $(LIBNL3_DEV)
SONIC_MAKE_DEBS += $(CRIU)
14 changes: 14 additions & 0 deletions platform/mellanox/criu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

MAIN_TARGET = criu_$(CRIU_VERSION)-1_amd64.deb

CRIU_DEPS = iptables,protobuf-c-compiler,protobuf-compiler,python-protobuf,libprotobuf-c1,python-future,python-ipaddr,libnet1,pkg-config,asciidoc,xmlto

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf criu
git clone -b v$(CRIU_VERSION) https://github.com/checkpoint-restore/criu.git
pushd criu
RUNDIR=/run/criu make
sudo checkinstall --default --install=no --fstrans=no --pkgversion=$(CRIU_VERSION) --maintainer='@' --requires=$(CRIU_DEPS) --pakdir=$(DEST)
3 changes: 2 additions & 1 deletion platform/mellanox/docker-syncd-mlnx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_SYNCD_MLNX = docker-syncd-mlnx.gz
$(DOCKER_SYNCD_MLNX)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx
$(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MLNX_SFPD)
$(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MLNX_SFPD) $(CRIU)
$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX)
ifneq ($(ENABLE_SYNCD_RPC),y)
Expand All @@ -13,3 +13,4 @@ $(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_MLNX)_RUN_OPT += --net=host --privileged -t
$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SYNCD_MLNX)_RUN_OPT += --tmpfs /run/criu
2 changes: 1 addition & 1 deletion platform/mellanox/docker-syncd-mlnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN apt-get install -y libxml2
RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python-protobuf libprotobuf-c1 python-future python-ipaddr libnet1 pkg-config asciidoc xmlto

RUN dpkg -i \
{% for deb in docker_syncd_mlnx_debs.split(' ') -%}
Expand Down
15 changes: 14 additions & 1 deletion sonic-slave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,20 @@ RUN apt-get update && apt-get install -y \
# For bash
texi2html \
# For initramfs
bash-completion
bash-completion \
#For Mellanox CRIU build
libprotobuf-dev \
libprotobuf-c0-dev \
protobuf-c-compiler \
protobuf-compiler \
python-protobuf \
pkg-config \
libnet1-dev \
libnet-dev \
libaio-dev \
asciidoc \
xmlto \
checkinstall

# For linux build
RUN apt-get -y build-dep linux
Expand Down