Skip to main content

OpenSearch Dashboards single-kernel library

Shared Python code for building Juju charms that operate OpenSearch Dashboards.

This repository is the single kernel used by OpenSearch Dashboards charms. It contains the common charm classes, state models, event handlers, managers, and workload abstractions needed to run the same charm logic on machine and Kubernetes substrates.

The single_kernel_opensearch_dashboards/charmcraft.yaml file is a placeholder charm definition used to fetch and refresh charm libraries. It is not intended to be deployed as the product charm by itself.

Features

  • Base charm classes for VM and Kubernetes charms.
  • Shared managers for cluster lifecycle, configuration, health checks, TLS, upgrades, COS integration, and rolling restarts.
  • Event handlers for OpenSearch, TLS certificates, OAuth, JWT configuration, OpenSearch Dashboards lifecycle events, and upgrades.
  • Workload abstractions for snap-based VM deployments and Kubernetes workloads.
  • Structured state and configuration models for charm code.
  • Unit, integration, and spread test suites for validating the shared kernel against a test charm.

Repository layout

single_kernel_opensearch_dashboards/
  charms/       Base charm classes for VM and Kubernetes charms.
  common/       Shared constants and exceptions.
  core/         State, config, status, and cluster models.
  events/       Juju event handlers.
  managers/     Operational managers for charm responsibilities.
  workload/     Substrate-specific workload adapters.
  lib/          Vendored charm libraries.
tests/
  unit/         Unit tests for the shared kernel.
  integration/ Integration tests.
  spread/       Spread task definitions.
  charms/vm/    Test VM charm that consumes the library.
terraform/     Terraform module for deploying OpenSearch Dashboards.
scripts/       Development and charm build helpers.

Requirements

  • Python 3.10 or later.
  • Poetry 2.0 or later.
  • Tox, for local test workflows.
  • Charmcraft, for packing charms.
  • Juju, for integration and spread tests.

Getting started

Install the project dependencies:

poetry install --with lint,unit

Run the standard local checks:

tox -e lint
tox -e unit

Format the code:

tox -e format

Run integration tests:

tox -e integration

Using the library in a charm

A consuming charm should import one of the substrate-specific base charm classes and pass it to ops.main.main.

For a machine charm:

#!/usr/bin/env python3

from ops.main import main

from single_kernel_opensearch_dashboards.charms.vm import OpenSearchDashboardsVMCharm


if __name__ == "__main__":
    main(OpenSearchDashboardsVMCharm)

For a Kubernetes charm, use:

from single_kernel_opensearch_dashboards.charms.k8s import OpenSearchDashboardsK8sCharm

The consuming charm metadata must provide the relation names expected by the kernel:

  • Peer relations: dashboard_peers, restart, upgrade, and status-peers.
  • Required relation: opensearch-client.
  • Optional relations: certificates, oauth, and jwt-configuration.
  • Provided relation: cos-agent.

The test charm under tests/charms/vm is a concrete example of the metadata, configuration, actions, and entrypoint needed by a VM charm.

Configuration and actions

The shared config model currently exposes:

Option Values Default Description
log_level ERROR, WARNING, INFO INFO Controls OpenSearch Dashboards logging verbosity.

The test charm exposes these actions:

Action Description
pre-upgrade-check Runs pre-upgrade checks before a charm upgrade.
set-tls-private-key Sets or generates the private key used for TLS certificate signing requests.
status-detail Returns detailed charm statuses, optionally recomputing them first.

Building the test charm

The build helper copies this library into a test charm and packs it:

./scripts/build.sh

To build a specific test charm directory:

./scripts/build.sh tests/charms/vm

When CI_CACHE=true is set, the script uses charmcraftcache; otherwise it uses charmcraft pack.

Terraform

The terraform/ directory contains a Juju Terraform module for deploying the OpenSearch Dashboards charm and relating it to OpenSearch. See terraform/README.md for module inputs, outputs, and usage examples.

Contributing

Before opening a change, run:

tox -e lint
tox -e unit

For changes that affect charm behavior, also run the relevant integration or spread tests.

Community and support

License

This project is licensed under the Apache License 2.0. See LICENSE for details.

Metadata

Release files for opensearch-dashboards-charms-single-kernel 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opensearch-dashboards-charms-single-kernel 2.0.1
File Size Uploaded
opensearch_dashboards_charms_single_kernel-2.0.1.tar.gz 216.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opensearch-dashboards-charms-single-kernel 2.0.1
File Interpreter ABI Platform
opensearch_dashboards_charms_single_kernel-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 461.3 kB

Release files / opensearch_dashboards_charms_single_kernel-2.0.1.tar.gz

Download URL opensearch_dashboards_charms_single_kernel-2.0.1.tar.gz
Size 216.1 kB
Tags Source
SHA-256 checksum
How to use checksums
20e742d3c3449f40b207d3538c7de57d1785e10aa36debf8a3123daf00b382cc
BLAKE2b-256 checksum
How to use checksums
b56194c374cb83e7bb05770b988c99d655a1df526ffc037d8b09d0648b5fc5d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / opensearch_dashboards_charms_single_kernel-2.0.1-py3-none-any.whl

Download URL opensearch_dashboards_charms_single_kernel-2.0.1-py3-none-any.whl
Size 245.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93b3c366917a6c00f4ff25728be63f9427f1efeef190345d4481a2a6811da939
BLAKE2b-256 checksum
How to use checksums
c80329bb4aaf431fe7715b57c33cb008d5478d2390d90f7055b9b6ea2846b661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page