This document outlines the processes and practices recommended for contributing enhancements to kubeflow-profiles.
Before developing enhancements to this charm, you should open an issue explaining your use case. If you would like to chat with us about your use-cases or proposed implementation, you can reach us at MLOps Mattermost public channel or on Discourse.
Please help us out in ensuring easy to review branches by rebasing your pull request branch onto the main branch. This also avoids merge commits and creates a linear Git commit history.
All pull requests require review before being merged. Code review typically examines:
- code quality
- test coverage
- user experience for Juju administrators of this charm.
Familiarising yourself with the Charmed Operator Framework library will help you a lot when working on new features or bug fixes.
To build kubeflow-profiles run:
charmcraft packYou can use the environments created by tox for development. For example, to load the unit environment into your shell, run:
tox --notest -e unit
source .tox/unit/bin/activateUse tox for testing. For example to test the integration environment, run:
tox -e integrationSee tox.ini for all available environments.
# Create a model
juju add-model dev
# Enable DEBUG logging
juju model-config logging-config="<root>=INFO;unit=DEBUG"
# Deploy the charm
juju deploy ./kubeflow-profiles_ubuntu@24.04-amd64.charm --trust \
--resource profile-image=$(yq '.resources."profile-image"."upstream-source"' metadata.yaml) \
--resource kfam-image=$(yq '.resources."kfam-image"."upstream-source"' metadata.yaml)Canonical welcomes contributions to this charm. Please check out our contributor agreement if you're interested in contributing.
tox is the only tool required locally, as tox internally installs and uses poetry, be it to manage Python dependencies or to run tox environments. To install it: pipx install tox.
Optionally, poerty can be additionally installed independently just for the sake of running Python commands locally outside of tox during debugging/development. To install it: pipx install poetry.
To add/update/remove any dependencies and/or to upgrade Python, simply:
-
add/update/remove such dependencies to/in/from the desired group(s) below
[tool.poetry.group.<your-group>.dependencies]inpyproject.toml, and/or upgrade Python itself inrequires-pythonunder[project]⚠️ dependencies for the charm itself are also defined as dependencies of a dedicated group calledcharm, specifically below[tool.poetry.group.charm.dependencies], and not as project dependencies below[project.dependencies]or[tool.poetry.dependencies]⚠️ -
run
tox -e update-requirementsto update the lock fileby this point,
poerty, throughtox, will let you know if there are any dependency conflicts to solve. -
optionally, if you also want to update your local environment for running Python commands/scripts yourself and not through tox, see Running Python Environments below
To run tox environments, either locally for development or in CI workflows for testing, ensure to have tox installed first and then simply run your tox environments natively (e.g.: tox -e lint). tox will internally first install poetry and then rely on it to install and run its environments.
To run Python commands locally for debugging/development from any environments built from any combinations of dependency groups without relying on tox:
- ensure you have
poetryinstalled - install any required dependency groups:
poetry install --only <your-group-a>,<your-group-b>(or all groups, if you prefer:poetry install --all-groups) - run Python commands via poetry:
poetry run python3 <your-command>