OpenSearch Charms Single Kernel
Shared and reusable Python code for Canonical OpenSearch charms.
This repository contains the common implementation used by OpenSearch charms across machine and Kubernetes substrates. It provides base charm classes, workload abstractions, event handlers, state models, and managers for common OpenSearch operations so charm-specific repositories can stay focused on their substrate and packaging concerns.
The project is intended for contributors working on the OpenSearch charm codebase.
What Is Included
- Base charm classes for VM and Kubernetes charms.
- Workload adapters for substrate-specific OpenSearch operations.
- Managers for cluster health, configuration, TLS, users, snapshots, plugins, upgrades, profiles, peer clusters, notifications, external clients, and locks.
- Event handlers for OpenSearch lifecycle events and supported Juju relations.
- Pydantic models and state helpers for relation data and cluster state.
- Vendored charm libraries required by the shared implementation.
- Test charms and integration fixtures used to validate the shared library.
Repository Layout
| Path | Purpose |
|---|---|
opensearch_single_kernel/charms/ |
Base charm classes and VM/Kubernetes charm entry points. |
opensearch_single_kernel/workload/ |
Workload abstractions and substrate-specific implementations. |
opensearch_single_kernel/managers/ |
Operational managers for OpenSearch features and lifecycle work. |
opensearch_single_kernel/events/ |
Juju event handlers and custom OpenSearch events. |
opensearch_single_kernel/core/ |
Relation state, secrets, models, and shared data structures. |
opensearch_single_kernel/common/ |
Constants, statuses, exceptions, and the OpenSearch client. |
opensearch_single_kernel/lib/ |
Vendored charm libraries refreshed through charmcraft. |
tests/unit/ |
Unit tests for the shared library. |
tests/integration/ |
Integration tests and supporting charms. |
tests/charms/ |
Local test charms that consume the shared kernel. |
scripts/build_lib_for_integration.sh |
Helper for copying the local library into test charms before packing. |
Development
Install tox and poetry with pipx:
pipx install tox
pipx install poetry
Install the project dependencies:
poetry install
Install pre-commit hooks before submitting changes:
poetry run pre-commit install
See CONTRIBUTING.md for contribution guidelines and the Canonical contributor agreement.
Testing
Run the default local checks:
tox
Useful tox environments:
tox run -e format # apply formatting
tox run -e lint # lint, spelling, formatting, and shell checks
tox run -e unit # unit tests for all substrates
tox run -e unit-vm # unit tests with the VM substrate
tox run -e unit-k8s # unit tests with the Kubernetes substrate
tox run -e integration # integration tests
tox run -e build # build the Python package
Integration tests require a Juju test environment and, for object storage
scenarios, the cloud credentials consumed by tox.ini.
Building Test Charms for Integration Runs
Use scripts/build_lib_for_integration.sh when an integration run needs test
charms packed with the local version of this library:
scripts/build_lib_for_integration.sh
By default, the script prepares tests/charms/opensearch_test_charm. You can
target another charm and, when needed, pass a charmcraft platform:
scripts/build_lib_for_integration.sh --charm tests/charms/opensearch_k8s_test_charm
scripts/build_lib_for_integration.sh --platform amd64 --charm tests/charms/opensearch_test_charm
Project Links
- Homepage: https://github.com/canonical/opensearch-single-kernel-library
- Issues: https://github.com/canonical/opensearch-single-kernel-library/issues
- Contributing: CONTRIBUTING.md
- License: Apache-2.0
Metadata
Release files for opensearch-charms-single-kernel 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opensearch_charms_single_kernel-0.0.17.tar.gz | 349.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opensearch_charms_single_kernel-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 756.3 kB
Release files / opensearch_charms_single_kernel-0.0.17.tar.gz
| Download URL | opensearch_charms_single_kernel-0.0.17.tar.gz |
|---|---|
| Size | 349.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70ca18381f9529b404de72c1bf8653121ca07f8c676c11846ed72f78e2caebdf
|
|
BLAKE2b-256 checksum How to use checksums |
484e835e8acd3ad177b26632249645552958d6c0b97a16f6c6868f7c05a02c5e
|
| 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 Sep 24, 2026.
Transparency logRelease files / opensearch_charms_single_kernel-0.0.17-py3-none-any.whl
| Download URL | opensearch_charms_single_kernel-0.0.17-py3-none-any.whl |
|---|---|
| Size | 406.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3981ac54ca482d5897a3773e2fa97687689fb7424001d45343a19023dd8bc542
|
|
BLAKE2b-256 checksum How to use checksums |
f33cd4b4f0338e6abb5dcab0e9c9915222ba76a984c58bee1bd811c7c826e9dc
|
| 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 Sep 24, 2026.
Transparency log