oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Refactor

Open ytti opened this issue 8 years ago • 7 comments
trafficstars

Reminder for myself, what things we need to fix when/if refactoring the core.

  1. Move state from memory to sqlite. Only keep in memory being fetched right now. So that we scale as number of threads, instead as number of devices
  2. Allow models to use multiple input methods, you may want to use ssh to send config, and ftp to actually receive it
  3. Extend support of creating multiple files from models, current use-case only conveniently supports creating files in new directories or in new repos. But for stacks, virtual firewalls etc. you might want to create multiple normal files
  4. Support multiple source files (multiple times same type, and/or combination of different types)
  5. Support multiple outputs
  6. Separate device interaction to own library, make Oxidized client of the library
  7. Flexible naming of files directory/%g/%t/%n:%p, replacement with group, type, node, port, model, command...
  8. Nested groups (unsure) /country/pop ... /customer/x
  9. one off run of all devices or just one devices, even while running daemon as well
  10. more hooks, for example when single rotation has been done
  11. testing (eeh, at least for refactored code)

ytti avatar Apr 15 '17 11:04 ytti

Working on #6 now

MajesticFalcon avatar Apr 19 '17 00:04 MajesticFalcon

  1. we should support routers pushing config to us, http, ftp, tftp.. listener thread, with worker fetching configs from listener threads via Queue
  2. API should be changed to Swagger and return only JSON, with HTTP rendering at client side code + 0touch LE integration
  3. review issues to see what users are missing :/

ytti avatar Mar 14 '18 10:03 ytti

with https://github.com/mitchellh/go-mruby we could rewrite oxidized in golang, but continue supporting ruby device models. Ship everything in single binary, but still support loading local ruby models.

ytti avatar Apr 20 '18 10:04 ytti

I've been toying with the possible implementation of a go version of Oxidized and so far it seems to be a viable option. The models can be indeed left as ruby code and use the go-mruby to evaluate them.

Some benefits regarding the go-rewrite:

  • easier deployment for users. Just download the binary, generate configuration and you are off
  • easier memory management: go provides fantastic tools to debug memory utilization
  • better isolation: each invocation of model can be run in a separate mruby-instance. Thus all the memory and side effects will be removed once the model has done its work
  • rewriting the base gives us an opportunity to fix some of the problems such as test coverage. Testing could be implemented for models too.
  • it would be probably a lot faster
  • users could still load external models via configuration as before. Builtin models would be packaged into the main binary

And the downsides:

  • achieving complete feature parity will take some time
  • keeping the original ruby-api in models introduces some constraints but for now it seems to be just a cosmetic issue
  • lack of some ruby-libraries for mruby. Though looking at the current state of models this might be a non-issue
  • extending builtin models can be a tricky subject. Not sure how much this is used.

I'm planning to release a PoC codebase in coming month(s) or so. So far I have the model evaluator and some basic Input modules done.

aakso avatar May 30 '18 17:05 aakso

Deployment could be fixed by shipping as Docker container or providing classical pre-build packages (eg. https://github.com/jordansissel/fpm)?

sts avatar Jan 12 '19 16:01 sts

  1. as we separate device interaction from configuration backups we should further develop another software which collects formal set of normalised data from supported devices with motivation of having programmatic platform agnostic access to the data

ytti avatar Mar 04 '19 15:03 ytti

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Oct 09 '24 02:10 github-actions[bot]

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Oct 08 '25 02:10 github-actions[bot]