Skip to main content

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opensearch_charms_single_kernel-0.0.11.tar.gz (348.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opensearch_charms_single_kernel-0.0.11-py3-none-any.whl (405.8 kB view details)

Uploaded Python 3

File details

Details for the file opensearch_charms_single_kernel-0.0.11.tar.gz.

File metadata

File hashes

Hashes for opensearch_charms_single_kernel-0.0.11.tar.gz
Algorithm Hash digest
SHA256 e08b71a74daa549d36ba11ad96ff8ccf4e336a6d39e9a1d26e0aa1dab743e230
MD5 5a395789bcd216b9fb2d431b3c2caf84
BLAKE2b-256 7b96ee094188ec5d02996da5c1af054112a04d07a6c44f5ea25592109baac1ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensearch_charms_single_kernel-0.0.11.tar.gz:

Publisher: release.yaml on canonical/opensearch-single-kernel-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opensearch_charms_single_kernel-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for opensearch_charms_single_kernel-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 7b11f42a2d29d15a07d68aad43705bda4c20dcd678db77c615770ba882f98653
MD5 ff5ff8a6ddd8d555f5f52f4538798c54
BLAKE2b-256 63eae66150f8307fbf25cc3c97dd728f86d68b7ade72590850aaec0432696cba

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensearch_charms_single_kernel-0.0.11-py3-none-any.whl:

Publisher: release.yaml on canonical/opensearch-single-kernel-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.12

2 files

This release

0.0.11 This release

2 files

0.0.10

2 files

0.0.9

2 files

0.0.6

2 files

0.0.5

2 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