Skip to content

Commit

Permalink
Merge pull request #1001 from gsunner/cicd-fix
Browse files Browse the repository at this point in the history
cicd demo  fixes
  • Loading branch information
seldondev authored Oct 29, 2019
2 parents bc59fed + f340d2a commit 9f777b1
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 39 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"

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

def rest_request_ambassador(deploymentName, request, endpoint="localhost:8003"):
def rest_request_ambassador(namespace_name, deploymentName, request, endpoint="localhost:8003"):
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("default", "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.

10 changes: 2 additions & 8 deletions examples/cicd-argocd/seldon-core/start-seldon-core
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ KUBECTL="kubectl --context=${KUBE_CONTEXT}"
${KUBECTL} apply -f ${STARTUP_DIR}/seldon-aggregate-to-admin.json

helm install --kube-context="${KUBE_CONTEXT}" ${SELDON_CORE_DIR}/helm-charts/seldon-core-operator --name seldon-core --set usageMetrics.enabled=true --namespace seldon-system
helm install --kube-context="${KUBE_CONTEXT}" ${SELDON_CORE_DIR}/helm-charts/seldon-core-oauth-gateway \
--name seldon-gateway \
--set serviceType=ClusterIP \
--namespace default
helm install --kube-context="${KUBE_CONTEXT}" stable/ambassador \
--name ambassador \
\
--namespace default
helm install --kube-context="${KUBE_CONTEXT}" stable/ambassador --name ambassador --namespace default --set crds.keep=false --set replicaCount=1

1 change: 0 additions & 1 deletion examples/cicd-argocd/seldon-core/stop-seldon-core
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source ${STARTUP_DIR}/../settings.sh
KUBECTL="kubectl --context=${KUBE_CONTEXT}"

helm delete --kube-context="${KUBE_CONTEXT}" seldon-core --purge || echo "ignore not found"
helm delete --kube-context="${KUBE_CONTEXT}" seldon-gateway --purge || echo "ignore not found"
helm delete --kube-context="${KUBE_CONTEXT}" ambassador --purge || echo "ignore not found"

# remove seldon crd access to admin role
Expand Down
4 changes: 2 additions & 2 deletions examples/cicd-argocd/watch-rollout-status
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ${KUBECTL} rollout status deployment.apps/argo-ui -n argo -w
${KUBECTL} rollout status deployment.apps/workflow-controller -n argo -w
${KUBECTL} rollout status deployment.apps/activity-monitor-deployment -n default -w
${KUBECTL} rollout status deployment.apps/docker-private-registry-deployment -n default -w
${KUBECTL} rollout status deployment.apps/seldon-core-seldon-apiserver -n default -w
${KUBECTL} rollout status deployment.apps/seldon-core-seldon-cluster-manager -n default -w
${KUBECTL} rollout status deployment/seldon-controller-manager -n seldon-system -w
${KUBECTL} rollout status deployment.apps/ambassador

${KUBECTL} rollout status deployment.apps/argocd-application-controller -n argocd -w
${KUBECTL} rollout status deployment.apps/argocd-repo-server -n argocd -w
Expand Down

0 comments on commit 9f777b1

Please sign in to comment.