Skip to content
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
41 changes: 41 additions & 0 deletions dockers/docker-ptf-sai/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-ptf

# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Set the apt source, update package cache and install necessary packages
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y \
python3-pip

RUN pip3 install crc16 \
netifaces \
getmac \
packet_helper \
psutil \
scapy==2.4.4 \
scapy_helper \
pysubnettree \
xmlrunner

COPY \
{% for deb in docker_ptf_sai_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_ptf_sai_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

# Remove old ptf package
RUN dpkg -r python-ptf

# Install new ptf package
RUN git clone https://github.com/p4lang/ptf.git \
&& cd ptf \
&& python3.7 setup.py install --single-version-externally-managed --record /tmp/ptf_install.txt
8 changes: 8 additions & 0 deletions platform/vs/docker-ptf-sai.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DPATH := $($(DOCKER_PTF_SAI)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-ptf-sai.mk platform/vs/docker-ptf-sai.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_PTF_SAI)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PTF_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_PTF_SAI)_DEP_FILES := $(DEP_FILES)
9 changes: 9 additions & 0 deletions platform/vs/docker-ptf-sai.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# docker image for docker-ptf-sai

DOCKER_PTF_SAI = docker-ptf-sai.gz
DOCKER_PTF_BASE = docker-ptf.gz
$(DOCKER_PTF_SAI)_PATH = $(DOCKERS_PATH)/docker-ptf-sai
$(DOCKER_PTF_SAI)_DEPENDS += $(LIBTHRIFT_0_14_1) $(PYTHON3_THRIFT_0_14_1)
$(DOCKER_PTF_SAI)_LOAD_DOCKERS += $(DOCKER_PTF_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_SAI)
SONIC_BUSTER_DOCKERS += $(DOCKER_PTF_SAI)
1 change: 1 addition & 0 deletions platform/vs/rules.dep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include $(PLATFORM_PATH)/docker-sonic-vs.dep
include $(PLATFORM_PATH)/docker-syncd-vs.dep
include $(PLATFORM_PATH)/docker-gbsyncd-vs.dep
include $(PLATFORM_PATH)/docker-ptf.dep
include $(PLATFORM_PATH)/docker-ptf-sai.dep
include $(PLATFORM_PATH)/libsaithrift-dev.dep
include $(PLATFORM_PATH)/one-image.dep
include $(PLATFORM_PATH)/onie.dep
Expand Down
1 change: 1 addition & 0 deletions platform/vs/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include $(PLATFORM_PATH)/docker-sonic-vs.mk
include $(PLATFORM_PATH)/docker-syncd-vs.mk
include $(PLATFORM_PATH)/docker-gbsyncd-vs.mk
include $(PLATFORM_PATH)/docker-ptf.mk
include $(PLATFORM_PATH)/docker-ptf-sai.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/onie.mk
Expand Down