TUI in Container Cannot find KS Visa Libs

Bottomline: I can’t seem to hit a visa instrument/w TUI in a container because it cannot find the KS IO libraries (which are installed). Screen shot below summarizes the issue.


Hopefully this is my last issue with running the TUI in a container. When I am able to create a SCPI instrument and test step in the TUI, when the step is executed, an error is displayed that implies that the KS libraries are not being found. A screen capture showing the error message during execution is shown below. Here is a summary of the situation/environment:

  1. This is running in a docker that can ping the instrument
  2. If I run the docker with a pure python pyvisa and pyvisa-py backend (without the KS backend), I can run the *IDN? scpi command ok. (I have a special one-off container that loads up python, pyvisa, and pyvisa-py). I can also run an external browser to the instrument’s OEM web page from my host (laptop) and run the scpi command that way too, so I know the network is set up correctly.
  3. It’s difficult to get an SCPI instrument created in the TUI due to it locking up when trying to create a new instrument (I posted a different thread about that issue), but once in a while I can manage to get the instrument created and a subsequent SCPI test step created ok. I can then execute that test plan, but that is when the following error shows up. (see screen shot below)
  4. If I run another one-off docker with python, pyvisa, and the KS libraries, the python script that tries to run the SCPI command will fail, again with an error similar to that in the TUI: that the visa backend cannot be found (sorry I don’t have the exact error message that the python script displays)
  5. If I manage to get TUI to create an instrument and test step and save off the resulting /opt/tap/Settings/Bench/Default files, and then re-use those files in another newly created docker container (created with the same Dockerfile), then TUI doesn’t come up: it just locks up at a blank screen.

Hey @mescgroup

I can’t reproduce your issue. But it seems related to SCPI Instrument class.

Which version of OpenTAP are you using?

@stefan.holst - The ‘tap package list’ command lists this as the OpenTap version:

 - 9.16.1-alpha.4.7+04ed8a17.parameterAnnotationImprovement -
 installed - 
update available (9.16.2+f3c96b9f)

And this is the Dockerfile that we use:

# Creates an image/w opentap and KS libraries and
# a few linux network tools.
FROM opentapio/opentap:9.16-ubuntu18.04

RUN tap package install TUI --version any
RUN tap package install Demonstration

RUN  apt-get  update -y \
  && apt-get upgrade -y \
  && apt-get install iputils-ping -y \
  && apt-get install net-tools -y
CMD ["bash"]
RUN apt update
RUN apt upgrade -y
RUN apt install -y wget
RUN apt install libc6-dev libunwind8 curl git locales -y
RUN locale-gen en_US.UTF-8
RUN apt install unzip -y
RUN apt-get install lsb-core -y
# Make sure you have downloaded this file from keysight and that it exists
# in the host's project file before trying to copy this:
RUN chmod +x

# This command can fail with the error
# "This device is not connected to the network"
# if the docker build cannot get out to the internet.
# If you are building this on a Macs, try restarting 
# the docker engine and then re-building.
RUN ./ --mode unattended
RUN apt-get install python3-pip -y
RUN pip3 install -U pyvisa

ADD mytestplans mytestplans
ADD utils utils
# Extras

# these are for python visa driver if you are NOT using KS
# RUN apt-get install -y libusb-1.0-0
# RUN pip3 install pyvisa-py pyusb pyserial

# this is vim
RUN apt-get install vim -y

This is the build command script for the image:

# builds an ot docker image/w ks libs and tui

# remove old version of this container and image, if it exists
docker container rm -f ot > /dev/null 2>&1 
docker image rm -f ot > /dev/null 2>&1

# create the image anew, give it a name of "ot"
docker build -t ot .

And this is the script that runs the container:

# runs the ot image and creates new instance of
# a container

# remove the container if it is or was already running
docker rm -f ot > /dev/null 2>&1

# run the "ot" image and give resulting container
# a name of "ot"
docker run -it --network host --name ot ot

I updated the OTap to the latest/later version and that seemed to fix the issue with not being able to find the Visa libraries, but now this error occurs:

I can ping the IP of the instrument ok:

I have to abandon this effort for now (trying to run TUI and OpenTap test steps on a container) unless a magical fix appears. I was able to get the ContainerExpert GUI running inside the container, but it (the GUI) would just sit and spin with a splash screen of “Initializing…”. The ConnExpert also spew out a brief session setting string that implied that the session was using the correct IP (which was the IP of my Mac Host).

I’ve run out of ideas to try. FYI here is a screen capture of the ContainerExpert running in an Xterm (the GUI is actually behind the two command terminals):

UPDATE 11-18 Problem fixed, see the thread: Installing KeySight IO Lib on OpenTap Ubuntu Container for details

1 Like