Skip to content

Commit

Permalink
update components for cicd demo
Browse files Browse the repository at this point in the history
  • Loading branch information
gsunner committed Oct 29, 2019
1 parent 69e6043 commit 6d94368
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion examples/cicd-argocd/jenkins/show-jenkins-logs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ source ${STARTUP_DIR}/../settings.sh
KUBECTL="kubectl --context=${KUBE_CONTEXT}"

NAMESPACE_NAME=jenkins
${KUBECTL} logs -f $(kubectl --context="${KUBE_CONTEXT}" get pods -n ${NAMESPACE_NAME} -l app=jenkins -o jsonpath='{.items[0].metadata.name}') -n ${NAMESPACE_NAME}
${KUBECTL} logs -f $(kubectl --context="${KUBE_CONTEXT}" get pods -n ${NAMESPACE_NAME} -l app.kubernetes.io/component=jenkins-master -o jsonpath='{.items[0].metadata.name}') -n ${NAMESPACE_NAME}

9 changes: 5 additions & 4 deletions examples/cicd-argocd/jenkins/start-jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ KUBECTL="kubectl --context=${KUBE_CONTEXT}"

#JENKINS_CHART_VERSION=0.15.1
#JENKINS_CHART_VERSION=0.19.1
JENKINS_CHART_VERSION=0.39.0
#JENKINS_CHART_VERSION=0.39.0
JENKINS_CHART_VERSION=1.7.9

${KUBECTL} create namespace jenkins --dry-run -o yaml|${KUBECTL} apply -f -

helm install --kube-context="${KUBE_CONTEXT}" stable/jenkins \
--name jenkins \
--namespace jenkins \
--set rbac.install=true \
--set rbac.create=true \
--version $JENKINS_CHART_VERSION \
--set Master.AdminUser=$JENKINS_USER_NAME \
--set Master.AdminPassword=$JENKINS_USER_PASSWORD \
--set master.adminUser=$JENKINS_USER_NAME \
--set master.adminPassword=$JENKINS_USER_PASSWORD \
--values ${STARTUP_DIR}/values.yml

# create a rolebing for jenkins
Expand Down
15 changes: 10 additions & 5 deletions examples/cicd-argocd/jenkins/values.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
Master:
InstallPlugins:
- kubernetes:1.15.1
master:
installPlugins:
- kubernetes:1.20.2
- workflow-job:2.32
- workflow-aggregator:2.6
- credentials-binding:1.18
- git:3.9.3
- github:1.29.3
#local jenkins store needed for crumb
SecurityRealm: |-
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm"/>
securityRealm: |-
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm"/>
# Due an update, CSRF tokens (crumbs) are now only valid for the web session they were created.
# Set a system property to disable this.
# https://jenkins.io/doc/upgrade-guide/2.176/#SECURITY-626
javaOpts: "-Dhudson.security.csrf.DefaultCrumbIssuer.EXCLUDE_SESSION_ID=true"

5 changes: 3 additions & 2 deletions examples/cicd-argocd/seldon-core/do-rest-request-LOCALHOST.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import json

def rest_request_ambassador(deploymentName, request, endpoint="localhost:8003"):
namespace_name="default"
response = requests.post(
"http://" + endpoint + "/seldon/" + deploymentName + "/api/v0.1/predictions",
"http://" + endpoint + "/seldon/" + namespace_name + "/" + deploymentName + "/api/v0.1/predictions",
json=request)
return response.json()

def rest_request():
payload = {"data":{"names":["a","b"],"tensor":{"shape":[2,2],"values":[0,0,1,1]}}}
response_dict=rest_request_ambassador("seldon-deployment-example", payload, endpoint="localhost:8080")
response_dict=rest_request_ambassador("seldon-deployment-example", payload, endpoint="localhost:8003")
response_json=json.dumps(response_dict, sort_keys=True, indent=4, separators=(',', ': '))
print(response_json)

Expand Down
2 changes: 1 addition & 1 deletion examples/cicd-argocd/seldon-core/port-forard-ambassador
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ source ${STARTUP_DIR}/../settings.sh

KUBECTL="kubectl --context=${KUBE_CONTEXT}"

${KUBECTL} port-forward $(${KUBECTL} get pods -n default -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n default 8080:8080
${KUBECTL} port-forward $(${KUBECTL} get pods -n default -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n default 8003:8080

14 changes: 0 additions & 14 deletions examples/cicd-argocd/seldon-core/port-forard-api-server

This file was deleted.

0 comments on commit 6d94368

Please sign in to comment.