Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding SSHKEY Repository as a parameter to scale-ci-baseline #73

Merged
merged 1 commit into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions jjb/dynamic/scale-ci_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
fi
# Re-enable logging
set -x
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}
git clone https://${SSHKEY_TOKEN}@${SSHKEY_REPO}
if [ -f ${WORKSPACE}/${SSHKEY_REPOPATH_PUB} ] && [ -f ${WORKSPACE}/${SSHKEY_REPOPATH_PRIV} ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update other jobs to do the same as they use the same logic to fetch the ssh keys.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be tackled in a separate PR I guess.

then
export PUBLIC_KEY=${WORKSPACE}/${SSHKEY_REPOPATH_PUB}
export PRIVATE_KEY=${WORKSPACE}/${SSHKEY_REPOPATH_PRIV}
export PBENCH_SSH_PUBLIC_KEY_FILE=${WORKSPACE}/${SSHKEY_REPOPATH_PUB}
export PBENCH_SSH_PRIVATE_KEY_FILE=${WORKSPACE}/${SSHKEY_REPOPATH_PRIV}
chmod 600 ${PRIVATE_KEY}
fi

# Create inventory File:
echo "[orchestration]" > inventory
Expand Down Expand Up @@ -137,6 +140,19 @@
description: 'Duration to run'
name: BASELINE_WORKLOAD_DURATION
trim: 'false'
- string:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will work when we are calling the individual job, the following minor changes are needed to get it working with the pipeline: the pipeline/build scripts read the properties file/config with the parameters and call the jobs. so the sample properties file ( https://github.com/openshift-scale/scale-ci-pipeline/blob/master/properties-files/baseline.properties ) and build script needs to be updated with the new parameters ( https://github.com/openshift-scale/scale-ci-pipeline/blob/master/pipeline-scripts/baseline.groovy#L46 ).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense @chaitanyaenr . I was looking at updating the individual tests as I'm not wanting to run them all. Would it be okay if I update the yaml, properties and groovy files for each test at a time and raise a pull request?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chaitanyaenr - could you please review the most recent changes in this request?

default: "github.com/redhat-performance/perf-dept.git"
description: 'Repository containing ssh keys for Ansible and pbench server'
name: SSHKEY_REPO
- string:
default: "perf-dept/ssh_keys/id_rsa_perf.pub"
description: 'path to public key file in ssh key repository'
name: SSHKEY_REPOPATH_PUB
- string:
default: "perf-dept/ssh_keys/id_rsa_perf"
description: 'path to private key file in ssh key repository'
name: SSHKEY_REPOPATH_PRIV

project-type: freestyle
properties:
- raw:
Expand Down
6 changes: 6 additions & 0 deletions pipeline-scripts/baseline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ stage ('baseline_scale_test') {
def cluster_password = baseline_properties['CLUSTER_PASSWORD']
def cluster_api_url = baseline_properties['CLUSTER_API_URL']
def sshkey_token = baseline_properties['SSHKEY_TOKEN']
def sshkey_repo = baseline_properties['SSHKEY_REPO']
def sshkey_repopath_pub = baseline_properties['SSHKEY_REPOPATH_PUB']
def sshkey_repopath_priv = baseline_properties['SSHKEY_REPOPATH_PRIV']
def orchestration_host = baseline_properties['ORCHESTRATION_HOST']
def orchestration_user = baseline_properties['ORCHESTRATION_USER']
def workload_image = baseline_properties['WORKLOAD_IMAGE']
Expand All @@ -49,6 +52,9 @@ stage ('baseline_scale_test') {
[$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: 'SSHKEY_REPO', value: sshkey_repo ],
[$class: 'StringParameterValue', name: 'SSHKEY_REPOPATH_PUB', value: sshkey_repopath_pub ],
[$class: 'StringParameterValue', name: 'SSHKEY_REPOPATH_PRIV', value: sshkey_repopath_priv ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_HOST', value: orchestration_host ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_USER', value: orchestration_user ],
[$class: 'StringParameterValue', name: 'WORKLOAD_IMAGE', value: workload_image ],
Expand Down
3 changes: 3 additions & 0 deletions properties-files/baseline.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ CLUSTER_USER=kubeadmin
CLUSTER_PASSWORD=
CLUSTER_API_URL=
SSHKEY_TOKEN=
SSHKEY_REPO=github.com/redhat-performance/perf-dept.git
SSHKEY_REPOPATH_PUB=perf-dept/ssh_keys/id_rsa_perf.pub
SSHKEY_REPOPATH_PRIV=perf-dept/ssh_keys/id_rsa_perf
ORCHESTRATION_HOST=localhost
ORCHESTRATION_USER=root
WORKLOAD_IMAGE=quay.io/openshift-scale/scale-ci-workload
Expand Down