Skip to content

Commit

Permalink
chore: bump seldon charm 1.15 -> 1.17.1 for CKF release 1.8 (#216)
Browse files Browse the repository at this point in the history
* bump seldon-core-operator 1.15.0 -> 1.17.1 for CKF 1.8
* manifests: Update CRD according to upstream manifests
* manifests: Update manifests roles names
* Use upstream images 1.17.1 for seldon servers
* tests(unit): Modify expected pebble plan
* tests(integration): Update expected huggingface output
* tests(integration): Update expected mlserver-mlflow output
* contributing.md: Add update manifests instructions
* gitignore: Ignore venv directory
  • Loading branch information
orfeas-k authored Oct 19, 2023
1 parent 4bab512 commit 29d7d3a
Show file tree
Hide file tree
Showing 16 changed files with 25,303 additions and 687 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ __pycache__/
.coverage
.idea
.tox
venv
13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,18 @@ juju model-config logging-config="<root>=INFO;unit=DEBUG"
# Deploy the charm
juju deploy ./seldon-core_ubuntu-20.04-amd64.charm \
--resource oci-image=$(yq '.resources."oci-image"."upstream-source"' metadata.yaml)
```

### Update manifests
Taking into account issue [#222](https://github.com/canonical/seldon-core-operator/issues/222), we need to manually update resources manifests for seldon. In order to do this:
1. In a clean cluster, apply upstream KF manifests using `kustomize build seldon-core-operator/base | kubectl apply -n kubeflow -f -` from the [kubeflow/manifests/contrib/seldon](https://github.com/kubeflow/manifests/tree/master/contrib/seldon) directory.
1. Check what resources have been created in the cluster (verify those by looking in the [initializer function](https://github.com/SeldonIO/seldon-core/blob/master/operator/utils/k8s/initializer.go#L46))
1. Go ahead and update our manifests accordingly

Do not forget to follow also the standard process (described in the Release Handbook) by doing `diff` between old and new version KF manifests for other manifests apart from those resources, like `auth_manifests`.

Note that, as with all sidecar charms, we do not include the `deployment` resource in our manifests since Pebble is responsible for creating the workload container in our case. However, we should consult any changes in the deployment that affect the container (e.g. its environment or command arguments).

## Canonical Contributor Agreement

Canonical welcomes contributions to this charm. Please check out our [contributor agreement](https://ubuntu.com/legal/contributors) if you're interested in contributing.
Canonical welcomes contributions to this charm. Please check out our [contributor agreement](https://ubuntu.com/legal/contributors) if you're interested in contributing.
138 changes: 103 additions & 35 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,124 +31,192 @@ options:
ambassador-single-namespace:
type: boolean
default: false
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
ambassador-version:
type: string
default: 'v2'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
controller-id:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
default-user-id:
type: string
default: '8888'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
deployment-name-as-prefix:
type: boolean
default: false
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-container-image-and-version:
type: string
default: 'docker.io/seldonio/seldon-core-executor:1.14.0'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
default: 'docker.io/seldonio/seldon-core-executor:1.17.1'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-container-image-pull-policy:
type: string
default: 'IfNotPresent'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-container-service-account-name:
type: string
default: 'default'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-container-user:
type: string
default: '8888'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-default-cpu-limit:
type: string
default: '0.5'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-default-cpu-request:
type: string
default: '0.5'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-default-memory-limit:
type: string
default: '512Mi'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-default-memory-request:
type: string
default: '512Mi'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-full-health-checks:
type: boolean
default: false
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-prometheus-path:
type: string
default: '/prometheus'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-request-logger-default-endpoint:
type: string
default: 'http://default-broker'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-request-logger-work-queue-size:
type: string
default: '2000'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-request-logger-write-timeout-ms:
type: string
default: '10000'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-server-metrics-port-name:
type: string
default: 'metrics'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
executor-server-port:
type: string
default: '8000'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
istio-gateway:
type: string
default: 'istio-system/seldon-gateway'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
istio-tls-mode:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-create-resources:
type: boolean
default: true
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-log-level:
type: string
default: 'INFO'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-leader-election-id:
type: string
default: 'a33bd623.machinelearning.seldon.io'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-leader-election-resource-lock:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-leader-election-lease-duration-secs:
type: string
default: '15'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-leader-election-renew-deadline-secs:
type: string
default: '10'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
manager-leader-election-retry-period-secs:
type: string
default: '2'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
predictive-unit-default-env-secret-ref-name:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
predictive-unit-metrics-port-name:
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
predictive-unit-grpc-service-port:
type: string
default: 'metrics'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
predictive-unit-service-port:
default: '9500'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
predictive-unit-http-service-port:
type: string
default: '9000'
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
predictive-unit-metrics-port-name:
type: string
default: 'metrics'
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-executor:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-explainer:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-explainer-v2:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-mlflowserver:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-mlflowserver-v2:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-mock-classifier:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-sklearnserver:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-sklearnserver-v2:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-storage-initializer:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-tensorflow:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-tfproxy:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-xgboostserver:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
related-image-xgboostserver-v2:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
use-executor:
type: boolean
default: true
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
watch-namespace:
type: string
default: ''
description: https://docs.seldon.io/projects/seldon-core/en/v1.14.0/reference/helm.html
description: https://docs.seldon.io/projects/seldon-core/en/latest/nav/reference.html
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
type: oci-image
description: 'Backing OCI image'
auto-fetch: true
upstream-source: 'docker.io/charmedkubeflow/seldon-core-operator:v1.15.0_22.04_1'
upstream-source: 'docker.io/seldonio/seldon-core-operator:1.17.1'
requires:
ambassador:
interface: service-mesh
Expand Down
58 changes: 55 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,32 @@ def __init__(self, *args):
self._name = self.model.app.name
self._metrics_port = self.model.config["metrics-port"]
self._webhook_port = self.model.config["webhook-port"]
self._manager_create_resources = self.model.config["manager-create-resources"]
self._manager_log_level = self.model.config["manager-log-level"]
self._manager_leader_election_id = self.model.config["manager-leader-election-id"]
self._manager_leader_election_resource_lock = self.model.config[
"manager-leader-election-resource-lock"
]
self._manager_leader_election_lease_duration_secs = self.model.config[
"manager-leader-election-lease-duration-secs"
]
self._manager_leader_election_renew_deadline_secs = self.model.config[
"manager-leader-election-renew-deadline-secs"
]
self._manager_leader_election_retry_period_secs = self.model.config[
"manager-leader-election-retry-period-secs"
]
self._exec_command = (
"/manager " "--enable-leader-election " f"--webhook-port {self._webhook_port} "
"/manager "
"--enable-leader-election "
f"--metrics-addr=:{self._metrics_port} "
f"--webhook-port {self._webhook_port} "
f"--log-level={self._manager_log_level} "
f"--leader-election-id={self._manager_leader_election_id} "
f"--leader-election-resource-lock={self._manager_leader_election_resource_lock} "
f"--leader-election-lease-duration-secs={self._manager_leader_election_lease_duration_secs} " # noqa: E501
f"--leader-election-renew-deadline-secs={self._manager_leader_election_renew_deadline_secs} " # noqa: E501
f"--leader-election-retry-period-secs={self._manager_leader_election_retry_period_secs} " # noqa: E501
)
self._container_name = "seldon-core"
self._container = self.unit.get_container(self._container_name)
Expand Down Expand Up @@ -213,8 +237,10 @@ def _get_env_vars(self):
ret_env_vars = {
"AMBASSADOR_ENABLED": str(bool(self.model.relations["ambassador"])).lower(),
"AMBASSADOR_SINGLE_NAMESPACE": str(config["ambassador-single-namespace"]).lower(),
"AMBASSADOR_VERSION": config["ambassador-version"],
"CONTROLLER_ID": config["controller-id"],
"DEFAULT_USER_ID": config["default-user-id"],
"DEPLOYMENT_NAME_AS_PREFIX": str(config["deployment-name-as-prefix"]).lower(),
"EXECUTOR_CONTAINER_IMAGE_AND_VERSION": config["executor-container-image-and-version"],
"EXECUTOR_CONTAINER_IMAGE_PULL_POLICY": config["executor-container-image-pull-policy"],
"EXECUTOR_CONTAINER_SERVICE_ACCOUNT_NAME": config[
Expand All @@ -225,32 +251,58 @@ def _get_env_vars(self):
"EXECUTOR_DEFAULT_CPU_REQUEST": config["executor-default-cpu-request"],
"EXECUTOR_DEFAULT_MEMORY_LIMIT": config["executor-default-memory-limit"],
"EXECUTOR_DEFAULT_MEMORY_REQUEST": config["executor-default-memory-request"],
"EXECUTOR_FULL_HEALTH_CHECKS": str(config["executor-full-health-checks"]).lower(),
"EXECUTOR_PROMETHEUS_PATH": config["executor-prometheus-path"],
"EXECUTOR_REQUEST_LOGGER_DEFAULT_ENDPOINT": config[
"executor-request-logger-default-endpoint"
],
"EXECUTOR_REQUEST_LOGGER_WORK_QUEUE_SIZE": config[
"executor-request-logger-work-queue-size"
],
"EXECUTOR_REQUEST_LOGGER_WRITE_TIMEOUT_MS": config[
"executor-request-logger-write-timeout-ms"
],
"EXECUTOR_SERVER_METRICS_PORT_NAME": config["executor-server-metrics-port-name"],
"EXECUTOR_SERVER_PORT": config["executor-server-port"],
"ISTIO_ENABLED": str(bool(self.model.relations["gateway-info"])).lower(),
"ISTIO_GATEWAY": istio_gateway,
"ISTIO_TLS_MODE": config["istio-tls-mode"],
"KEDA_ENABLED": str(bool(self.model.relations["keda"])).lower(),
"MANAGER_CREATE_RESOURCES": "true",
"MANAGER_CREATE_RESOURCES": str(config["manager-create-resources"]).lower(),
"MANAGER_LOG_LEVEL": config["manager-log-level"],
"MANAGER_LEADER_ELECTION_ID": config["manager-leader-election-id"],
"MANAGER_LEADER_ELECTION_RESOURCE_LOCK": config[
"manager-leader-election-resource-lock"
],
"MANAGER_LEADER_ELECTION_LEASE_DURATION_SECS": config[
"manager-leader-election-lease-duration-secs"
],
"MANAGER_LEADER_ELECTION_RENEW_DEADLINE_SECS": config[
"manager-leader-election-renew-deadline-secs"
],
"MANAGER_LEADER_ELECTION_RETRY_PERIOD_SECS": config[
"manager-leader-election-retry-period-secs"
],
"POD_NAMESPACE": self.model.name,
"PREDICTIVE_UNIT_DEFAULT_ENV_SECRET_REF_NAME": config[
"predictive-unit-default-env-secret-ref-name"
],
"PREDICTIVE_UNIT_GRPC_SERVICE_PORT": config["predictive-unit-grpc-service-port"],
"PREDICTIVE_UNIT_HTTP_SERVICE_PORT": config["predictive-unit-http-service-port"],
"PREDICTIVE_UNIT_METRICS_PORT_NAME": config["predictive-unit-metrics-port-name"],
"PREDICTIVE_UNIT_SERVICE_PORT": config["predictive-unit-service-port"],
"RELATED_IMAGE_EXECUTOR": config["related-image-executor"],
"RELATED_IMAGE_EXPLAINER": config["related-image-explainer"],
"RELATED_IMAGE_EXPLAINER_V2": config["related-image-explainer-v2"],
"RELATED_IMAGE_MLFLOWSERVER": config["related-image-mlflowserver"],
"RELATED_IMAGE_MLFLOWSERVER_V2": config["related-image-mlflowserver-v2"],
"RELATED_IMAGE_MOCK_CLASSIFIER": config["related-image-mock-classifier"],
"RELATED_IMAGE_SKLEARNSERVER": config["related-image-sklearnserver"],
"RELATED_IMAGE_SKLEARNSERVER_V2": config["related-image-sklearnserver-v2"],
"RELATED_IMAGE_STORAGE_INITIALIZER": config["related-image-storage-initializer"],
"RELATED_IMAGE_TENSORFLOW": config["related-image-tensorflow"],
"RELATED_IMAGE_TFPROXY": config["related-image-tfproxy"],
"RELATED_IMAGE_XGBOOSTSERVER": config["related-image-xgboostserver"],
"RELATED_IMAGE_XGBOOSTSERVER_V2": config["related-image-xgboostserver-v2"],
"USE_EXECUTOR": str(config["use-executor"]).lower(),
"WATCH_NAMESPACE": config["watch-namespace"],
}
Expand Down
Loading

0 comments on commit 29d7d3a

Please sign in to comment.