bitops icon indicating copy to clipboard operation
bitops copied to clipboard

Facilitate local/minikube development

Open josh-bitovi opened this issue 3 years ago • 6 comments

Problem: it's error-prone to test bitops changes locally and difficult to test any helm changes locally for sufficiently complex helm projects and most bitops scripts.

Solution: add minikube as a deploy target, update scripts so they can be run locally, and discuss other enhancements below.

I see a few options:

  1. Add 'minikube' support: could run before helm + allow us to do things like minikube addons enable ingress / minikube addons enable metrics-server
    • Would be nice to conditionally enable or disable entire environments or tools based on bitops config or the environment
    • No issue yet, but there's a blog ticket after: https://github.com/bitovi/bitops/issues/108
  2. Update scripts to easily be run locally/debug/refactor
    • Things like: usage info, options, separating parameters + ENV_VARS would all make these scripts be easier to run and debug locally. Not directly related to deploying to minikube, but would be helpful for local bitops development and debugging
    • We might also want to adopt a style guide (example) or add something like shellcheck to CI
  3. Does running helm tests fit in here?
    • Likely not, this seems like something we can support with helm upgrade-- but we haven't confirmed yet
  4. ~Do we need shell unit tests?~ https://github.com/bitovi/bitops/issues/106
  5. ~Is there a standard way we could set up debugging? DEBUG=1 is inconsistently used in some scripts and set -x adds a lot of noise/potentially sensitive values to log files.~ https://github.com/bitovi/bitops/issues/88
  6. Does (1) require us to support ordered or dependent deployments? E.g. only deploy helm after minikube, or allow users to specify an order
    • https://github.com/bitovi/bitops/issues/63
  7. ~Diffing environments~ https://github.com/bitovi/bitops/issues/107 and/or https://github.com/bitovi/bitops/issues/102
  8. Generating environments + generating minikube setup scritps for a "local" dev env

josh-bitovi avatar Jun 09 '21 17:06 josh-bitovi

This could be spun out into some useful tools:

  • bitops diff sha1 sha2: show me "compiled" differences between two commits
  • bitops bisect ...: like git bisect. give bitops a good and bad version, then use binary search to find the bad commit
    • doesn't seem as useful as the above... you'd be reading diffs/dry runs, or deploying @ each commit (or running a script after deploying or dumping the dry runs to a file)

josh-bitovi avatar Jun 17 '21 16:06 josh-bitovi

Diffing different environments would be huge too

josh-bitovi avatar Jun 17 '21 16:06 josh-bitovi

Generate a "local" env that spins up minikube using before scripts? Something reusable like a heroku "buildpack"? Doesn't completely fit that model though..

josh-bitovi avatar Jun 30 '21 16:06 josh-bitovi

^ would also be good to be able to generate things for existing repos (like rails can... e.g. bitops gen env local --minikube).

josh-bitovi avatar Jun 30 '21 16:06 josh-bitovi

for debugging and logging: https://github.com/bitovi/bitops/issues/88

mickmcgrath13 avatar Jun 30 '21 16:06 mickmcgrath13

Reopening - This would be a great to have to support local development

PhillypHenning avatar Jul 18 '22 14:07 PhillypHenning