Skip to main content

No project description provided

Project description

PIP Package for a variety of Data Platform Helpers

Table of Contents:

  1. Version Checker

1. Version Checker

Purpose:

used to determine if a relevant version attribute across related applications are valid.

There are many potential applications for this. Here are a few examples:

  1. in a sharded cluster where is is important that the shards and cluster manager have the same components.
  2. kafka connect and kafka broker apps working together and needing to have the same ubnderlying version.

How to use:

  1. add to requirements in requirements.txt:

        data-platform-helpers==0.1.1
    
  2. in src/charm.py of requirer + provider

    in constructor [REQUIRED]:

    from data_platform_helpers.version_check import CrossAppVersionChecker
    ...
    self.version_checker = self.CrossAppVersionChecker(
        self,
        version=x, # can be a revision of a charm, version of a snap, version of a workload, etc
        relations_to_check=[x,y,z],
        # only use if the version doesn't not need to exactly match our current version
        version_validity_range={"x": "<a,>b"})
    

    in update status hook [OPTIONAL]:

    if not self.version_checker.are_related_apps_valid():
        logger.debug(
            "Warning relational version check failed, these relations have mismatched versions",
            "%s",
            self.version_checker(self.version_checker.get_invalid_versions())
        )
        # do something, ie set status, instruct user to change something, etc
    
  3. other areas of the charm (i.e. joined events, action events, etc) [OPTIONAL]:

    if not self.charm.version_checker.are_related_apps_valid():
        # do something - i.e. fail event or log message
    
  4. in upgrade handler of requirer + provider [REQUIRED]:

    if [last unit to upgrade]:
        self.charm.version.set_version_across_all_relations()
    

Project details


Download files

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

Source Distribution

data_platform_helpers-0.1.7.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

data_platform_helpers-0.1.7-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file data_platform_helpers-0.1.7.tar.gz.

File metadata

  • Download URL: data_platform_helpers-0.1.7.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for data_platform_helpers-0.1.7.tar.gz
Algorithm Hash digest
SHA256 04445f3f4309730bb1c569a04464caeb27390b0d6e07829d09dacd8882fcfcd1
MD5 c530476e04557ccf00244d09c2c2666b
BLAKE2b-256 c90aaa8e38a444339d221ec3e29bbbacfeb88b869f5812578188c468f5af54a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for data_platform_helpers-0.1.7.tar.gz:

Publisher: release.yaml on canonical/data-platform-helpers

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

File details

Details for the file data_platform_helpers-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for data_platform_helpers-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cf01caef414a4c07911ecf2c009c19b8f69cae154b540dd578ddbe2af8fd3b98
MD5 214e8fb8b6c3fb83952a10daeb1234fa
BLAKE2b-256 a7ac57904c4bcc393ece5735ffbef71bd62dae7d213eeee49f81609af6b84d4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for data_platform_helpers-0.1.7-py3-none-any.whl:

Publisher: release.yaml on canonical/data-platform-helpers

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