Comments (5)
Hi, thanks for your comment, and your patience with my slow reply. I think chaining of commands should be possible and easy to implement, but I am having a hard time picturing what the CLI structure would look like. Do you have some ideas?
Another possibility is just to chain different commands in a wrapper shell script (or via the REST API). That was my original intent with the Blockade CLI.
from blockade.
Hi, thanks for the reply.
My idea for the CLI was something like this:
blockade flaky --add --all
blockade duplicate --add --all
blockade slow --add --all
blockade flaky --rm --all
blockade duplicate --rm mycontainer1
The Result would be all container being slow and all but "mycontainer1" also duplicating packages
To keep track of this i would keep a dict for every container with its options:
mycontainer1:{duplicate=False, slow=True,flaky=False}
mycontainer2:{duplicate=True, slow=True,flaky=False}
mycontainer3:{duplicate=True, slow=True,flaky=False}
It would also make sense to have a way to apply all network options(flaky,slow,..) defined in a config file or by the Rest API at once.
I would also have to test which commands can be chained, because maybe its not possible to chain every command together.
What do you think about it ?
from blockade.
I'm not sure I understand your CLI example. Are those separate calls to blockade? If so that should already work. Blockade is already stateful - just the state about flaky/duplicated/etc is stored in the iptables or tc config of each container.
from blockade.
Yes They are separate calls and you are right that blockade is already stateful.
Sorry for explaining it so confusingly.
But as it is right now i cant have packet drop, duplicate packages and latency at the same time for a container. This is what i try to implement.
For that i would have to keep track of multiple states (eg flaky and slow at the same time)
from blockade.
Oh! I understand what you mean now. I think that is a useful feature, and I'd certainly welcome a pull request! I think it'd be best to avoid directly storing any additional state about the containers in blockade's internal state file (.blockade/
). This is to avoid cases where blockade's idea of a container's state gets out of sync with reality. If we calculate the state directly from the source of truth (tc
) everytime, there is less chance of bugs.
As far as the implementation, the key code to figure out is the TrafficControl
class in net.py
. Right now with every change we fully reset the qdisc state, but we'd need to make it respect your new --add
option to be additive instead. And also the network_state()
function needs to support detecting cases where the network is both e.g. slow and flaky. This would also need to be appropriately passed up through the CLI/API, so that blockade status
still works.
from blockade.
Related Issues (20)
- Use external UDN docker network HOT 1
- Improve logging
- Connection timeout
- Handle more than one connection at a time HOT 1
- multiple ports and networks in blockade.yml HOT 1
- UDP port expose support
- What would it take to add support for Docker Swarm please? HOT 1
- Networking with blockade - restrict communication HOT 4
- Is it possible to assign static IP address to the containers? HOT 1
- Is it possible to add a running container to blockade? HOT 1
- Blockade REST API Setup Parameters HOT 1
- net-tools is now a hard dependency HOT 2
- Error: a blockade already exists in here - you may want..
- How to use blockade API inside container HOT 1
- Support environment variables in volume names HOT 2
- Blockade install via pip broken for mac users HOT 2
- A few questions...
- Proposing a PR to fix a few small typos
- Blockade unable to start after image re-build HOT 2
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 blockade.