2021-10-17 11:03:02 -05:00
|
|
|
##
|
|
|
|
## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES.
|
|
|
|
## Apache-2.0
|
|
|
|
##
|
|
|
|
## Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
## you may not use this file except in compliance with the License.
|
|
|
|
## You may obtain a copy of the License at
|
|
|
|
##
|
|
|
|
## http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
##
|
|
|
|
## Unless required by applicable law or agreed to in writing, software
|
|
|
|
## distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
## See the License for the specific language governing permissions and
|
|
|
|
## limitations under the License.
|
|
|
|
##
|
2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2022-04-27 19:39:37 -05:00
|
|
|
FROM docker-syncd-mlnx-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
2016-07-26 14:01:58 -05:00
|
|
|
|
|
|
|
## Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2020-03-09 14:36:56 -05:00
|
|
|
RUN mkdir -p /var/run/sx_sdk
|
|
|
|
|
2019-07-03 12:37:55 -05:00
|
|
|
RUN apt-get purge -y syncd
|
|
|
|
|
2016-07-26 14:01:58 -05:00
|
|
|
## Pre-install the fundamental packages
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get -y install \
|
|
|
|
net-tools \
|
2021-01-31 01:11:33 -06:00
|
|
|
python-setuptools \
|
2016-07-26 14:01:58 -05:00
|
|
|
build-essential \
|
|
|
|
libssl-dev \
|
|
|
|
libffi-dev \
|
|
|
|
python-dev \
|
|
|
|
wget \
|
|
|
|
cmake \
|
2021-02-10 04:26:31 -06:00
|
|
|
libqt5core5a \
|
|
|
|
libqt5network5 \
|
2022-05-10 04:45:28 -05:00
|
|
|
libboost-atomic1.74.0
|
|
|
|
|
|
|
|
# Build and install python-scapy
|
|
|
|
RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb --output python-scapy_2.4.0-2_all.deb \
|
|
|
|
&& dpkg -i python-scapy_2.4.0-2_all.deb \
|
|
|
|
&& apt install -f
|
|
|
|
|
|
|
|
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("debs/", docker_syncd_mlnx_rpc_debs.split(' '), "/debs/") }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if docker_syncd_mlnx_rpc_pydebs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("python-debs/", docker_syncd_mlnx_rpc_pydebs.split(' '), "/debs/") }}
|
|
|
|
{% endif %}
|
2021-02-10 04:26:31 -06:00
|
|
|
|
|
|
|
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
|
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
|
|
|
{{ install_debian_packages(docker_syncd_mlnx_rpc_debs.split(' ')) }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if docker_syncd_mlnx_rpc_pydebs.strip() -%}
|
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
|
|
|
{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }}
|
|
|
|
{% endif %}
|
|
|
|
|
2022-05-10 04:45:28 -05:00
|
|
|
# Install pip2 since it is no longer in the APT upstream
|
|
|
|
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
|
|
|
|
&& python2 get-pip.py
|
2021-02-10 04:26:31 -06:00
|
|
|
|
|
|
|
RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
|
2016-07-26 14:01:58 -05:00
|
|
|
&& tar xvfz 1.0.0.tar.gz \
|
|
|
|
&& cd nanomsg-1.0.0 \
|
|
|
|
&& mkdir -p build \
|
|
|
|
&& cmake . \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr nanomsg-1.0.0 \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& rm -f 1.0.0.tar.gz \
|
2021-01-31 01:11:33 -06:00
|
|
|
&& pip2 install cffi==1.7.0 \
|
|
|
|
&& pip2 install --upgrade cffi==1.7.0 \
|
|
|
|
&& pip2 install wheel \
|
|
|
|
&& pip2 install nnpy \
|
2016-07-26 14:01:58 -05:00
|
|
|
&& mkdir -p /opt \
|
|
|
|
&& cd /opt \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
|
|
|
|
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
|
2017-04-20 16:37:09 -05:00
|
|
|
&& rm -rf /root/deps
|
2016-07-26 14:01:58 -05:00
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
|
2019-06-22 13:26:23 -05:00
|
|
|
|
2019-07-03 12:37:55 -05:00
|
|
|
## Clean up
|
|
|
|
RUN apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
|
|
|
rm -rf /debs
|
|
|
|
|
2020-11-22 23:18:44 -06:00
|
|
|
ENTRYPOINT ["/usr/local/bin/supervisord"]
|