Skip to content
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

localhost infrastructure #123

Closed
Skorpyon opened this issue Jul 31, 2017 · 1 comment · Fixed by #124
Closed

localhost infrastructure #123

Skorpyon opened this issue Jul 31, 2017 · 1 comment · Fixed by #124

Comments

@Skorpyon
Copy link

Skorpyon commented Jul 31, 2017

Is it any way how launch containers locally?

I have tried to create

# Infrastructure
@fabricio.tasks.infrastructure
def localhost():
    fab.env.roledefs.update(
        amqp=['anton@localhost'],
        reverse_proxy=['anton@localhost'],
        postgres=['anton@localhost'],
        tarantool=['anton@localhost'],
        backend=['anton@localhost'],
    )

but got error

Fatal error: Low level socket error connecting to host localhost on port 22: Unable to connect to port 22 on 127.0.0.1 (tried 1 time)

Underlying exception:
    Unable to connect to port 22 on 127.0.0.1
@renskiy
Copy link
Owner

renskiy commented Aug 1, 2017

You get this error due to lack of SSH daemon enabled on your localhost (Unable to connect to port 22 on 127.0.0.1). Try to enable it and start deploy again.

There is also workaround exists, you can deploy containers to localhost without SSH daemon enabled by monkeypatching fabricio.run method like this:

import fabricio
import functools

# Infrastructure
@fabricio.tasks.infrastructure
def localhost():
    fabricio.run = functools.partial(fabricio.local, capture=True)  # monkeypatch
    fab.env.roledefs.update(
        amqp=['anton@localhost'],
        reverse_proxy=['anton@localhost'],
        postgres=['anton@localhost'],
        tarantool=['anton@localhost'],
        backend=['anton@localhost'],
    )

renskiy added a commit that referenced this issue Oct 21, 2017
* #123, fabricio.local(): use capture=True by default

* local: print result

* do not use capture=True by default

* pass quiet further

* local() and run() are use same signature

* cache_key => cache_salt

* local(): cache_key => cache_salt

* improved documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants