Skip to content

Commit

Permalink
Standalone sidecar charm (#104)
Browse files Browse the repository at this point in the history
* KF-737
- Deploy MLflow as a sidecar charm (without any relation).
- Expose MLflow as NodePort on port speciffied in config.
- Expose MLflow as ClusterIp if not NodePort
  • Loading branch information
misohu authored Mar 2, 2023
1 parent e1d97c6 commit b642986
Show file tree
Hide file tree
Showing 34 changed files with 969 additions and 7,125 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ dmypy.json
id_rsa
kubeconfig
*.charm
.kube/
80 changes: 80 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Contributing

## Overview

This document explains the processes and practices recommended for contributing enhancements to
this operator.

- Generally, before developing enhancements to this charm, you should consider [opening an issue
](https://github.com/canonical/training-operator/issues) explaining your use case.
- If you would like to chat with us about your use-cases or proposed implementation, you can reach
us at [Canonical Mattermost public channel](https://chat.charmhub.io/charmhub/channels/charm-dev)
or [Discourse](https://discourse.charmhub.io/).
- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk) library
will help you a lot when working on new features or bug fixes.
- All enhancements require review before being merged. Code review typically examines
- code quality
- test coverage
- user experience for Juju administrators of this charm.
- 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.

## Developing

You can use the environments created by `tox` for development:

```shell
tox --notest -e unit
source .tox/unit/bin/activate
```

### Testing

```shell
tox -e lint # code style
tox -e unit # unit tests
tox -e integration # integration tests
tox # runs 'lint' and 'unit' environments
```

## Build charm

Build the charm in this git repository using:

```shell
charmcraft pack
```

### Deploy

```bash
# Create a model
juju add-model dev
# Enable DEBUG logging
juju model-config logging-config="<root>=INFO;unit=DEBUG"
# Deploy the charm
juju deploy ./training-operator_ubuntu-20.04-amd64.charm \
--resource training-operator-image=$(yq '.resources."training-operator-image"."upstream-source"' metadata.yaml)
```

## Updating the charm for new versions of the workload

To upgrade the source and resources Charmed Training Operator, you must:

1) Bump the `training-operator-image` in `metadata.yaml`
2) Update the charm source for any changes, such as:

* YAML manifests in src/ and/or any Kubernetes resource in pod_spec
* New or changed configurations passed to pebble workloads or through pod.set_spec

3) Ensure integration and unit tests are passing; fix/adapt them otherwise

The following table collects a series of links and information that can help in the upgrade process.

| Image registry | Image tag format | Manifest location | Next version |
|--- |--- |--- |--- |
| [kubeflow/training-operator](https://hub.docker.com/r/kubeflow/training-operator/) | `v1-<commit sha>`<br>The commit sha comes from the HEAD of the release tag | [kubeflow/manifests](https://github.com/kubeflow/manifests/tree/master/apps/training-operator/upstream) | Check for latest version released or pre-released in <br>the repo [releases](https://github.com/kubeflow/training-operator/releases), it should match the release plan usually stated in issues like <br>[Training Operator WG and Kubeflow 1.6](https://github.com/kubeflow/manifests/issues/2196) release and [KF Release 1.6 Tracking](https://github.com/kubeflow/manifests/issues/2194) |

## Canonical Contributor Agreement

Canonical welcomes contributions to the Charmed Training Operator. Please check out our [contributor agreement](https://ubuntu.com/legal/contributors) if you're interested in contributing to the solution.
674 changes: 0 additions & 674 deletions LICENSE copy

This file was deleted.

27 changes: 0 additions & 27 deletions README copy.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ for file in files:
To download a specific file:
```python
minio.download_file(default_bucket_name,'<minio file path>', '<notebook server file path>')
```
```
13 changes: 0 additions & 13 deletions actions.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright 2023 Canonical
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
type: 'charm'

type: "charm"
bases:
- build-on:
- name: 'ubuntu'
channel: '20.04'
- name: "ubuntu"
channel: "20.04"
run-on:
- name: 'ubuntu'
channel: '20.04'
- name: "ubuntu"
channel: "20.04"
parts:
charm:
# do not use these versions due to pypa/setuptools_scm#713
charm-python-packages: [setuptools!=62.2.0, pip!=22.1]
charm-python-packages: [setuptools, pip]
Binary file removed config.png
Binary file not shown.
40 changes: 1 addition & 39 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Luke Marsden
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
#
options:
Expand All @@ -23,45 +23,7 @@ options:
The nodeport for MLFlow
type: int
default: 31380
mlflow_scrape_interval:
description: |
How frequently to scrape targets from MLFlow.
type: string
default: None
mlflow_scrape_timeout:
description: |
Per-scrape timeout when scraping MLFlow.
type: string
default: None
minio_port:
description: |
The port Minio will be listening on
type: int
default: 9000
minio_nodeport:
description: |
The nodeport for Minio
type: int
default: 30650
kubeflow_port:
description: |
The port istio-ingressgateway will be listening on
type: int
default: 80
kubeflow_nodeport:
description: |
The nodeport for Kubeflow (istio-ingressgateway)
type: int
default: 30600
enable_mlflow_nodeport:
description: Deploy the NodePort service for MLFlow
type: boolean
default: true
enable_kubeflow_nodeport:
description: Deploy the NodePort service for Kubeflow
type: boolean
default: true
enable_kubeflow_loadbalancer:
description: Deploy the LoadBalancer service for Kubeflow
type: boolean
default: true
Binary file removed demo.png
Binary file not shown.
Loading

0 comments on commit b642986

Please sign in to comment.