Skip to content

Commit

Permalink
run ambassador as root rather than downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandawsonuk committed Apr 5, 2019
1 parent 561157c commit 976c9e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions helm-charts/seldon-core/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ambassador:
enabled: false
image:
tag: 0.52.1
replicaCount: 1
resources:
limits:
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions testing/scripts/k8s_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions testing/scripts/seldon_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 976c9e6

Please sign in to comment.