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

Refactoring? #562

Closed
mark-i-m opened this issue Jun 19, 2017 · 12 comments
Closed

Refactoring? #562

mark-i-m opened this issue Jun 19, 2017 · 12 comments

Comments

@mark-i-m
Copy link
Contributor

One of the cool ideas brought up (by @md678685) was making the code more modular.

I think this would really make our lives a lot easier, and hopefully encourage people to hack on different parts... I see two options:

  1. Make a different repo for each component. The core repo would contain the restarting/updating code. There would also be a separate repo with shared code/libraries (such as github api stuff). Then, all of the other subsystems can live in their own repo. Upside: Cleaner organization and enforces modularity of components. Downside: More complex to manage starting/stopping components and coordinating PRs with multi-component parts might require some engineering (which I think might be solved by a issue command such as @chaosbot depends on #Chaosthebot/Chaos#600 or something).

  2. Use a strict well-designed directory/module hierarchy and enforce by conventions. (I personally lean here)

@Redmega
Copy link

Redmega commented Jun 20, 2017

I lean 2 as well. Multiple repos would be super interesting but might prove to be complicated to orchestrate. I'm interested in others thoughts on this.

@mpnordland
Copy link

My idea is that we break the code into plugins (Some options for how we do that are here: http://wehart.blogspot.com/2009/01/python-plugin-frameworks.html). The idea being that plugins are sandboxed so that if an error occurs and a plugin crashes, it won't kill the core code, and could possibly be immediately restarted.

@Redmega
Copy link

Redmega commented Jun 20, 2017

That's assuming all the modules will be in python though. I'd be interested in making a node module.

Maybe we can have different central language hubs which connect to a central controller.

@mpnordland
Copy link

Well, we could, it would in fact make the separation more pronounced, we'd need a central core that would spawn child processes and some kind of ipc.

@Swizz
Copy link
Member

Swizz commented Jun 20, 2017

And how about multi modules living into the same repository ?

@mdcfe
Copy link
Contributor

mdcfe commented Jun 20, 2017

I don't think I was the first to suggest modularity :p

I was thinking that the "core" would be the "central controller", as suggested by @Redmega, and would launch components either as child processes or daemons and have a common protocol to interact with it from modules (perhaps through a Unix/TCP socket), as suggested by @mpnordland.

Each component would be in a separate repo, and would contain a metadata file with information about how they should be launched. Repos could become recognised as components to launch by through a config for the core, and if new components are added, a PR is submitted to add them.

Shared libraries could be independent repos which are referenced by submodules, which would ease synchronising the libraries between repos and should still allow for some components to stay on older versions of shared libraries if breaking changes are introduced through library updates until the component itself is updated.

I don't think multiple separate modules should live in the same repository - the separation of modules is what will help identify separate modules.

@mdcfe
Copy link
Contributor

mdcfe commented Aug 17, 2017

@mark-i-m Any particular reason for closing?

@mark-i-m
Copy link
Contributor Author

I didn't realize there was active work still going on, as the repo has been silent for a while TMK... Reopening

@mark-i-m mark-i-m reopened this Aug 17, 2017
@mdcfe
Copy link
Contributor

mdcfe commented Aug 17, 2017

I mean, it's more that if some work does happen then this will be much easier to find.

@mark-i-m
Copy link
Contributor Author

I would like to close this PR to clean up my dashboard. Does anyone have objections?

@Redmega
Copy link

Redmega commented Aug 30, 2018

Go for it. Work has left me not able to contribute to Chaos anymore.

@mdcfe
Copy link
Contributor

mdcfe commented Aug 30, 2018

No objection here.

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

No branches or pull requests

6 participants
@Redmega @Swizz @mdcfe @mpnordland @mark-i-m and others