Shared and reusable code for OpenSearch charms
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opensearch_charms_single_kernel-0.0.5.tar.gz.
File metadata
- Download URL: opensearch_charms_single_kernel-0.0.5.tar.gz
- Upload date:
- Size: 270.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
531c2fbd338aebcb9d2bdb5d58a23ed8a4eea6c6790ef1cfe18598f96ec700ad
|
|
| MD5 |
eff6a81a83f02bedd5bf7d598794e25e
|
|
| BLAKE2b-256 |
64e9194c5c6b81dd13c8ed043e5b6b9de7d197002c14585171e692e3291d091b
|
Provenance
The following attestation bundles were made for opensearch_charms_single_kernel-0.0.5.tar.gz:
Publisher:
release.yaml on canonical/opensearch-single-kernel-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensearch_charms_single_kernel-0.0.5.tar.gz -
Subject digest:
531c2fbd338aebcb9d2bdb5d58a23ed8a4eea6c6790ef1cfe18598f96ec700ad - Sigstore transparency entry: 1449570859
- Sigstore integration time:
-
Permalink:
canonical/opensearch-single-kernel-library@01f10244a4b64afdd645dd9f40eb31546aa89c32 -
Branch / Tag:
refs/heads/2/edge - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@01f10244a4b64afdd645dd9f40eb31546aa89c32 -
Trigger Event:
push
-
Statement type:
File details
Details for the file opensearch_charms_single_kernel-0.0.5-py3-none-any.whl.
File metadata
- Download URL: opensearch_charms_single_kernel-0.0.5-py3-none-any.whl
- Upload date:
- Size: 322.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fb122a679227d7d389134129dfbad6dd49831dee3f61f23ae3b978a43722e40
|
|
| MD5 |
8c9b39e558f3b1bb9bb72f3a3c1a3056
|
|
| BLAKE2b-256 |
16ef34bf46e36cc4ec2fa4ca99b8ff659c78675f23480a8786d6202a367c73b7
|
Provenance
The following attestation bundles were made for opensearch_charms_single_kernel-0.0.5-py3-none-any.whl:
Publisher:
release.yaml on canonical/opensearch-single-kernel-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensearch_charms_single_kernel-0.0.5-py3-none-any.whl -
Subject digest:
5fb122a679227d7d389134129dfbad6dd49831dee3f61f23ae3b978a43722e40 - Sigstore transparency entry: 1449570981
- Sigstore integration time:
-
Permalink:
canonical/opensearch-single-kernel-library@01f10244a4b64afdd645dd9f40eb31546aa89c32 -
Branch / Tag:
refs/heads/2/edge - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@01f10244a4b64afdd645dd9f40eb31546aa89c32 -
Trigger Event:
push
-
Statement type: