Skip to content
Ondrej Fabry edited this page Dec 20, 2019 · 2 revisions

How to access VPP stats API running in container from host

# run in a container with shared IPC and mounted /run from VPP container's /run/vpp
docker run --rm -it --ipc="container:dcc33c2ee967" -v /var/lib/docker/overlay2/ed6f1cf6b67ee816c2aaa6199b750066b8e94802da3c7a5d5bfdd2daef97589b/merged/run/vpp:/run/vpp ligato/vpp-base vpp_get_stats ls
/sys/vector_rate
/sys/input_rate
/sys/last_update
/sys/last_stats_clear
/sys/heartbeat
/sys/node/clocks
/sys/node/vectors
/sys/node/calls
/sys/node/suspends
/if/names
# ...

How to access VPP CLI running in container from host

# symlink to /run/..
➢ sudo ln -s /var/lib/docker/overlay2/ed6f1cf6b67ee816c2aaa6199b750066b8e94802da3c7a5d5bfdd2daef97589b/merged/run/vpp/cli.sock /run/mycli.sock

# access from host normally
➢ sudo vppctl -s /run/mycli.sock
    _______    _        _   _____  ___ 
 __/ __/ _ \  (_)__    | | / / _ \/ _ \
 _/ _// // / / / _ \   | |/ / ___/ ___/
 /_/ /____(_)_/\___/   |___/_/  /_/    

vpp#

# or via another ad-hoc conainer
 docker run --rm -it -v /var/lib/docker/overlay2/ed6f1cf6b67ee816c2aaa6199b750066b8e94802da3c7a5d5bfdd2daef97589b/merged/run/vpp:/run/vpp ligato/vpp-base vppctl