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

Kf 3994 configurable images #98

Merged
merged 11 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,40 @@ jobs:
- name: Check flake8
run: flake8 ./charms/*/src

charm-integration:
name: Integration tests (microk8s)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
charm:
- controller
steps:
- uses: actions/checkout@v3
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.24/stable
juju-channel: 2.9/stable
charmcraft-channel: latest/candidate

# TODO: Remove once the actions-operator does this automatically
- name: Configure kubectl
run: |
sg microk8s -c "microk8s config > ~/.kube/config"
misohu marked this conversation as resolved.
Show resolved Hide resolved

- run: |
sg microk8s -c "tox -e ${{ matrix.charm }}-integration"

# Collect debug logs if failed
- name: Dump Juju/k8s logs on failure
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
if: always()
with:
app: ${{ matrix.charm }}
model: testing

test-bundle:
name: Test the bundle
runs-on: ubuntu-20.04
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,39 @@ available charm run:
If you aim to use Katib within an existing Kubeflow deployment in order to use it within the Kubeflow dashboard, you will have to integrate `katib-ui` to `istio-pilot` with the following command:

juju relate istio-pilot katib-ui

## Setting Custom Images for Katib Controller

Katib controller comes with a set of preconfigured images that are used in Katib workloads. This is the list of default images used in charm.

```json
misohu marked this conversation as resolved.
Show resolved Hide resolved
{
"default_trial_template": "docker.io/kubeflowkatib/mxnet-mnist:v0.15.0",
"early_stopping__medianstop": "docker.io/kubeflowkatib/earlystopping-medianstop:v0.15.0",
"enas_cpu_template": "docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.15.0",
"metrics_collector_sidecar__stdout": "docker.io/kubeflowkatib/file-metrics-collector:v0.15.0",
"metrics_collector_sidecar__file": "docker.io/kubeflowkatib/file-metrics-collector:v0.15.0",
"metrics_collector_sidecar__tensorflow_event": "docker.io/kubeflowkatib/tfevent-metrics-collector:v0.15.0",
"pytorch_job_template__master": "docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.15.0",
"pytorch_job_template__worker": "docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.15.0",
"suggestion__random": "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0",
"suggestion__tpe": "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0",
"suggestion__grid": "docker.io/kubeflowkatib/suggestion-optuna:v0.15.0",
"suggestion__hyperband": "docker.io/kubeflowkatib/suggestion-hyperband:v0.15.0",
"suggestion__bayesianoptimization": "docker.io/kubeflowkatib/suggestion-skopt:v0.15.0",
"suggestion__cmaes": "docker.io/kubeflowkatib/suggestion-goptuna:v0.15.0",
"suggestion__sobol": "docker.io/kubeflowkatib/suggestion-goptuna:v0.15.0",
"suggestion__multivariate_tpe": "docker.io/kubeflowkatib/suggestion-optuna:v0.15.0",
"suggestion__enas": "docker.io/kubeflowkatib/suggestion-enas:v0.15.0",
"suggestion__darts": "docker.io/kubeflowkatib/suggestion-darts:v0.15.0",
"suggestion__pbt": "docker.io/kubeflowkatib/suggestion-pbt:v0.15.0",
}
```

These images can be overridden in the charm configuration under custom_images in the charms/katib-controller/config.yaml file. Whenever you leave the image field empty in the config, the default image will be used. You can specify your own images with the config by filling one or multiple entries. The config accepts either YAML or JSON entries. For example.

```
juju config katib-controller custom_images='{"default_trial_template": "custom:1.0", "early_stopping__medianstop": "cuustom:2.1"}'
```

These images are being used in *.j2 files under charms/katib-controller/src/templates/*.j2.
25 changes: 25 additions & 0 deletions charms/katib-controller/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,28 @@ options:
type: int
default: 8080
description: Metrics port
custom_images:
type: string
default: |
default_trial_template: ''
early_stopping__medianstop: ''
enas_cpu_template: ''
metrics_collector_sidecar__stdout: ''
metrics_collector_sidecar__file: ''
metrics_collector_sidecar__tensorflow_event: ''
pytorch_job_template__master: ''
pytorch_job_template__worker: ''
suggestion__random: ''
suggestion__tpe: ''
suggestion__grid: ''
suggestion__hyperband: ''
suggestion__bayesianoptimization: ''
suggestion__cmaes: ''
suggestion__sobol: ''
suggestion__multivariate_tpe: ''
suggestion__enas: ''
suggestion__darts: ''
suggestion__pbt: ''
description: >
YAML or JSON formatted input defining images to use in Katib
For usage details, see https://github.com/canonical/katib-operators.
3 changes: 3 additions & 0 deletions charms/katib-controller/requirements-integration.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
juju==2.9.44
lightkube
pytest-operator
204 changes: 204 additions & 0 deletions charms/katib-controller/requirements-integration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements-integration.in
#
anyio==3.7.1
# via httpcore
asttokens==2.2.1
# via stack-data
backcall==0.2.0
# via ipython
bcrypt==4.0.1
# via paramiko
cachetools==5.3.1
# via google-auth
certifi==2023.7.22
# via
# httpcore
# httpx
# kubernetes
# requests
cffi==1.15.1
# via
# cryptography
# pynacl
charset-normalizer==3.2.0
# via requests
cryptography==41.0.2
# via paramiko
decorator==5.1.1
# via
# ipdb
# ipython
exceptiongroup==1.1.2
# via
# anyio
# pytest
executing==1.2.0
# via stack-data
google-auth==2.22.0
# via kubernetes
h11==0.14.0
# via httpcore
httpcore==0.17.3
# via httpx
httpx==0.24.1
# via lightkube
idna==3.4
# via
# anyio
# httpx
# requests
iniconfig==2.0.0
# via pytest
ipdb==0.13.13
# via pytest-operator
ipython==8.12.2
# via ipdb
jedi==0.18.2
# via ipython
jinja2==3.1.2
# via pytest-operator
juju==2.9.44
# via
# -r requirements-integration.in
# pytest-operator
jujubundlelib==0.5.7
# via theblues
kubernetes==27.2.0
# via juju
lightkube==0.14.0
# via -r requirements-integration.in
lightkube-models==1.27.1.4
# via lightkube
macaroonbakery==1.3.1
# via
# juju
# theblues
markupsafe==2.1.3
# via jinja2
matplotlib-inline==0.1.6
# via ipython
mypy-extensions==1.0.0
# via typing-inspect
oauthlib==3.2.2
# via
# kubernetes
# requests-oauthlib
packaging==23.1
# via pytest
paramiko==2.12.0
# via juju
parso==0.8.3
# via jedi
pexpect==4.8.0
# via ipython
pickleshare==0.7.5
# via ipython
pluggy==1.2.0
# via pytest
prompt-toolkit==3.0.39
# via ipython
protobuf==3.20.3
# via macaroonbakery
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
pyasn1==0.5.0
# via
# juju
# pyasn1-modules
# rsa
pyasn1-modules==0.3.0
# via google-auth
pycparser==2.21
# via cffi
pygments==2.15.1
# via ipython
pymacaroons==0.13.0
# via macaroonbakery
pynacl==1.5.0
# via
# macaroonbakery
# paramiko
# pymacaroons
pyrfc3339==1.1
# via
# juju
# macaroonbakery
pytest==7.4.0
# via
# pytest-asyncio
# pytest-operator
pytest-asyncio==0.21.1
# via pytest-operator
pytest-operator==0.28.0
# via -r requirements-integration.in
python-dateutil==2.8.2
# via kubernetes
pytz==2023.3
# via pyrfc3339
pyyaml==6.0.1
# via
# juju
# jujubundlelib
# kubernetes
# lightkube
# pytest-operator
requests==2.31.0
# via
# kubernetes
# macaroonbakery
# requests-oauthlib
# theblues
requests-oauthlib==1.3.1
# via kubernetes
rsa==4.9
# via google-auth
six==1.16.0
# via
# google-auth
# kubernetes
# macaroonbakery
# paramiko
# pymacaroons
# python-dateutil
sniffio==1.3.0
# via
# anyio
# httpcore
# httpx
stack-data==0.6.2
# via ipython
theblues==0.5.2
# via juju
tomli==2.0.1
# via
# ipdb
# pytest
toposort==1.10
# via juju
traitlets==5.9.0
# via
# ipython
# matplotlib-inline
typing-extensions==4.7.1
# via
# ipython
# typing-inspect
typing-inspect==0.9.0
# via juju
urllib3==1.26.16
# via
# google-auth
# kubernetes
# requests
wcwidth==0.2.6
# via prompt-toolkit
websocket-client==1.5.3
# via kubernetes
websockets==7.0
# via juju
3 changes: 3 additions & 0 deletions charms/katib-controller/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
jinja2
ops
oci-image
# Pinning until this resolves https://github.com/yaml/pyyaml/issues/724
pyyaml==6.0.1
10 changes: 8 additions & 2 deletions charms/katib-controller/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
#
# pip-compile requirements.in
#
jinja2==3.1.2
# via -r requirements.in
markupsafe==2.1.3
# via jinja2
oci-image==1.0.0
# via -r requirements.in
ops==2.3.0
# via -r requirements.in
pyyaml==6.0
# via ops
pyyaml==6.0.1
# via
# -r requirements.in
# ops
websocket-client==1.5.3
# via ops
Loading