Skip to content

Commit

Permalink
Use kubeconfig instead of oc login for router test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-sheth authored and chaitanyaenr committed Apr 6, 2020
1 parent bdebf8c commit 5dda02f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 49 deletions.
39 changes: 9 additions & 30 deletions jjb/dynamic/scale-ci_http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@
- shell: |+
set -o pipefail
set -eux
# Disable logging
set +x
if [[ $SKIP_TLS_VERIFICATION ]]; then
oc login -u ${CLUSTER_USER} -p ${CLUSTER_PASSWORD} ${CLUSTER_API_URL} --insecure-skip-tls-verify
else
oc login -u ${CLUSTER_USER} -p ${CLUSTER_PASSWORD} ${CLUSTER_API_URL}
fi
# Re-enable logging
set -x
# get perf keys to access orchestration host and set ssh session options
git clone https://${SSHKEY_TOKEN}@github.com/redhat-performance/perf-dept.git
export PUBLIC_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
export PRIVATE_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
export PBENCH_SSH_PUBLIC_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
export PBENCH_SSH_PRIVATE_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
chmod 600 ${PRIVATE_KEY}
# fetch the kubeconfig from the orchestration host
echo "Fetching the kubeconfig from the orchestration host"
scp ${OPTIONS} -i ${PRIVATE_KEY} ${ORCHESTRATION_USER}@${ORCHESTRATION_HOST}:$HOME/.kube/config ${WORKSPACE}/kubeconfig
export KUBECONFIG=${WORKSPACE}/kubeconfig
# Create inventory File:
echo "[orchestration]" > inventory
echo "${ORCHESTRATION_HOST}" >> inventory
Expand Down Expand Up @@ -61,31 +56,15 @@
This test is a data-plane workload generator that runs http requests through HAProxy into deployed pods.
This job is managed by https://github.com/openshift-scale/scale-ci-pipeline
disabled: false
name: ATS-SCALE-CI-HTTP
name: SCALE-CI-HTTP
node: scale-ci
parameters:
- bool:
default: true
description: skips tls verification during oc login
name: SKIP_TLS_VERIFICATION
- string:
default: "kubeadmin"
description: User name to access cluster.
name: CLUSTER_USER
- string:
default: ""
description: Password for CLUSTER_USER to access cluster.
name: CLUSTER_PASSWORD
- string:
default: ""
description: The URL address to the openshift cluster to login to.
name: CLUSTER_API_URL
- string:
default: ""
description: Token to access private repo containing ssh keys.
name: SSHKEY_TOKEN
- string:
default: "localhost"
default: ""
description: The machine intended to run the oc commands and launch the workload.
name: ORCHESTRATION_HOST
- string:
Expand Down
18 changes: 5 additions & 13 deletions pipeline-scripts/http.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ stage ('http_scale_test') {
sh "wget ${HTTP_TEST_PROPERTY_FILE} -O ${property_file_name}"
sh "cat ${property_file_name}"
def http_properties = readProperties file: property_file_name
def skip_tls = http_properties['SKIP_TLS_VERIFICATION']
def cluster_user = http_properties['CLUSTER_USER']
def cluster_password = http_properties['CLUSTER_PASSWORD']
def cluster_api_url = http_properties['CLUSTER_API_URL']
def sshkey_token = http_properties['SSHKEY_TOKEN']
def orchestration_host = http_properties['ORCHESTRATION_HOST']
def orchestration_user = http_properties['ORCHESTRATION_USER']
Expand Down Expand Up @@ -58,12 +54,8 @@ stage ('http_scale_test') {
def http_test_server_container_image = http_properties['HTTP_TEST_SERVER_CONTAINER_IMAGE']

try {
http_build = build job: 'ATS-SCALE-CI-HTTP',
http_build = build job: 'SCALE-CI-HTTP',
parameters: [ [$class: 'LabelParameterValue', name: 'node', label: node_label ],
[$class: 'BooleanParameterValue', name: 'SKIP_TLS_VERIFICATION', value: Boolean.valueOf(skip_tls) ],
[$class: 'StringParameterValue', name: 'CLUSTER_USER', value: cluster_user ],
[$class: 'StringParameterValue', name: 'CLUSTER_PASSWORD', value: cluster_password ],
[$class: 'StringParameterValue', name: 'CLUSTER_API_URL', value: cluster_api_url ],
[$class: 'StringParameterValue', name: 'SSHKEY_TOKEN', value: sshkey_token ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_HOST', value: orchestration_host ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_USER', value: orchestration_user ],
Expand Down Expand Up @@ -96,20 +88,20 @@ stage ('http_scale_test') {
[$class: 'StringParameterValue', name: 'HTTP_TEST_STRESS_CONTAINER_IMAGE', value: http_test_stress_container_image ],
[$class: 'StringParameterValue', name: 'HTTP_TEST_SERVER_CONTAINER_IMAGE', value: http_test_server_container_image ]]
} catch ( Exception e) {
echo "ATS-SCALE-CI-HTTP Job failed with the following error: "
echo "SCALE-CI-HTTP Job failed with the following error: "
echo "${e.getMessage()}"
echo "Sending an email"
mail(
to: 'nelluri@redhat.com',
subject: 'ATS-SCALE-CI-HTTP job failed',
to: 'msheth@redhat.com',
subject: 'SCALE-CI-HTTP job failed',
body: """\
Encoutered an error while running the ats-scale-ci-http job: ${e.getMessage()}\n\n
Jenkins job: ${env.BUILD_URL}
""")
currentBuild.result = "FAILURE"
sh "exit 1"
}
println "ATS-SCALE-CI-HTTP build ${http_build.getNumber()} completed successfully"
println "SCALE-CI-HTTP build ${http_build.getNumber()} completed successfully"
}
}
}
8 changes: 2 additions & 6 deletions properties-files/http.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
SKIP_TLS_VERIFICATION=true
CLUSTER_USER=kubeadmin
CLUSTER_PASSWORD=
CLUSTER_API_URL=
SSHKEY_TOKEN=
ORCHESTRATION_HOST=localhost
ORCHESTRATION_HOST=
ORCHESTRATION_USER=root
SSHKEY_TOKEN=
WORKLOAD_IMAGE=quay.io/openshift-scale/scale-ci-workload
WORKLOAD_JOB_NODE_SELECTOR=false
WORKLOAD_JOB_TAINT=false
Expand Down

0 comments on commit 5dda02f

Please sign in to comment.