Skip to content

Commit

Permalink
Merge pull request #2565 from anggao/fix-keda-notebook
Browse files Browse the repository at this point in the history
Fix keda notebook testing
  • Loading branch information
ukclivecox committed Oct 23, 2020
2 parents 2f6b3d7 + 7c93b2a commit 9da1f5e
Show file tree
Hide file tree
Showing 13 changed files with 5,629 additions and 18,851 deletions.
13 changes: 12 additions & 1 deletion examples/keda/keda_prom_auto_scale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"source": [
"## Install Seldon Core\n",
"\n",
"Install Seldon Core as described in [docs](https://docs.seldon.io/projects/seldon-core/en/latest/workflow/install.html)"
"Install Seldon Core as described in [docs](https://docs.seldon.io/projects/seldon-core/en/latest/workflow/install.html)\n",
"\n",
"Make sure add `--set istio.keda=true`"
],
"cell_type": "markdown",
"metadata": {}
Expand All @@ -56,6 +58,15 @@
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!helm install seldon-core-analytics ../../helm-charts/seldon-core-analytics -n seldon-system --wait"
]
},
{
"source": [
"## Install KEDA"
Expand Down
3 changes: 1 addition & 2 deletions examples/keda/model_with_keda_prom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ spec:
serverAddress: http://seldon-core-analytics-prometheus-seldon.seldon-system.svc.cluster.local
metricName: access_frequency
threshold: '10'
query: rate(seldon_api_executor_client_requests_seconds_count{seldon_app=~"seldon-model-example"}[10s])
terminationGracePeriodSeconds: 1
query: rate(seldon_api_executor_client_requests_seconds_count{seldon_app=~"seldon-model-example"}[1m])
graph:
children: []
endpoint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ rules:
- patch
- update
- apiGroups:
- keda.sh/v1alpha1
- keda.sh
resources:
- ScaledObject
- scaledobjects
verbs:
- create
- delete
Expand All @@ -91,9 +91,21 @@ rules:
- update
- watch
- apiGroups:
- keda.sh/v1alpha1
- keda.sh
resources:
- ScaledObject/status
- scaledobjects/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- keda.sh
resources:
- scaledobjects/status
verbs:
- get
- patch
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5,559 changes: 1,094 additions & 4,465 deletions operator/config/crd/bases/machinelearning.seldon.io_seldondeployments.yaml

Large diffs are not rendered by default.

18,083 changes: 3,835 additions & 14,248 deletions operator/config/crd_v1/bases/machinelearning.seldon.io_seldondeployments.yaml

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ rules:
- patch
- update
- apiGroups:
- keda.sh/v1alpha1
- keda.sh
resources:
- ScaledObject
- scaledobjects
verbs:
- create
- delete
Expand All @@ -86,9 +86,21 @@ rules:
- update
- watch
- apiGroups:
- keda.sh/v1alpha1
- keda.sh
resources:
- ScaledObject/status
- scaledobjects/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- keda.sh
resources:
- scaledobjects/status
verbs:
- get
- patch
Expand Down
5 changes: 3 additions & 2 deletions operator/controllers/seldondeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,8 +1675,9 @@ func (r *SeldonDeploymentReconciler) completeServiceCreation(instance *machinele
// +kubebuilder:rbac:groups=networking.istio.io,resources=destinationrules/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=keda.sh/v1alpha1,resources=ScaledObject,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=keda.sh/v1alpha1,resources=ScaledObject/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=keda.sh,resources=scaledobjects,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=keda.sh,resources=scaledobjects/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=keda.sh,resources=scaledobjects/finalizers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=machinelearning.seldon.io,resources=seldondeployments,verbs=get;list;watch;create;update;patch;delete
Expand Down
8 changes: 4 additions & 4 deletions python/licenses/license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ SOFTWARE.


Markdown
3.3.1
3.3.2
BSD License
Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
Expand Down Expand Up @@ -3401,7 +3401,7 @@ limitations under the License.


seldon-core
1.3.0.dev0
1.4.0.dev0
Apache 2.0
Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -4897,7 +4897,7 @@ Apache Software License


urllib3
1.25.10
1.25.11
MIT License
MIT License

Expand Down Expand Up @@ -4952,7 +4952,7 @@ POSSIBILITY OF SUCH DAMAGE.


zipp
3.3.0
3.3.1
MIT License
Copyright Jason R. Coombs

Expand Down
8 changes: 4 additions & 4 deletions python/licenses/license_info.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Flask-OpenTracing","1.1.0","BSD License"
"Jinja2","2.11.2","BSD License"
"Keras-Preprocessing","1.1.2","MIT License"
"Markdown","3.3.1","BSD License"
"Markdown","3.3.2","BSD License"
"MarkupSafe","1.1.1","BSD License"
"PyYAML","5.3.1","MIT License"
"Werkzeug","1.0.1","BSD License"
Expand Down Expand Up @@ -42,7 +42,7 @@
"requests","2.24.0","Apache Software License"
"requests-oauthlib","1.3.0","BSD License"
"rsa","4.6","Apache Software License"
"seldon-core","1.3.0.dev0","Apache 2.0"
"seldon-core","1.4.0.dev0","Apache 2.0"
"six","1.15.0","MIT License"
"tensorboard","2.3.0","Apache Software License"
"tensorboard-plugin-wit","1.7.0","Apache 2.0"
Expand All @@ -52,6 +52,6 @@
"threadloop","1.0.2","MIT License"
"thrift","0.13.0","Apache Software License"
"tornado","6.0.4","Apache Software License"
"urllib3","1.25.10","MIT License"
"urllib3","1.25.11","MIT License"
"wrapt","1.12.1","BSD License"
"zipp","3.3.0","MIT License"
"zipp","3.3.1","MIT License"
5 changes: 4 additions & 1 deletion testing/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ install_seldon: install_cert_manager
../../helm-charts/seldon-core-operator \
--namespace seldon-system \
--set istio.enabled=true \
--set keda.enabled=true \
--set istio.gateway=istio-system/seldon-gateway \
--set certManager.enabled=false \
--set executor.enabled=$(SELDON_E2E_TESTS_USE_EXECUTOR) \
Expand All @@ -92,6 +93,8 @@ install_istio:
kubectl rollout status deployment.apps/istio-citadel -n istio-system
kubectl create -f ../resources/seldon-gateway.yaml -n istio-system

install_keda:
kubectl apply -f https://github.com/kedacore/keda/releases/download/v2.0.0-beta/keda-2.0.0-beta.yaml

create_namespaces:
kubectl create namespace seldon || echo "Namespace seldon already exists"
Expand All @@ -104,7 +107,7 @@ set_namespace:
install_metrics:
kubectl apply -f metrics.yaml

kind_setup: create_namespaces helm_setup install_ambassador install_istio install_jaeger install_seldon set_namespace install_metrics
kind_setup: create_namespaces helm_setup install_ambassador install_istio install_keda install_jaeger install_seldon set_namespace install_metrics
port-forward-ambassador:
kubectl port-forward $$(kubectl get pods -n seldon -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n seldon 8003:8080

Expand Down
10 changes: 9 additions & 1 deletion testing/scripts/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ def test_istio_canary(self):
#

def test_keda_prom_auto_scale(self):
create_and_run_script("../../examples/keda", "keda_prom_auto_scale")
try:
create_and_run_script("../../examples/keda", "keda_prom_auto_scale")
except CalledProcessError as e:
run(
f"helm delete seldon-core-analytics --namespace seldon-system",
shell=True,
check=False,
)
raise e

#
# Misc
Expand Down

0 comments on commit 9da1f5e

Please sign in to comment.