Skip to content

Commit 514b38f

Browse files
Volodymyr Samotiylguohan
Volodymyr Samotiy
authored andcommitted
[mellanox]: Integrate CRIU tool to SYNCD docker container (sonic-net#2061)
Signed-off-by: Volodymyr Samotiy <[email protected]>
1 parent ef4ee9f commit 514b38f

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

platform/mellanox/criu.mk

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CRIU_VERSION = 3.10
2+
3+
export CRIU_VERSION
4+
5+
CRIU = criu_$(CRIU_VERSION)-1_amd64.deb
6+
$(CRIU)_SRC_PATH = $(PLATFORM_PATH)/criu
7+
$(CRIU)_DEPENDS += $(LIBNL3_DEV)
8+
SONIC_MAKE_DEBS += $(CRIU)

platform/mellanox/criu/Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.ONESHELL:
2+
SHELL = /bin/bash
3+
.SHELLFLAGS += -e
4+
5+
MAIN_TARGET = criu_$(CRIU_VERSION)-1_amd64.deb
6+
7+
CRIU_DEPS = iptables,protobuf-c-compiler,protobuf-compiler,python-protobuf,libprotobuf-c1,python-future,python-ipaddr,libnet1,pkg-config,asciidoc,xmlto
8+
9+
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
10+
rm -rf criu
11+
git clone -b v$(CRIU_VERSION) https://github.com/checkpoint-restore/criu.git
12+
pushd criu
13+
RUNDIR=/run/criu make
14+
sudo checkinstall --default --install=no --fstrans=no --pkgversion=$(CRIU_VERSION) --maintainer='@' --requires=$(CRIU_DEPS) --pakdir=$(DEST)

platform/mellanox/docker-syncd-mlnx.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DOCKER_SYNCD_MLNX = docker-syncd-mlnx.gz
44
$(DOCKER_SYNCD_MLNX)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx
5-
$(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MLNX_SFPD)
5+
$(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MLNX_SFPD) $(CRIU)
66
$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
77
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX)
88
ifneq ($(ENABLE_SYNCD_RPC),y)
@@ -13,3 +13,4 @@ $(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd
1313
$(DOCKER_SYNCD_MLNX)_RUN_OPT += --net=host --privileged -t
1414
$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
1515
$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
16+
$(DOCKER_SYNCD_MLNX)_RUN_OPT += --tmpfs /run/criu

platform/mellanox/docker-syncd-mlnx/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ debs/{{ deb }}{{' '}}
1414
{%- endfor -%}
1515
debs/
1616

17-
RUN apt-get install -y libxml2
17+
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
1818

1919
RUN dpkg -i \
2020
{% for deb in docker_syncd_mlnx_debs.split(' ') -%}

sonic-slave/Dockerfile

+14-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,20 @@ RUN apt-get update && apt-get install -y \
230230
# For bash
231231
texi2html \
232232
# For initramfs
233-
bash-completion
233+
bash-completion \
234+
#For Mellanox CRIU build
235+
libprotobuf-dev \
236+
libprotobuf-c0-dev \
237+
protobuf-c-compiler \
238+
protobuf-compiler \
239+
python-protobuf \
240+
pkg-config \
241+
libnet1-dev \
242+
libnet-dev \
243+
libaio-dev \
244+
asciidoc \
245+
xmlto \
246+
checkinstall
234247

235248
# For linux build
236249
RUN apt-get -y build-dep linux

0 commit comments

Comments
 (0)