docker

Why is python slower inside a docker container?

Why is python slower inside a docker container? Question: The following small code snippet times how long adding a bunch of numbers takes. import gc from time import process_time_ns gc.disable() # disable garbage collection for func in [ process_time_ns, ]: pre = func() s = 0 for a in range(100000): for b in range(100): s …

Total answers: 1

How to rerun docker-compose after modifying containerized python script

How to rerun docker-compose after modifying containerized python script Question: Docker newbie question here. I am working on containerizing my own Python script, following this tutorial and that tutorial. I noticed that when I fix an error in my Python script (myscript.py), this change is not seen upon rerunning sudo docker-compose up. I need to …

Total answers: 1

Install python package on a specific folder instead of user level

Install python package on a specific folder instead of user level Question: So I am currently working on a DevOps task for a Python repository. I am tasked with making the repository work properly with our Docker environment. My current issue is that when running pip3 install, it installs everything in various folders that have …

Total answers: 2

Jupyter Notebook cells not showing in code-server running in a docker

Jupyter Notebook cells not showing in code-server running in a docker Question: I want to use Jupyter notebooks in Code-Server in a docker. For whatever reasons I cant get it running and I also have/found no error messages that could help me finding the cause. Jupyter notebook files (ipynb) can be created and I can …

Total answers: 1

unable to pull python from official docker registry

unable to pull python from official docker registry Question: When I use docker pull python:3 it outputs: 3: Pulling from library/python 32fb02163b6b: Retrying in 1 second 167c7feebee8: Retrying in 1 second d6dfff1f6f3d: Retrying in 1 second e9cdcd4942eb: Waiting ca3bce705f6c: Waiting 5e1c6c4f8bbf: Waiting 2da42ff3382c: Waiting 86f9457966ab: Waiting 896264e2a03c: Waiting error pulling image configuration: download failed after …

Total answers: 1

When running containers, the server cannot connect to the database

When running containers, the server cannot connect to the database Question: I’ve got an issue where my Fastapi app image can’t connect to a database that’s also in a container But if you turn on the database and run the application not through docker, then everything works and the connection to the database is established …

Total answers: 1

Deploy a custom pipeline using Sagemaker SDK

Deploy a custom pipeline using Sagemaker SDK Question: I have been having a hard time to deploy my locally trained SKlearn model (pipeline with custom code + logistic model) to Sagemaker Endpoint. My Pipeline is as follows: All this custom code (RecodeCategorias) does is normalize and recode some categories columns into a "other" value, for …

Total answers: 2

uWSGI Segmentation Fault With Flask/Python App Behind Nginx After Running for ~24 hours

uWSGI Segmentation Fault With Flask/Python App Behind Nginx After Running for ~24 hours Question: Problem I have a Python/Flask app running in prod with uWSGI behind Nginx that deploys my personal projects via Docker. It works great for about 12-24 hours when it suddenly starts segfaulting. The app accepts requests and starts a Python thread …

Total answers: 1

How to cleanup RAM between program iterations using Python

How to cleanup RAM between program iterations using Python Question: Problem I have a Python application inside Docker container. The application receives "jobs" from some queue service (RabbitMQ), does some computing tasks and uploads results into database (MySQL and Redis). The issue I face is – the RAM is not properly "cleaned up" between iterations …

Total answers: 1