Bonsai
Sensu Summit 2019
The Bonsai Asset Index
2
● Announced in February
● Integrates with public GitHub repositories
● Undergoing continuous incremental
improvement
● 100 assets registered so far!
Huge shoutout to our early adopters,
for helping Bonsai improve so fast!
Bonsai Web UI Quick Tour
Live Demo
3
● tar(.gz) archives that contain:
○ bin/ -> added to executable path
○ lib/ -> added to shared library search path
● Integrity verified using sha512 checksum
● Used for:
Checks, handlers, mutators, filters and hooks
Sensu Go Assets Refresher:
The Basics
44
● Lowers the complexity
of configuration management
● Keep your container images thin
● Enables just-in-time monitoring workflows
● Completely optional
”Sometimes the old ways are the best”
Sensu Go Assets Refresher:
The Benefits
55
What Bonsai Adds to the Story
6
Why not just serve assets out of Github?
Bonsai gives us:
○ Dedicated Web UI to discover/explore assets
○ Dedicated extensible API for asset management
○ Caching of binaries outside of GitHub
○ Planning for additional integration options (GitHub is
just a start)
○ Open source codebase to collaborate on
The Bonsai - Github Integration
7
● Uses Github Webhook Events
● Requires Github releases:
○ SemVer release tags
○ sha512 checksum file
○ asset binaries as release artifacts
● Requires .bonsai.yml file:
This marks a repository as containing
an asset and ties everything together
Registering a New Plugin
Live Demo
8
Provides:
● Asset version of ruby environment
● Docker images to use in building plugin assets
Supported by Sensu
https://github.com/sensu/sensu-ruby-runtime
While We Wait:
The Sensu Ruby Runtime
99
An Important way to support the existing
community maintained Sensu Plugins
● Added automated testing for linux
platform matrix
● Builds for:
○ Alpine
○ Debian family (Debian 8+ and Ubuntu 14.04+)
○ RHEL 6 family
○ RHEL 7 family
Contribution Opportunity: Add Windows Support
While We Wait:
Ruby Runtime 0.10 Milestone
1010
Constructed a helper repository:
https://github.com/sensu/sensu-go-bonsai-asset
Uses the sensu-ruby-runtime Docker
images as build environments
While We Wait:
Building Assets with TravisCI
1111
Used to define multiple builds
Each build is defined by:
● Platform -> string
● Arch -> string
● Asset_filename -> matches file in github release
● Sha_filename -> matches file in github release
● Filters -> used in generated asset configuration
While We Wait:
The .bonsai.yml File
1212
While We Wait:
Using Bonsai Assets
1313
Bonsai Web UI:
● Download platform/arch specific asset config as yaml
Bonsai API:
● Download platform/arch specific asset config as json
or
● Download multi-build asset config as json
(New! Support in Sensu Go 5.12)
Using the new Asset
Live Demo
14
A Word on Bonsai
Asset Caching
1515
generated asset configs point to
assets.bonsai.sensu.io
● Backed by CDN
This overcomes rate-limiting of GitHub download urls
● Url encodes GitHub commit UUID for release tag
This should help you to find the corresponding source,
even if upstream GitHub release tag is deleted and rebuilt
What’s next for Bonsai?
16
● Extend the Web UI to support multi-build
asset configuration
● Web UI search improvements
● Integrate sensuctl with Bonsai API:
You’ll see more on this tomorrow!
How You Can Contribute
17
● Help! Add asset support for existing Sensu
plugins you are currently using
● Help! Extend the sensu-ruby-runtime to
non-linux platforms
● Share! your own assets with the
community by registering them with
Bonsai
Thank You!
18

The Bonsai Asset Index : A new way for the community to share resources

  • 1.
  • 2.
    The Bonsai AssetIndex 2 ● Announced in February ● Integrates with public GitHub repositories ● Undergoing continuous incremental improvement ● 100 assets registered so far! Huge shoutout to our early adopters, for helping Bonsai improve so fast!
  • 3.
    Bonsai Web UIQuick Tour Live Demo 3
  • 4.
    ● tar(.gz) archivesthat contain: ○ bin/ -> added to executable path ○ lib/ -> added to shared library search path ● Integrity verified using sha512 checksum ● Used for: Checks, handlers, mutators, filters and hooks Sensu Go Assets Refresher: The Basics 44
  • 5.
    ● Lowers thecomplexity of configuration management ● Keep your container images thin ● Enables just-in-time monitoring workflows ● Completely optional ”Sometimes the old ways are the best” Sensu Go Assets Refresher: The Benefits 55
  • 6.
    What Bonsai Addsto the Story 6 Why not just serve assets out of Github? Bonsai gives us: ○ Dedicated Web UI to discover/explore assets ○ Dedicated extensible API for asset management ○ Caching of binaries outside of GitHub ○ Planning for additional integration options (GitHub is just a start) ○ Open source codebase to collaborate on
  • 7.
    The Bonsai -Github Integration 7 ● Uses Github Webhook Events ● Requires Github releases: ○ SemVer release tags ○ sha512 checksum file ○ asset binaries as release artifacts ● Requires .bonsai.yml file: This marks a repository as containing an asset and ties everything together
  • 8.
    Registering a NewPlugin Live Demo 8
  • 9.
    Provides: ● Asset versionof ruby environment ● Docker images to use in building plugin assets Supported by Sensu https://github.com/sensu/sensu-ruby-runtime While We Wait: The Sensu Ruby Runtime 99 An Important way to support the existing community maintained Sensu Plugins
  • 10.
    ● Added automatedtesting for linux platform matrix ● Builds for: ○ Alpine ○ Debian family (Debian 8+ and Ubuntu 14.04+) ○ RHEL 6 family ○ RHEL 7 family Contribution Opportunity: Add Windows Support While We Wait: Ruby Runtime 0.10 Milestone 1010
  • 11.
    Constructed a helperrepository: https://github.com/sensu/sensu-go-bonsai-asset Uses the sensu-ruby-runtime Docker images as build environments While We Wait: Building Assets with TravisCI 1111
  • 12.
    Used to definemultiple builds Each build is defined by: ● Platform -> string ● Arch -> string ● Asset_filename -> matches file in github release ● Sha_filename -> matches file in github release ● Filters -> used in generated asset configuration While We Wait: The .bonsai.yml File 1212
  • 13.
    While We Wait: UsingBonsai Assets 1313 Bonsai Web UI: ● Download platform/arch specific asset config as yaml Bonsai API: ● Download platform/arch specific asset config as json or ● Download multi-build asset config as json (New! Support in Sensu Go 5.12)
  • 14.
    Using the newAsset Live Demo 14
  • 15.
    A Word onBonsai Asset Caching 1515 generated asset configs point to assets.bonsai.sensu.io ● Backed by CDN This overcomes rate-limiting of GitHub download urls ● Url encodes GitHub commit UUID for release tag This should help you to find the corresponding source, even if upstream GitHub release tag is deleted and rebuilt
  • 16.
    What’s next forBonsai? 16 ● Extend the Web UI to support multi-build asset configuration ● Web UI search improvements ● Integrate sensuctl with Bonsai API: You’ll see more on this tomorrow!
  • 17.
    How You CanContribute 17 ● Help! Add asset support for existing Sensu plugins you are currently using ● Help! Extend the sensu-ruby-runtime to non-linux platforms ● Share! your own assets with the community by registering them with Bonsai
  • 18.