Any Charm
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/beta | 94 | 29 Sep 2025 | |
latest/beta | 93 | 29 Sep 2025 | |
latest/beta | 92 | 29 Sep 2025 | |
latest/beta | 91 | 29 Sep 2025 |
juju deploy any-charm --channel beta
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
-
python-packages | string
newline-separated Python packages list to install in any-charm. The configuration format is a subset of requirements.txt specification, with each line a dependency compliant with PEP 508. Some commonly used packages in charms like pydantic are packed with the any-charm. Which means that if the local cached package version matches the requirement, the required package can be installed directly from the cache. The full list of pre-packaged Python packages can be found within the any-charm source code, specifically in the wheelhouse.txt file. For better chances to match versions available in the local cache, don't specify or pin the exact package version. For example, prefer using
jsonschema
instead ofjsonschema==4.21.0
. And for pre-packed Python packages with different versions like pydantic v1 and v2, only pin the major versionpydantic~=1.0
. Packages installed via this configuration has the lowest priority during the Python module resolution process. -
src-overwrite | string
Default: {}
A yaml/json encoded map of filenames and file contents that will write to the any-charm src directory before any charm event handling. By overwriting the any_charm.py with a Python script that defines a class named AnyCharm inherited from the AnyCharm base, the any-charm behavior can be altered and extended. The src directory has been added to the Python path, you can directly import any modules inside the src directory. It's recommended to use this config with rpc action. The charm.py is protected and can not be overwritten, and it's highly not recommended to overwrite any_charm_base.py. Here's an example of overwriting the any_charm.py, you can use the rpc charm action to invoke the greeting method: any_charm.py: | from any_charm_base import AnyCharmBase
class AnyCharm(AnyCharmBase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.framework.observe(self.on.update_status, self.update_status) def update_status(self, event): print("Hello, World!") def greeting(self): return "Hello"