Jump to content
  • 0

Problems with WD_SDK and Docker


lokobob99

Question

Hey everyone, 

I have a problem: I'm trying to dockerize an application which uses the WF_SDK package. The problem is, that Docker seems to not be able to install the WF_SDK out of the requirements.txt (See picture below).

Any help would be appreciated.

 

image.thumb.png.403cf459b293ad4524d9aecdfbb7ac7c.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Ok I have solved the problem by just adding the GitHub link into the requirements.txt :D

But now I have another problem: Whenever I start the container, I get the following error message:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/flask/__main__.py", line 3, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 1047, in main
    cli.main()
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 911, in run_command
    raise e from None
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 897, in run_command
    app = info.load_app()
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 312, in load_app
    app = locate_app(import_name, None, raise_if_not_found=False)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 218, in locate_app
    __import__(module_name)
  File "/FlaskVueServer/app.py", line 23, in <module>
    import function_generator
  File "/FlaskVueServer/function_generator.py", line 27, in <module>
    from WF_SDK import device, logic, pattern, wavegen
  File "/usr/local/lib/python3.8/site-packages/WF_SDK/__init__.py", line 5, in <module>
    from WF_SDK import device
  File "/usr/local/lib/python3.8/site-packages/WF_SDK/device.py", line 40, in <module>
    dwf = ctypes.cdll.LoadLibrary("libdwf.so")
  File "/usr/local/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libdwf.so: cannot open shared object file: No such file or directory

I think it has something to do with the last line: the socalled libdfw.so cannot be opened in the container.

 

This is the content of my Dockerfile:

 

FROM python:3.8-slim-buster

 

WORKDIR /FlaskVueServer

 

RUN apt-get update && apt-get install -y git

 

ADD function_generator.py /FlaskVueServer/function_generator.py

ADD oscilloscope.py /FlaskVueServer/oscilloscope.py

ADD dwfconstants.py /FlaskVueServer/dwfconstants.py

 

COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

 

COPY . .

 

CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]

 

 

Any help would be appreciated.

Kind regards

Edited by lokobob99
Link to comment
Share on other sites

  • 0

Hey @attila,

thanks for the answer. So I have downloaded those to files (.deb). Now I have added them to my Dockerfile, so my dockerfile looks like this:

 

 

# syntax=docker/dockerfile:1

 

FROM python:3.8-slim-buster

 

WORKDIR /FlaskVueServer

 

RUN apt-get update && apt-get install -y git

RUN dpkg -i ./digilent.adept.runtime_2.27.9-amd64.deb

RUN dpkg -i ./digilent.waveforms_3.19.5_amd64.deb

 

ADD function_generator.py /FlaskVueServer/function_generator.py

ADD oscilloscope.py /FlaskVueServer/oscilloscope.py

ADD dwfconstants.py /FlaskVueServer/dwfconstants.py

 

ENV LD_LIBRARY_PATH=/usr/lib/libdwf.so


 

COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

 

COPY . .

 

CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]

 

I have put the two files in the same directory as the dockerfile.

When I try to build this dockerfile, there is an error occuring:

dpkg: error: cannot access archive './digilent.adept.runtime_2.27.9-amd64.deb': No such file or directory

 

Maybe you can help me. Thank you!

 

 

 

Edited by lokobob99
Link to comment
Share on other sites

  • 0

Ok nevermind, I forgot to first use the COPY command.

So now my dockerfile looks like this:

 

# syntax=docker/dockerfile:1

 

FROM python:3.8-slim-buster

 

WORKDIR /FlaskVueServer

 

RUN apt-get update && apt-get install -y git


 

COPY digilent.adept.runtime_2.27.9-amd64.deb digilent.adept.runtime_2.27.9-amd64.deb

RUN dpkg -i ./digilent.adept.runtime_2.27.9-amd64.deb

 

ADD function_generator.py /FlaskVueServer/function_generator.py

ADD oscilloscope.py /FlaskVueServer/oscilloscope.py

ADD dwfconstants.py /FlaskVueServer/dwfconstants.py

 

ENV LD_LIBRARY_PATH=/usr/lib/libdwf.so


 

COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

 

COPY . .

 

CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]

 

 

But now when I try to install the file, I get an error message (look at the screenshot below).

Any help would be appreciated.

image.thumb.png.40d6cbe3e08e6126056f9fc07f457788.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...