Skip to content

Commit

Permalink
fix: redesign default images handling (#133)
Browse files Browse the repository at this point in the history
* fix: redesign default images handling
  • Loading branch information
NohaIhab committed Sep 26, 2023
1 parent 0b546f1 commit 6b76cdd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
25 changes: 4 additions & 21 deletions charms/katib-controller/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.

import json
import logging
from base64 import b64encode
from pathlib import Path
Expand All @@ -18,27 +19,9 @@
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus, MaintenanceStatus, WaitingStatus

DEFAULT_IMAGES = {
"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", # noqa: E501
"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",
}
DEFAULT_IMAGES_FILE = "src/default-custom-images.json"
with open(DEFAULT_IMAGES_FILE, "r") as json_file:
DEFAULT_IMAGES = json.load(json_file)

logger = logging.getLogger(__name__)

Expand Down
21 changes: 21 additions & 0 deletions charms/katib-controller/src/default-custom-images.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default_trial_template": "docker.io/kubeflowkatib/mxnet-mnist:v0.16.0-rc.1",
"early_stopping__medianstop": "docker.io/kubeflowkatib/earlystopping-medianstop:v0.16.0-rc.1",
"enas_cpu_template": "docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.16.0-rc.1",
"metrics_collector_sidecar__stdout": "docker.io/kubeflowkatib/file-metrics-collector:v0.16.0-rc.1",
"metrics_collector_sidecar__file": "docker.io/kubeflowkatib/file-metrics-collector:v0.16.0-rc.1",
"metrics_collector_sidecar__tensorflow_event": "docker.io/kubeflowkatib/tfevent-metrics-collector:v0.16.0-rc.1",
"pytorch_job_template__master": "docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.16.0-rc.1",
"pytorch_job_template__worker": "docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.16.0-rc.1",
"suggestion__random": "docker.io/kubeflowkatib/suggestion-hyperopt:v0.16.0-rc.1",
"suggestion__tpe": "docker.io/kubeflowkatib/suggestion-hyperopt:v0.16.0-rc.1",
"suggestion__grid": "docker.io/kubeflowkatib/suggestion-optuna:v0.16.0-rc.1",
"suggestion__hyperband": "docker.io/kubeflowkatib/suggestion-hyperband:v0.16.0-rc.1",
"suggestion__bayesianoptimization": "docker.io/kubeflowkatib/suggestion-skopt:v0.16.0-rc.1",
"suggestion__cmaes": "docker.io/kubeflowkatib/suggestion-goptuna:v0.16.0-rc.1",
"suggestion__sobol": "docker.io/kubeflowkatib/suggestion-goptuna:v0.16.0-rc.1",
"suggestion__multivariate_tpe": "docker.io/kubeflowkatib/suggestion-optuna:v0.16.0-rc.1",
"suggestion__enas": "docker.io/kubeflowkatib/suggestion-enas:v0.16.0-rc.1",
"suggestion__darts": "docker.io/kubeflowkatib/suggestion-darts:v0.16.0-rc.1",
"suggestion__pbt": "docker.io/kubeflowkatib/suggestion-pbt:v0.16.0-rc.1"
}

0 comments on commit 6b76cdd

Please sign in to comment.