Skip to content

Commit

Permalink
Merge pull request cloud-bulldozer#64 from chaitanyaenr/run_tests_fro…
Browse files Browse the repository at this point in the history
…m_jh

Use kubeconfig instead of oc login
  • Loading branch information
jtaleric authored Mar 2, 2020
2 parents beaec70 + db555d5 commit 0e5180b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
39 changes: 22 additions & 17 deletions jjb/dynamic/uperf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
- 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
# Run tests
set -x
pushd workloads/network-perf
# 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 OPTIONS="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ConnectionAttempts=100"
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
# run tests
pushd workloads/network-perf/
./run_hostnetwork_network_test_fromgit.sh
./run_pod_network_test_fromgit.sh
./run_serviceip_network_test_fromgit.sh
Expand All @@ -27,17 +32,17 @@
node: scale-ci
parameters:
- string:
default: "kubeadmin"
default: "root"
description: User name to access cluster.
name: CLUSTER_USER
name: ORCHESTRATION_USER
- string:
default: ""
description: Password for CLUSTER_USER to access cluster.
name: CLUSTER_PASSWORD
- string:
description: Host with the kubeconfig and oc client.
name: ORCHESTRATION_HOST
- password:
default: ""
description: The URL address to the openshift cluster to login to.
name: CLUSTER_API_URL
description: Token to access private repo containing ssh keys.
name: SSHKEY_TOKEN
- string:
default: ""
description: The elasticsearch server where the data will be indexed.
Expand Down
16 changes: 7 additions & 9 deletions pipeline-scripts/uperf.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ stage ('uperf') {
sh "wget ${UPERF_PROPERTIES_FILE} -O ${property_file_name}"
sh "cat ${property_file_name}"
def uperf_properties = readProperties file: property_file_name
def skip_tls = uperf_properties['SKIP_TLS_VERIFICATION']
def cluster_user = uperf_properties['CLUSTER_USER']
def cluster_password = uperf_properties['CLUSTER_PASSWORD']
def cluster_api_url = uperf_properties['CLUSTER_API_URL']
def orchestration_user = uperf_properties['ORCHESTRATION_USER']
def orchestration_host = uperf_properties['ORCHESTRATION_HOST']
def sshkey_token = uperf_properties['SSHKEY_TOKEN']
def es_server = uperf_properties['ES_SERVER']
def es_port = uperf_properties['ES_PORT']
def metadata_collection = uperf_properties['METADATA_COLLECTION']
Expand All @@ -33,10 +32,9 @@ stage ('uperf') {
try {
uperf_build = build job: 'RIPSAW-UPERF',
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: 'ORCHESTRATION_USER', value: orchestration_user ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_HOST', value: orchestration_host ],
[$class: 'hudson.model.PasswordParameterValue', name: 'SSHKEY_TOKEN', value: sshkey_token ],
[$class: 'StringParameterValue', name: 'ES_SERVER', value: es_server ],
[$class: 'StringParameterValue', name: 'ES_PORT', value: es_port ],
[$class: 'BooleanParameterValue', name: 'METADATA_COLLECTION', value: Boolean.valueOf(metadata_collection) ],
Expand All @@ -45,7 +43,7 @@ stage ('uperf') {
echo "UPERF Job failed with the following error: "
echo "${e.getMessage()}"
mail(
to: '[email protected]', '[email protected]',
to: '[email protected], [email protected]',
subject: 'Uperf job failed',
body: """\
Encoutered an error while running the uperf job: ${e.getMessage()}\n\n
Expand Down
7 changes: 3 additions & 4 deletions properties-files/uperf.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
SKIP_TLS_VERIFICATION=true
CLUSTER_USER=kubeadmin
CLUSTER_PASSWORD=
CLUSTER_API_URL=
ORCHESTRATION_USER=root
ORCHESTRATION_HOST=
SSHKEY_TOKEN=
ES_SERVER=
ES_PORT=
METADATA_COLLECTION=
Expand Down

0 comments on commit 0e5180b

Please sign in to comment.