Sensu launched Bonsai, the Sensu asset index pretty quietly in February, and since that time we’ve been doing continual improvements on the asset story with feedback from our early adopters. In this Sensu Summit 2019 talk, Developer Advocate Jef Spaleta provides an overview of the asset feature journey, how assets work, the role Bonsai plays, and how the community is already contributing!
2. 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!
4. ● 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
5. ● 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
6. 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
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
9. 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
10. ● 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
11. 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
12. 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
13. 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)
15. 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
16. 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!
17. 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