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

Minimally adapt kernel to use habitat for dependencies and process supervision #52

Open
16 tasks
themightychris opened this issue Nov 22, 2017 · 2 comments
Open
16 tasks
Assignees

Comments

@themightychris
Copy link
Member

themightychris commented Nov 22, 2017

#46 contains the first approach to integrating emergence
The new approach will be to:

  • Continue installing emergence-kernel via npm install -g, so that both new machines can be initialized and old machines updated with the same command
  • The kernel will handle installing habitat
    • maybe run the habitat curl|bash when the kernel starts if hab isn't found in the path?
    • maybe use some sort of npm hook to do that from a package.json option when the kernel is globally installed?
    • maybe repackage habitat as an npm package so it can just be a dependency for the kernel that npm handles installing to .bin
  • The kernel will automate running hab commands
    • maybe just use a promise-based shell npm package to run hab commands
    • maybe repackage habitat as an npm package and expose async functions for each of the habitat commands we want that take node-ified options
  • generate a single json document config for the entire host, consisting of the /emergence/config.json base document with a "sites" key added containing an object mapping each site handle under /emergence/sites/* to the contents of its site.json
  • setup the config templates for each plan in https://github.com/JarvusInnovations/Emergence/tree/habitat/service-plans to generate from this shared mega-config tree
    • only the nginx config will loop through the "sites" list
    • we might want to remap services.plugins.myservice in legacy config.json to just services.myservice on load if plugins is detected the only key. Update the code that auto-generates new config.json to skip the plugins subkey going forward
  • start the habitat supervisor if needed
  • reimplement the start / stop functions for each of kernel-lib/services/* to load+start / stop via hab sup
  • query hab sup status for current service status on startup and when requested instead of using pid files and maintaining a started/stopped state internally
  • customize health check hooks for each service to do as complete a check as possible for being usable by emergence
@themightychris
Copy link
Member Author

Maybe use mobx for observable kernel state? https://medium.com/@botverse/enjoying-mobx-jsx-and-virtual-dom-621dcc2a2bd5

@themightychris
Copy link
Member Author

Even better: mobx-state-tree

@themightychris themightychris self-assigned this Mar 6, 2018
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

2 participants