Docker Remote Interpreter

I'm trying to debug some code I'm creating for Apache's airflow software. I want to use docker as my remote interpreter. When the docker image preinstalled for airflow spins up.. it needs to run a few steps. First it needs to run 'airflow initdb' and then 'airflow scheduler'. This gets the environment ready. After that, i want to run 'airflow test'. 'airflow test' is an airflow function. It will start my python code and I want the IDE to attach to that code and let me step through it. To get 'airflow initdb' and 'airflow scheduler' to run, I put it in a script that is used as my ENTRYPOINT. However, when i run debug with that remote interpreter, it doesn't seem to run my entrypoint script. It just runs the script I've specified in my debug config, 'airflow test'. TO me, my example is similar to the Django example provide in the PyCharm documentation, except that allows you to run manage.py to setup prereqs in the environment. How can i do something similar to set pre-reqs in my docker environment before my indicated debug script is run?

I've tried Docker remote interpreter, I've tried DockerCompose remote interpreter. Nothing seems to work. Both seem to ignore the ENTRYPOINT defined in the dockerfile. 

0
2 comments
Avatar
Permanently deleted user

Hi, did you solve your problem? I have the same problem, could you please help?

0

Most likely your entrypoint replaces all the arguments PyCharm passes for the debugger to work.

Try adding exec "$@" to your entrypoint script as mentioned in this comment https://youtrack.jetbrains.com/issue/PY-42364#focus=Comments-27-4144438.0-0

0

Please sign in to leave a comment.