Skip to content

Commit

Permalink
fix: redesign default images handling (#163)
Browse files Browse the repository at this point in the history
Move images list into a separate file and modify code to load it from it.

Refs #161
  • Loading branch information
i-chvets authored and misohu committed Sep 26, 2023
1 parent ae0cc08 commit 2ad7af9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
24 changes: 5 additions & 19 deletions charms/kserve-controller/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
https://discourse.charmhub.io/t/4208
"""

import json
import logging
from base64 import b64encode
from typing import Dict
Expand Down Expand Up @@ -48,25 +49,10 @@

CONFIG_FILES = ["src/templates/configmap_manifests.yaml.j2"]
CONTAINER_CERTS_DEST = "/tmp/k8s-webhook-server/serving-certs/"
DEFAULT_IMAGES = {
"configmap__agent": "kserve/agent:v0.10.0",
"configmap__batcher": "kserve/agent:v0.10.0",
"configmap__explainers__alibi": "kserve/alibi-explainer:latest",
"configmap__explainers__aix": "kserve/aix-explainer:latest",
"configmap__explainers__art": "kserve/art-explainer:latest",
"configmap__logger": "kserve/agent:v0.10.0",
"configmap__router": "kserve/router:v0.10.0",
"configmap__storageInitializer": "kserve/storage-initializer:v0.10.0",
"serving_runtimes__lgbserver": "kserve/lgbserver:v0.10.0",
"serving_runtimes__kserve_mlserver": "docker.io/seldonio/mlserver:1.0.0",
"serving_runtimes__paddleserver": "kserve/paddleserver:v0.10.0",
"serving_runtimes__pmmlserver": "kserve/pmmlserver:v0.10.0",
"serving_runtimes__sklearnserver": "kserve/sklearnserver:v0.10.0",
"serving_runtimes__tensorflow_serving": "tensorflow/serving:2.6.2",
"serving_runtimes__torchserve": "pytorch/torchserve-kfs:0.7.0",
"serving_runtimes__tritonserver": "nvcr.io/nvidia/tritonserver:21.09-py3",
"serving_runtimes__xgbserver": "kserve/xgbserver:v0.10.0",
}
DEFAULT_IMAGES_FILE = "src/default-custom-images.json"
with open(DEFAULT_IMAGES_FILE, "r") as json_file:
DEFAULT_IMAGES = json.load(json_file)

K8S_RESOURCE_FILES = [
"src/templates/crd_manifests.yaml.j2",
"src/templates/auth_manifests.yaml.j2",
Expand Down
20 changes: 20 additions & 0 deletions charms/kserve-controller/src/default-custom-images.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configmap__agent": "kserve/agent:v0.10.0",
"configmap__batcher": "kserve/agent:v0.10.0",
"configmap__explainers__alibi": "kserve/alibi-explainer:latest",
"configmap__explainers__aix": "kserve/aix-explainer:latest",
"configmap__explainers__art": "kserve/art-explainer:latest",
"configmap__logger": "kserve/agent:v0.10.0",
"configmap__router": "kserve/router:v0.10.0",
"configmap__storageInitializer": "kserve/storage-initializer:v0.10.0",
"serving_runtimes__lgbserver": "kserve/lgbserver:v0.10.0",
"serving_runtimes__kserve_mlserver": "docker.io/seldonio/mlserver:1.0.0",
"serving_runtimes__paddleserver": "kserve/paddleserver:v0.10.0",
"serving_runtimes__pmmlserver": "kserve/pmmlserver:v0.10.0",
"serving_runtimes__sklearnserver": "kserve/sklearnserver:v0.10.0",
"serving_runtimes__tensorflow_serving": "tensorflow/serving:2.6.2",
"serving_runtimes__torchserve": "pytorch/torchserve-kfs:0.7.0",
"serving_runtimes__tritonserver": "nvcr.io/nvidia/tritonserver:21.09-py3",
"serving_runtimes__xgbserver": "kserve/xgbserver:v0.10.0"
}

0 comments on commit 2ad7af9

Please sign in to comment.