Skip to content

Instantly share code, notes, and snippets.

View ca-scribner's full-sized avatar

Andrew Scribner ca-scribner

View GitHub Profile
@ca-scribner
ca-scribner / charm_status_setting_from_helpers.md
Last active January 6, 2025 16:45
Automated handling of charm status requests from helpers

Often, Juju charms have helpers that encounter situations that should result in a Juju status (eg: a helper parsing charm config might see an invalid config that should result in BlockedStatus). Many charm code authors feel it is an antipattern to set charm status from a helper because it makes charms harder to read (from a top level, its hard to tell where in your charm statuses might be set), but in cases where the helper knows status should result of this situation (BlockedStatus("Blocked because X is unset")) or at least has context to add about the error it is hard to pass this information back to the charm. In particular, when trying to make resuable helpers that are shared across many charms, this can lead to a lot of complex logic and error handling that is implemented in every charm.

Below is a pattern modified/stolen from:

@ca-scribner
ca-scribner / seldon_deployment_using_mlflow_model.ipynb
Last active March 4, 2022 21:01
An example SeldonDeployment using mlflow to store the model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.