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: Integration tests for set of Seldon rocks #150

Merged
merged 5 commits into from
Jun 15, 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
3 changes: 1 addition & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ jobs:
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
juju-channel: 2.9/stable
provider: microk8s
channel: 1.24/stable
# Pinned until this bug is resolved: https://bugs.launchpad.net/juju/+bug/1992833
bootstrap-options: "--agent-version=2.9.34"
microk8s-addons: "dns storage rbac metallb:10.64.140.43-10.64.140.49"

- name: Run integration tests
Expand Down
23 changes: 23 additions & 0 deletions examples/mlflowserver-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://docs.seldon.io/projects/seldon-core/en/latest/servers/mlflow.html
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: mlflow
spec:
name: wines
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "250m"
protocol: v2 # Activate the V2 protocol
predictors:
- graph:
children: []
implementation: MLFLOW_SERVER
modelUri: gs://seldon-models/mlflow/elasticnet_wine_1.8.0
name: classifier
name: default
replicas: 1
22 changes: 22 additions & 0 deletions examples/mlflowserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://docs.seldon.io/projects/seldon-core/en/latest/servers/mlflow.html
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: mlflow
spec:
name: wines
resources:
requests:
memory: "64Mi"
cpu: "500m"
limits:
memory: "128Mi"
cpu: "500m"
predictors:
- graph:
children: []
implementation: MLFLOW_SERVER
modelUri: gs://seldon-models/mlflow/elasticnet_wine_1.8.0
name: classifier
name: default
replicas: 1
23 changes: 23 additions & 0 deletions examples/xgboost-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://docs.seldon.io/projects/seldon-core/en/latest/servers/xgboost.html
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: xgboost
spec:
name: iris-predict
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "250m"
protocol: v2 # Activate the V2 protocol
predictors:
- graph:
children: []
implementation: XGBOOST_SERVER
modelUri: gs://seldon-models/xgboost/iris
name: classifier
name: default
replicas: 1
22 changes: 22 additions & 0 deletions examples/xgboost.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://docs.seldon.io/projects/seldon-core/en/latest/servers/xgboost.html
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: xgboost
spec:
name: iris
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "250m"
predictors:
- graph:
children: []
implementation: XGBOOST_SERVER
modelUri: gs://seldon-models/xgboost/iris
name: classifier
name: default
replicas: 1
8 changes: 8 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from lightkube import ApiError
from lightkube.generic_resource import load_in_cluster_generic_resources
from lightkube.models.core_v1 import ServicePort
from lightkube.resources.core_v1 import ConfigMap
from ops.charm import CharmBase
from ops.framework import EventBase, StoredState
from ops.main import main
Expand Down Expand Up @@ -406,6 +407,13 @@ def _on_remove(self, _):
self.configmap_resource_handler.lightkube_client,
configmap_resources_manifests,
)
# remove ConfigMap deployed by workload
self.configmap_resource_handler.lightkube_client.delete(
ConfigMap,
name="a33bd623.machinelearning.seldon.io",
namespace=self._namespace,
grace_period=0,
)
except ApiError as error:
# do not log/report when resources were not found
if error.status.code != 404:
Expand Down
Loading