-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't like to run inside docker #12
Comments
This error is caused by docker restricting the process_vm_readv system call we are using. I also think that you should be able to sample a python process from the host OS using py-spy (assuming docker on linux), but I haven't tested this yet =) |
I just tested this and it looks like it only works if the host (or other Docker) process is running the same version of Python, presumably because the libraries aren't around. Here's some log output from running:
where Edit: the first time I tried running py-spy on a Kubernetes cluster in a privileged Python 3.5 pod with |
Can confirm that works. Thank you. py2 docker run --rm --pid=host -it --cap-add=SYS_PTRACE -p 3000:3000 python:2.7 bash -c 'pip install py-spy; py-spy -- python -m SimpleHTTPServer 3000 .' py3 docker run --rm --pid=host -it --cap-add=SYS_PTRACE -p 3000:3000 python:3.7.0 bash -c 'pip install py-spy; py-spy -- python -m http.server --bind 0 3000' |
I added the below confg to my docker-compose but it had no impact trying to profile uwsgi
|
Same problem |
FWIW I was able to add
to my I'm also running as |
Add --cap-add SYS_PTRACE option helps me! |
I was able to add All you need to do is appending below snippet in the Deployment YAML: securityContext:
capabilities:
add:
- SYS_PTRACE
See https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/ for an example |
Running this inside a docker container, running as
root
. I'm getting the following error message.The text was updated successfully, but these errors were encountered: