Tag: python

StopIteration() after a few minutes of workers job

~20 minutes from the start of 4 workers with 4 processes per worker or 2 workers with 1 processes per worker I got 0 Active jobs in Celery Flower and StopIteration exception. I’m using PyPy2 5.6 x64 on Debian 8. Part of my venv: amqp (1.4.9) billiard (3.3.0.23) celery (3.1.25) greenlet (0.4.10) kombu (3.0.37) How […]

exposing Mongodb from docker container on server

I have Nodejs+Mongodb webapp running inside two separate docker containers I have 8080 for Nodejs and 27017 for Mongodb ports exposed in docker-compose.yml I use pymongo to submit data from my python script when I run it locally I am able to submit the data But when I run it on company (internal) server I […]

Dockerfile CMD script runs differently to running script manually in container

I have a dockerfile with the following end CMD python app/start.py arg1 arg2 arg3 And when I try calling run (through compose) it gives me an error from my python script: Traceback (most recent call last): File “app/start.py”, line 4, in <module> from utils.foo import bar ImportError: No module named ‘utils’ However, when I call […]

Python: running docker containers with sh and handling UTF-8 decoding errors

I have a Python program that is directly executed by Jenkins. This program uses the sh library to execute a docker container, via this function. Note that it is an important feature of this function that it display the subprocess‘s output as it executes: def run_command(*args, **kwargs): # pass the parent stream ‘tty’ state to […]

Running Windows Server Core in Docker Container

my Linux containers run like a charm, but the change to Windows Server in my Docker container makes me crazy! My Docker file doesn’t build although it is as simple as my linux Dockerfiles: FROM microsoft/windowsservercore #Install Chocolately RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command “(iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex)” ENV PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin #Install python RUN choco […]

Docker opencv3 Cmake errors

I tried to use docker to build up a Python3 + OpenCV3 with ffmpeg enabled environment. Since I also want to use GPU to speed up the model, I built using NVIDIA-docker image. Here is my Dockerfile: FROM nvidia/cuda:8.0-cudnn5-devel … … ############################################# # OpenCV 3 w/ Python 2.7 from Anaconda ############################################# RUN cd ~/ &&\ […]

How to use docker-compose with theano image?

I built a docker image for theano. This is the dockerfile I used: # Start with cuDNN base image FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04 # Install git, wget, python-dev, pip, BLAS + LAPACK and other dependencies RUN apt-get update && apt-get install -y \ gfortran \ git \ wget \ liblapack-dev \ libopenblas-dev \ python-dev \ python-pip \ […]

Separating dependencies for Celery container from Django container

We currently have a separate Docker container for Django and Celery but they share the same root files. I was wondering if there was a way to install OpenCV in the Celery container, because we use the package in celery tasks, but not in the Django container calling the celery task. When installing OpenCV in […]

Docker Remote API returns 500 error on create container

I’m using the Python requests library to send docker commands to a remote server. I cannot get it to create a new container. Are there certain parameters (data field) that are required on the POST command. The server always returns a 500 error. My request look like this. r1 = requests.post(“http://xxx.xxx.xx.xx:4243/containers/create?name=pycount”) I have tried with […]

Cython embed binary (docker): Failed to import the site module

I’m building Hello World using cython embed. Using docker python-3.5.3 image (Debian Jessie, with libpython3.5-dev additionaly installed) hello.py: print(‘hello world’) building: cython –embed -o hello.c hello.py gcc -I /usr/include/python3.5 -o hello hello.c -lpython3.5m After trying to run i get ImportError: Failed to import the site module Traceback (most recent call last): File “/usr/lib/python3.5/site.py”, line 580, […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.