Code Monkey home page Code Monkey logo

Comments (5)

labisso avatar labisso commented on September 28, 2024

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.

mkotzerke avatar mkotzerke commented on September 28, 2024

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.

labisso avatar labisso commented on September 28, 2024

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.

mkotzerke avatar mkotzerke commented on September 28, 2024

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.

labisso avatar labisso commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.