pythonic icon indicating copy to clipboard operation
pythonic copied to clipboard

Auto connect docker tramp or activate

Open olymk2 opened this issue 6 years ago • 7 comments

Is there a way to just open a docker connection, looking at the code this does not happen because it uses tramp-file variable to determine if its a docker container which on first opening a project I do not have.

Looking for a more pragmatic / automated solution the project has a compose file so should just start using docker, if this is not possible I may add an activate-docker type method, but what are you thoughts would auto connect be okay or would you prefer an activate docker type function ?

olymk2 avatar Mar 12 '19 16:03 olymk2

Hi,

As I said earlier I prefer to keep activation function as generic as possible. So no specifics like pythonic-activate-pipenv-in-tox-in-docker-compose-project.

I'm not sure how you end up in a situation where you need to open tramp connection instantly?

Regards, Artem.

proofit404 avatar Mar 12 '19 17:03 proofit404

ah sorry forgot I had asked this before, I guess because I am working with pythonic directly in places I often run a function which results in pythonic using my local python instead of the one inside docker which I alsomost never want, so your basically saying an activate function would be external to pythonic ?

And because you already have pythonic activate for env seems like something similar should be available for the other options.

olymk2 avatar Mar 12 '19 18:03 olymk2

I mean pythonic-activate should support everything. Docker compose, pipenv, poetry, tox, etc.

proofit404 avatar Mar 12 '19 19:03 proofit404

ah perhaps I should be calling that in my custom code, I assume calling it multiple times is safe ?

olymk2 avatar Mar 12 '19 19:03 olymk2

Yes, it can.

But I don't think it's the right choice.

In my opinion pythonic-run and pythonic-start should check if current directory was activated or not.

proofit404 avatar Mar 12 '19 19:03 proofit404

okay thanks as always will have another stab tomorrow when at work :)

olymk2 avatar Mar 12 '19 20:03 olymk2

running pythonic activate requests an Env path, which I don't have and does not seem to be detecting and connecting to my running container :/

olymk2 avatar Mar 13 '19 09:03 olymk2