Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Rewrite the Tensorboards Web App charm following the sidecar pattern #74

Merged
merged 28 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0530cdc
pip: Update fmt and lint requirements
orfeas-k Jun 13, 2023
c4e47ee
files: Add VSCode files to .gitignore
orfeas-k Jun 1, 2023
b5fd1ad
files(twa): Update README file to refer to the charm itself
orfeas-k Jun 12, 2023
ca03117
files(twa): Introduce CONTRIBUTING.md file
orfeas-k Jun 12, 2023
7d97313
manifests(twa): Add upstream manifests as templates
orfeas-k Jun 1, 2023
401405d
pip(twa): Update fmt and lint requirements
orfeas-k Jun 12, 2023
f23fc89
twa: Add _log_and_set_status() function
orfeas-k Jun 12, 2023
68357c7
twa: Block charm if there is no ingress relation
orfeas-k Jun 12, 2023
d40bb2c
twa: Rewrite charm with sidecar pattern
orfeas-k Jun 12, 2023
0cbd3ea
tests: Fix joint charms deploy test
orfeas-k Jun 6, 2023
9fabb37
tests(twa): Rewrite TWA unit tests
orfeas-k Jun 9, 2023
f32b718
tests(twa): Add integration tests for TWA
orfeas-k Jun 12, 2023
03768bd
files: Update README.md deploy instructions
orfeas-k Jun 13, 2023
52211dd
pip(twa): Bump SDI package's version
orfeas-k Jun 14, 2023
fa5b328
files: Add last lines
orfeas-k Jun 16, 2023
bbfddee
review: Modify unit test_env_var assertions
orfeas-k Jun 21, 2023
e68b8f6
fixup! twa: Rewrite charm with sidecar pattern
orfeas-k Jun 21, 2023
6650cf7
fixup! tests(twa): Rewrite TWA unit tests
orfeas-k Jun 21, 2023
b41d159
config(twa): Drop TWA container port
orfeas-k Jun 21, 2023
265ec3e
config(twa): Backend-mode defaults to 'production'
orfeas-k Jun 21, 2023
9c0f66c
ci: Add TWA integration tests to integrate workflow
orfeas-k Jun 22, 2023
874c1f2
tests(twa): Lint unit tests
orfeas-k Jun 22, 2023
15d571a
tests(twa): Adapt integration tests to `production` mode
orfeas-k Jun 22, 2023
35a05b0
fixup! twa: Rewrite charm with sidecar pattern
orfeas-k Jun 23, 2023
d37f702
fixup! tests(twa): Rewrite TWA unit tests
orfeas-k Jun 23, 2023
a98dc2c
fixup! twa: Rewrite charm with sidecar pattern
orfeas-k Jun 26, 2023
8d06d32
twa: Rename _deploy_k8s_resources() to _apply_k8s_resources()
orfeas-k Jun 26, 2023
6b3c749
twa: Modify charm message when there is no ingress relation
orfeas-k Jun 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
strategy:
fail-fast: false
matrix:
charm: [tensorboard-controller]
charm: [tensorboard-controller, tensorboards-web-app]

steps:
- name: Check out code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/
__pycache__
*.charm
.idea
.vscode
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ To get started, install Kubeflow lite bundle (See [Quick start guide](https://ch

Then, deploy Tensorboard Controller and Tensorboard Web App with
```bash
juju deploy tensorboard-controller --channel=latest/edge
juju deploy tensorboards-web-app --channel=latest/edge
juju deploy tensorboard-controller --channel=latest/edge --trust
juju deploy tensorboards-web-app --channel=latest/edge --trust
```
And Create the following relations
```bash
juju relate istio-pilot:ingress tensorboards-web-app:ingress
juju relate istio-pilot:gateway tensorboard-controller:gateway
juju relate istio-pilot:gateway-info tensorboard-controller:gateway-info
```
For a quick example on using Tensorboard, see https://charmed-kubeflow.io/docs/kubeflow-basics
For more information, see https://juju.is/docs
Expand Down
71 changes: 71 additions & 0 deletions charms/tensorboards-web-app/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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/kubeflow-tensorboards-operator/issues) explaining your use case.
orfeas-k marked this conversation as resolved.
Show resolved Hide resolved
- 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 Tensorboards Web App charm using:

```shell
charmcraft pack
```

## Upgrade manifests
The charm uses Jinja2 templates in order to store manifests that need to be applied during its deployment. The process for upgrading them is:

### Spot the differences between versions of a manifest file

1. Install `kustomize` using the official documentation [instructions](https://kubectl.docs.kubernetes.io/installation/kustomize/)
2. Clone [Kubeflow manifests](https://github.com/kubeflow/manifests) repo locally
3. `cd` into the repo and checkout to the branch or tag of the target version.
4. Build the manifests with `kustomize` and save the file:

`kustomize build apps/tensorboard/tensorboards-web-app/upstream/overlays/istio >> rendered_manifest_vX.yaml`

5. Checkout to the branch or tag of the version of the current manifest
6. Build the manifest with `kustomize` (see step 4) and save the file
7. Compare both files to spot the differences (e.g. using diff)

### Introduce changes

Once the comparison is done, add any changes to the relevant ClusterRoles and ClusterRoleBindings to the
`templates/auth_manifests.yaml.j2` file and remember to:
* Use the current model as the namespace
* Use the application name as the name of any ClusterRoles, ClusterRoleBindings, or ServiceAccounts.


## 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.# Contributing
18 changes: 7 additions & 11 deletions charms/tensorboards-web-app/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
## Kubeflow Tensorboards Operator
## Tensorboards Web App Operator

### Overview
This charm encompasses the Kubernetes Python operator for Kubeflow Tensorboards (see
[CharmHub](https://charmhub.io/?q=kubeflow-tensorboards)).
This charm encompasses the Kubernetes Python operator for Kubeflow's Tensorboards Web App(see
[CharmHub](https://charmhub.io/tensorboards-web-app)).

The Kubeflow Tensorboards operator is a Python script that wraps the latest released version
of Kubeflow Tensorboards, providing lifecycle management and handling events such as install,
The Tensorboards Web App charmed operator is a Python script that wraps the latest released version
of Kubeflow's Tensorboards Web App, providing lifecycle management and handling events such as install,
upgrade, integrate, and remove.

## Install
## Usage

To install Kubeflow Tensorboards, run:

juju deploy kubeflow-tensorboards

For more information, see https://juju.is/docs
This charm is an integral part of the Kubeflow Tensorboards Operator bundle. In order to install and use the whole bundle, please refer to the instructions [here](../../README.md#usage).
8 changes: 2 additions & 6 deletions charms/tensorboards-web-app/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Copyright 2021 Canonical Ltd.
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.

options:
port:
type: int
default: 5000
description: HTTP port
backend-mode:
type: string
default: development
default: production
description: Which mode out of `development` or `production` the backend server should use
secure-cookies:
type: boolean
Expand Down
Loading
Loading