Comments (2)
Hi @derfl0 sorry for the delay, I've been busy with other things.
Currently python-on-whales doesn't support this. I would be happy to support it in the future. Though reading from stdin in python doesn't make much sense (it makes sense in a CLI).
What I would propose is that we find a good name for a new argument to this function: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/stack/#python_on_whales.components.stack.cli_wrapper.StackCLI.deploy and this argument would take a string as input. Inside the string would be the yaml of your stack. Would that work for you?
from python-on-whales.
Hey @gabrieldemarmiesse , no need to apologise as you work free of charge ;)
the proposed solution is exactly what I would need.
Talking about Stdin: Having a communication interface with the subprocess below would be awesome. Currently, in my native approach, I use the communicate method ( https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate )
Background: I use a mysql server and create databases on demand via a separate mysql client container. This involves a lot of very ugly escaping if it must be a one-line start parameter. It is way easier, if you just start the container and then use "communicate" to execute your commands one by one. Of course this does only work for local containers as swarm does not support exec on service/task. I can also open a different issue for this, if it is feature material.
# pseudo example
with docker.run("mysql", detach=True) as mysql_container:
print(mysql_container.communicate("show databases;"))
from python-on-whales.
Related Issues (20)
- `DockerClient.image.exists` using `podman` does not work
- Using python-on-whales installed via Poetry throws Pydantic errors HOT 7
- docker.compose.build is failing when passing a str variable in services HOT 1
- How to correctly capture DockerException? HOT 3
- latest python on whales fails with docker buildx 0.13 HOT 3
- compose.config fails with docker compose v2.25.0 HOT 3
- Function `docker.compose.down` does not accept optional list of service names HOT 2
- Cache-installed docker doesn't include the compose plugin HOT 3
- Avoid using `List` and `Dict` for function argument types HOT 3
- Add support for 'latest' and 'all' flags when applicable
- Implement `DockerClient.version()` HOT 2
- `DockerClient.info()` doesn't work with podman HOT 3
- Drop support for pydantic v1
- Incorrect type of `ValidPortMapping` HOT 1
- The docs do not display the argument list nicely when there is a long type
- SSH fingerpring HOT 1
- UnicodeDecodeError getting container output
- Should support passing encoding when getting container output
- Buildx CLI shouldn't require secrets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-on-whales.