Skip to main content

Shared and reusable code for Mongo-related charms

Project description

Mongo Charms Single Kernel library

Library containing shared code for MongoDB operators (mongodb, mongos, VM and k8s).

The goal of this library is to provide reusable and shared code for the four mongo charms:

Code layout

The source code can be found in single_kernel_mongo/ The layout is organised as so:

Charm Structure

This single kernel library aims at providing a clear and reliable structure, following the single responsibility principle. All the logic is expected to happen in this library and a charm should be no more than a few lines defining the substrate, the operator type and the config.

class MongoTestCharm(AbstractMongoCharm[MongoDBCharmConfig, MongoDBOperator]):
    config_type = MongoDBCharmConfig
    operator_type = MongoDBOperator
    substrate = Substrates.VM
    peer_rel_name = PeerRelationNames.PEERS
    name = "mongodb-test"

A glance of the charm structure and interfaces

Contributing

You can have longer explanations in ./CONTRIBUTING.md but for a quick start:

# Install poetry and tox
pipx install tox
pipx install poetry

poetry install

Code quality is enforced using pre-commit hooks. They will run before each commit and also at other stages.

# Install the first time
pre-commit install

# Run it manually with
pre-commit run --all-files

Once a PR is opened, it's possible to trigger integration testing on the charms with a comment on the PR. This can be run only by members of the Data and AI team

Use the following syntax:

* /test to run on 4 charms.
* /test/<mongodb | mongos>/<vm | k8s> to run on a specific charm.
* /test/*/<vm | k8s> to run for both charms on a specific substrate.

This will create a PR with an updated version of the library on the selected charms.

Project and community

Mongo Charms Single Kernel library is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback.

License

The Mongo Single Library is free software, distributed under the Apache Software License, version 2.0. See LICENSE for more information.

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

mongo_charms_single_kernel-1.8.46.tar.gz (335.4 kB view details)

Uploaded Source

Built Distribution

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

mongo_charms_single_kernel-1.8.46-py3-none-any.whl (398.4 kB view details)

Uploaded Python 3

File details

Details for the file mongo_charms_single_kernel-1.8.46.tar.gz.

File metadata

File hashes

Hashes for mongo_charms_single_kernel-1.8.46.tar.gz
Algorithm Hash digest
SHA256 2755b72b1929bbfaa6329be0063611fbe9e3bd9bfbef276150a00a0bd7234ffd
MD5 85e37554f0cea49335f132cb320cf98a
BLAKE2b-256 ce3376ef3b976b9d871fa6f885daf49696472fc20924783d3c3bdc10b9c5139f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mongo_charms_single_kernel-1.8.46.tar.gz:

Publisher: release.yaml on canonical/mongo-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 mongo_charms_single_kernel-1.8.46-py3-none-any.whl.

File metadata

File hashes

Hashes for mongo_charms_single_kernel-1.8.46-py3-none-any.whl
Algorithm Hash digest
SHA256 fd18b1281d1b0f8a16cb6e74e421010a681fc4948a573fa90810fe00eb5b6e6d
MD5 e23abe7ce7e26f451a8f5b9142fa6457
BLAKE2b-256 a0c011a74403aed77963c6b56fe32376ae63e700d7f9cb834a9b7bb9f1d9504b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mongo_charms_single_kernel-1.8.46-py3-none-any.whl:

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

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page