Tag: python

Code from different git branches in one Python test

I have some machine learning code (but for the purposes of my question, it could be any algorithm) written in Python under git version control. My colleague has just concluded a significant refactor of the code base on a feature branch. Now I want to write some acceptance tests to make sure that the results […]

Run Worker Beanstalkt Tornado in docker container

I have an ioloop on my server written in python with Tornado. Here is my code : import tornado import beanstalkt def show(msg, value, cb): print(msg % value) cb() def stop(): client.close(ioloop.stop) def connect(s): print(‘Connection established’) reserve() def reserve(): client.reserve(callback=lambda s: show( “Reserved job %s”, s, lambda: delete(s[“id”]))) def delete(job_id): client.delete(job_id, callback=lambda s: show( “Deleted […]

Pyfora Initialization error

I am trying to configure pyfora on my local machine by following http://pyfora.readthedocs.io/en/stable/tutorials/onebox.html After successfully configuring and starting the pyfora daemon, I ran this block import pyfora pyfora.connect(‘http://localhost:30000’) But I got an error: ERROR:root:ObjectConverter failed to initialize: {‘responseType’: ‘Failure’, ‘message’: ‘Disconnected from server’, ‘messageId’: 0} Can someone please point out where am I going wrong

No module named django error when running any manage.py command in docker with docker-compose

I’m getting ImportError: No module named django when trying to up my containers running docker-compose up. Here’s my scenario: Dockerfile FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ docker-compose.yml version: ‘2’ services: db: image: postgres web: build: . command: bash -c “python […]

Python webscraper using selenium works normally but not when headless

I am using python, selenium and the Firefox web-driver to scrape a website over a couple of pages. One of those pages involves executing java-script to simulate clicking a button with an onclick action that changes an HTML table to raw csv. I am trying to get my web-scraper to run headlessly in a docker […]

Docker image with R (rocker/r.base) and python does not work when running on EC2, but local is fine

I have started using docker recently. Seems pretty exciting, the fact that you can build apps once and run them in any machine, sounds amazing! The truth is that I have experienced something else. I have an R image as a base (rocker/r.base) and I want to install python to it, so I can run […]

How to resolve Forbidden 403 error when making a urllib request with POST data in Django using Docker?

I have a three layer Django project that uses Docker. The first container is the front end and does all of the rendering, the second layer deals with logic for what to display on the front end and interacts with the database layer (third) by requesting JSON, and the third container/layer interacts directly with the […]

PyCharm giving Static path imports errors when using Docker

PyCharm does not recognise any paths to Static files when running in Docker interpreter environment. If I run the same project in local virtualenv path is recognised. Also PyCharm recognise module imports in Docker environment without any issues. For example > <!– This file stores project-specific CSS –> <link href=”{% static ‘css/project.css’ %}” rel=”stylesheet”> {% […]

Docker, dockercloud and Cron

I have a dockerfile which automates the building of an image. I am using the docker cloud, connected to Digital Ocean as the server. Within my dockerfile, I get the software I need, add the relevant GitHub repository containing the python scripts I wish to run. I then start the cron scheduler and add the […]

Tensorflow serving with Docker while the client is a Windows 7 machine

I have on my Linux Server some Tensorflow models updated with the Tensorflow Serving capability. I intend to serve those models where a client can profit from sending a Docker request to my server and pull an image of those models and use them. The client side is just a web app using Web2py that […]

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