From 976c9e69aea9943112d7ad56f5256eaa1903a774 Mon Sep 17 00:00:00 2001 From: ryandawsonuk Date: Fri, 5 Apr 2019 17:08:21 +0100 Subject: [PATCH] run ambassador as root rather than downgrade --- helm-charts/seldon-core/values.yaml | 5 +++++ testing/scripts/k8s_utils.py | 4 ++-- testing/scripts/seldon_utils.py | 10 +++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/helm-charts/seldon-core/values.yaml b/helm-charts/seldon-core/values.yaml index 77509d5c22..22f9723976 100644 --- a/helm-charts/seldon-core/values.yaml +++ b/helm-charts/seldon-core/values.yaml @@ -1,5 +1,7 @@ ambassador: enabled: false + image: + tag: 0.52.1 replicaCount: 1 resources: limits: @@ -25,6 +27,9 @@ ambassador: rbac: create: true namespaced: true + securityContext: + runAsUser: 0 + runAsGroup: 0 # scope will be cluster wide unless below is set # env: # AMBASSADOR_SINGLE_NAMESPACE: "true" diff --git a/testing/scripts/k8s_utils.py b/testing/scripts/k8s_utils.py index fb1842d806..a15597dc42 100644 --- a/testing/scripts/k8s_utils.py +++ b/testing/scripts/k8s_utils.py @@ -94,7 +94,7 @@ def create_seldon_clusterwide_ksonnet(request): wait_seldon_ready() setup_finalizer_ksonnet(request) -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def port_forward(request): print("Setup: Port forward") p1 = Popen("kubectl port-forward $(kubectl get pods -n seldon -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].metadata.name}') -n seldon 8002:8080",stdout=subprocess.PIPE,shell=True, preexec_fn=os.setsid) @@ -120,7 +120,7 @@ def fin(): request.addfinalizer(fin) -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def port_forward_docker_repo(request): print("port-forward docker") p1 = Popen("POD_NAME=$(kubectl get pods -l app=docker-private-registry -n default |sed -e '1d'|awk '{print $1}') && kubectl port-forward ${POD_NAME} 5000:5000 -n default",stdout=subprocess.PIPE,shell=True, preexec_fn=os.setsid) diff --git a/testing/scripts/seldon_utils.py b/testing/scripts/seldon_utils.py index 272d260150..e79b81638e 100644 --- a/testing/scripts/seldon_utils.py +++ b/testing/scripts/seldon_utils.py @@ -26,7 +26,7 @@ def get_token(oauth_key,oauth_secret,namespace,endpoint): token = response.json()["access_token"] return token -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def rest_request_api_gateway(oauth_key,oauth_secret,namespace,endpoint="localhost:8002",data_size=5,rows=1,data=None): token = get_token(oauth_key,oauth_secret,namespace,endpoint) if data is None: @@ -42,7 +42,7 @@ def rest_request_api_gateway(oauth_key,oauth_secret,namespace,endpoint="localhos json=payload) return response -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def grpc_request_api_gateway(oauth_key,oauth_secret,namespace,rest_endpoint="localhost:8002",grpc_endpoint="localhost:8003",data_size=5,rows=1,data=None): token = get_token(oauth_key,oauth_secret,namespace,rest_endpoint) if data is None: @@ -63,7 +63,7 @@ def grpc_request_api_gateway(oauth_key,oauth_secret,namespace,rest_endpoint="loc response = stub.Predict(request=request,metadata=metadata) return response -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def rest_request_ambassador(deploymentName,namespace,endpoint="localhost:8003",data_size=5,rows=1,data=None): if data is None: shape, arr = create_random_data(data_size,rows) @@ -81,7 +81,7 @@ def rest_request_ambassador(deploymentName,namespace,endpoint="localhost:8003",d json=payload) return response -@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=7) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def rest_request_ambassador_auth(deploymentName,namespace,username,password,endpoint="localhost:8003",data_size=5,rows=1,data=None): if data is None: shape, arr = create_random_data(data_size,rows) @@ -101,7 +101,7 @@ def rest_request_ambassador_auth(deploymentName,namespace,username,password,endp auth=HTTPBasicAuth(username, password)) return response -@retry(wait_exponential_multiplier=1000, wait_exponential_max=100000, stop_max_attempt_number=9) +@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=5) def grpc_request_ambassador(deploymentName,namespace,endpoint="localhost:8004",data_size=5,rows=1,data=None): if data is None: shape, arr = create_random_data(data_size,rows)