Skip to content

Commit 5dda02f

Browse files
mohit-shethchaitanyaenr
authored andcommitted
Use kubeconfig instead of oc login for router test
1 parent bdebf8c commit 5dda02f

File tree

3 files changed

+16
-49
lines changed

3 files changed

+16
-49
lines changed

jjb/dynamic/scale-ci_http.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,20 @@
55
- shell: |+
66
set -o pipefail
77
set -eux
8-
9-
# Disable logging
10-
set +x
11-
if [[ $SKIP_TLS_VERIFICATION ]]; then
12-
oc login -u ${CLUSTER_USER} -p ${CLUSTER_PASSWORD} ${CLUSTER_API_URL} --insecure-skip-tls-verify
13-
else
14-
oc login -u ${CLUSTER_USER} -p ${CLUSTER_PASSWORD} ${CLUSTER_API_URL}
15-
fi
16-
17-
# Re-enable logging
18-
set -x
19-
8+
9+
# get perf keys to access orchestration host and set ssh session options
2010
git clone https://${SSHKEY_TOKEN}@github.com/redhat-performance/perf-dept.git
2111
export PUBLIC_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
2212
export PRIVATE_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
2313
export PBENCH_SSH_PUBLIC_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
2414
export PBENCH_SSH_PRIVATE_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
2515
chmod 600 ${PRIVATE_KEY}
2616
17+
# fetch the kubeconfig from the orchestration host
18+
echo "Fetching the kubeconfig from the orchestration host"
19+
scp ${OPTIONS} -i ${PRIVATE_KEY} ${ORCHESTRATION_USER}@${ORCHESTRATION_HOST}:$HOME/.kube/config ${WORKSPACE}/kubeconfig
20+
export KUBECONFIG=${WORKSPACE}/kubeconfig
21+
2722
# Create inventory File:
2823
echo "[orchestration]" > inventory
2924
echo "${ORCHESTRATION_HOST}" >> inventory
@@ -61,31 +56,15 @@
6156
This test is a data-plane workload generator that runs http requests through HAProxy into deployed pods.
6257
This job is managed by https://github.com/openshift-scale/scale-ci-pipeline
6358
disabled: false
64-
name: ATS-SCALE-CI-HTTP
59+
name: SCALE-CI-HTTP
6560
node: scale-ci
6661
parameters:
67-
- bool:
68-
default: true
69-
description: skips tls verification during oc login
70-
name: SKIP_TLS_VERIFICATION
71-
- string:
72-
default: "kubeadmin"
73-
description: User name to access cluster.
74-
name: CLUSTER_USER
75-
- string:
76-
default: ""
77-
description: Password for CLUSTER_USER to access cluster.
78-
name: CLUSTER_PASSWORD
79-
- string:
80-
default: ""
81-
description: The URL address to the openshift cluster to login to.
82-
name: CLUSTER_API_URL
8362
- string:
8463
default: ""
8564
description: Token to access private repo containing ssh keys.
8665
name: SSHKEY_TOKEN
8766
- string:
88-
default: "localhost"
67+
default: ""
8968
description: The machine intended to run the oc commands and launch the workload.
9069
name: ORCHESTRATION_HOST
9170
- string:

pipeline-scripts/http.groovy

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ stage ('http_scale_test') {
2121
sh "wget ${HTTP_TEST_PROPERTY_FILE} -O ${property_file_name}"
2222
sh "cat ${property_file_name}"
2323
def http_properties = readProperties file: property_file_name
24-
def skip_tls = http_properties['SKIP_TLS_VERIFICATION']
25-
def cluster_user = http_properties['CLUSTER_USER']
26-
def cluster_password = http_properties['CLUSTER_PASSWORD']
27-
def cluster_api_url = http_properties['CLUSTER_API_URL']
2824
def sshkey_token = http_properties['SSHKEY_TOKEN']
2925
def orchestration_host = http_properties['ORCHESTRATION_HOST']
3026
def orchestration_user = http_properties['ORCHESTRATION_USER']
@@ -58,12 +54,8 @@ stage ('http_scale_test') {
5854
def http_test_server_container_image = http_properties['HTTP_TEST_SERVER_CONTAINER_IMAGE']
5955

6056
try {
61-
http_build = build job: 'ATS-SCALE-CI-HTTP',
57+
http_build = build job: 'SCALE-CI-HTTP',
6258
parameters: [ [$class: 'LabelParameterValue', name: 'node', label: node_label ],
63-
[$class: 'BooleanParameterValue', name: 'SKIP_TLS_VERIFICATION', value: Boolean.valueOf(skip_tls) ],
64-
[$class: 'StringParameterValue', name: 'CLUSTER_USER', value: cluster_user ],
65-
[$class: 'StringParameterValue', name: 'CLUSTER_PASSWORD', value: cluster_password ],
66-
[$class: 'StringParameterValue', name: 'CLUSTER_API_URL', value: cluster_api_url ],
6759
[$class: 'StringParameterValue', name: 'SSHKEY_TOKEN', value: sshkey_token ],
6860
[$class: 'StringParameterValue', name: 'ORCHESTRATION_HOST', value: orchestration_host ],
6961
[$class: 'StringParameterValue', name: 'ORCHESTRATION_USER', value: orchestration_user ],
@@ -96,20 +88,20 @@ stage ('http_scale_test') {
9688
[$class: 'StringParameterValue', name: 'HTTP_TEST_STRESS_CONTAINER_IMAGE', value: http_test_stress_container_image ],
9789
[$class: 'StringParameterValue', name: 'HTTP_TEST_SERVER_CONTAINER_IMAGE', value: http_test_server_container_image ]]
9890
} catch ( Exception e) {
99-
echo "ATS-SCALE-CI-HTTP Job failed with the following error: "
91+
echo "SCALE-CI-HTTP Job failed with the following error: "
10092
echo "${e.getMessage()}"
10193
echo "Sending an email"
10294
mail(
103-
to: 'nelluri@redhat.com',
104-
subject: 'ATS-SCALE-CI-HTTP job failed',
95+
to: 'msheth@redhat.com',
96+
subject: 'SCALE-CI-HTTP job failed',
10597
body: """\
10698
Encoutered an error while running the ats-scale-ci-http job: ${e.getMessage()}\n\n
10799
Jenkins job: ${env.BUILD_URL}
108100
""")
109101
currentBuild.result = "FAILURE"
110102
sh "exit 1"
111103
}
112-
println "ATS-SCALE-CI-HTTP build ${http_build.getNumber()} completed successfully"
104+
println "SCALE-CI-HTTP build ${http_build.getNumber()} completed successfully"
113105
}
114106
}
115107
}

properties-files/http.properties

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
SKIP_TLS_VERIFICATION=true
2-
CLUSTER_USER=kubeadmin
3-
CLUSTER_PASSWORD=
4-
CLUSTER_API_URL=
5-
SSHKEY_TOKEN=
6-
ORCHESTRATION_HOST=localhost
1+
ORCHESTRATION_HOST=
72
ORCHESTRATION_USER=root
3+
SSHKEY_TOKEN=
84
WORKLOAD_IMAGE=quay.io/openshift-scale/scale-ci-workload
95
WORKLOAD_JOB_NODE_SELECTOR=false
106
WORKLOAD_JOB_TAINT=false

0 commit comments

Comments
 (0)