Closed openedhardware closed 3 years ago
Thank you @openedhardware for providing all this background info! This will be super helpful trying to repro the condition.
A couple of extra questions... Do you use the multiprocessing or threading packages by any chance? Where do you store the downloaded files? Is it local files to the container? Is it stored to a volume or maybe some kind of network file system?
Also curious... why did you do docker run
with --privileged
and --network host
?
@kcq
Thanks for your quick reply!
Yeah, I am using threading
in many classes, and the download URL is defined in a python file as a constant:
COCO_LABELS_URL = "https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names"
But some other URLs are created dynamically.. e.g.
S3_BASE_URL = "https://public-storage.s3.eu-central-1.amazonaws.com/OD/{}/{}.tar.xz"
download_url = S3_BASE_URL.format(first_variable, second_variable)
Downloaded files are stored at the volume mounted directory. Could be a problem?
--privileged
is used to access to the webcam and --network host
is used for the local node-red server.
Best Regards
Thanks for the clarifications @openedhardware ! One more question :) What base image are you using?
@kcq
FROM python:3.7-slim-buster
USER root
RUN apt-get update && apt-get install -y build-essential cmake apt-transport-https ca-certificates curl libgomp1 usbutils gnupg2 python3.7-dev wget
# OpenCV & Dlib dependencies
RUN apt-get install -y libgtk2.0-dev libgtk-3-dev libboost-all-dev
RUN pip3 install -U pip setuptools
WORKDIR /usr/src/app
COPY . ./
RUN pip3 install -r requirements.txt
CMD ["python3", "/usr/src/app/src/main.py"]
This is my Dockerfile
.
Thanks!
@kcq
Here is the content of the requirements.txt
fie:
redis
getmac
netifaces
requests
numpy
networkx==2.3
paho-mqtt
opencv-contrib-python
dlib
PyYAML
flake8
tensorflow==1.13.1
The protobuf
package(from tensorflow
) doesn't seem to be installed correctly?
@openedhardware thank you! curious... how are you using tensorflow and opencv?
working on a basic repro app... i'll keep expanding until it breaks :)
yes, something is going on with the protobuf package... it's most likely related to its non-python components
Hi, @kcq
Thanks for your help!
Yeah, non-python components are suffering.... Had to spend a day figuring out the requests
library issue..
Opencv & TF: I am normally using them to detect a person from the webcam.
Cheers
@openedhardware what's the relationship between the logic that downloads the files and opencv/TF?
That is to download the trained model files and label files. @kcq
I think docker-slim should work with any HTTP API calls?
I do have another container that scraps a bunch of websites, so couldn't specify how many URLs will be used as it downloads the target list from our server as well.
Is there any restriction? I am a newbie to docker-slim
, so I have no idea how it works internally.
Thanks for your help! 👍
@kcq
I have submitted a new issue for this issue as it failed to download a static file - https://github.com/docker-slim/docker-slim/issues/159
Thanks!
I have a python container that downloads files from various remote URLs including github & AWS S3.
Here is my build command:
I had to manually include the certification path which is used by
requests
package.And used the following command to start the slimified container:
But getting this error
It downloads
raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
which is configured as a constant value.What do I have to do to resolve
OSError: [Errno 16] Device or resource busy
issue?Cheers.