[Mellanox]Take advantage of sdk variable to customize the location where sdk_socket exists. (#4223)
Take advantage of an SDK environment variable to customize the location where sdk_socket exists. In the latest SDK sdk_socket has been moved from /tmp to /var/run which is a better place to contain this kind of file. However, this prevents the subdirs under /var/run from being mapped to different volumes. To resolve this, we take advantage of an SDK variable to designate the location of sdk_socket. This requires every process that requires to access sdk_socket have this environment variable defined. However, to define environment variable for each process is less scalable. We take advantage of the docker scope environment variable to avoid that. It depends on PR 4227
This commit is contained in:
parent
be549db395
commit
7d0570c517
@ -201,11 +201,15 @@ start() {
|
|||||||
{%- if sonic_asic_platform == "mellanox" %}
|
{%- if sonic_asic_platform == "mellanox" %}
|
||||||
{%- if docker_container_name == "syncd" %}
|
{%- if docker_container_name == "syncd" %}
|
||||||
-v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \
|
-v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \
|
||||||
-v mlnx_sdk_socket:/tmp \
|
-v mlnx_sdk_socket:/var/run/sx_sdk \
|
||||||
|
-v mlnx_sdk_ready:/tmp \
|
||||||
-v /dev/shm:/dev/shm:rw \
|
-v /dev/shm:/dev/shm:rw \
|
||||||
|
-e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \
|
||||||
{%- elif docker_container_name == "pmon" %}
|
{%- elif docker_container_name == "pmon" %}
|
||||||
-v /var/run/hw-management:/var/run/hw-management:rw \
|
-v /var/run/hw-management:/var/run/hw-management:rw \
|
||||||
-v mlnx_sdk_socket:/tmp \
|
-v mlnx_sdk_socket:/var/run/sx_sdk \
|
||||||
|
-v mlnx_sdk_ready:/tmp \
|
||||||
|
-e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \
|
||||||
-v /dev/shm:/dev/shm:rw \
|
-v /dev/shm:/dev/shm:rw \
|
||||||
{%- else %}
|
{%- else %}
|
||||||
--tmpfs /tmp \
|
--tmpfs /tmp \
|
||||||
|
@ -4,6 +4,8 @@ FROM docker-syncd-mlnx
|
|||||||
## Make apt-get non-interactive
|
## Make apt-get non-interactive
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN mkdir -p /var/run/sx_sdk
|
||||||
|
|
||||||
RUN apt-get purge -y syncd
|
RUN apt-get purge -y syncd
|
||||||
|
|
||||||
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
|
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
|
||||||
|
@ -4,6 +4,8 @@ FROM docker-config-engine-stretch
|
|||||||
ARG docker_container_name
|
ARG docker_container_name
|
||||||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
||||||
|
|
||||||
|
RUN mkdir -p /var/run/sx_sdk
|
||||||
|
|
||||||
## Make apt-get non-interactive
|
## Make apt-get non-interactive
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user