Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
CORTX-32897: Support default parameters for pre-merge job
Browse files Browse the repository at this point in the history
Since Motr-Hare-Single-Node-Cluster-Deployment-On-Rocky-Linux
will be used as a pre merge job we need to remove the parameters
that it accepts and run the job on dedicated machines.

Signed-off-by: Rinku Kothiya <rinku.kothiya@seagate.com>
  • Loading branch information
rkothiya committed Jul 18, 2022
1 parent 65bcdcb commit 36a3611
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
4 changes: 2 additions & 2 deletions scripts/install/usr/libexec/cortx-motr/motr-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ for s in m0d@* m0t1fs@* motr-client motr-kernel motr-mkfs motr-mkfs@* motr-serve
motr_services="$motr_services $s.service"
done

systemctl list-units --all $motr_services
systemctl list-units --all $motr_services | tee

m0_log 'Stopping motr-kernel with all dependencies ...'
systemctl stop motr-kernel || m0_exit 'Failed to stop motr-kernel.'

m0_log 'Stopping all Motr services ...'
systemctl stop $motr_services || m0_exit 'Failed to stop Motr services.'

systemctl list-units --all $motr_services
systemctl list-units --all $motr_services | tee

for s in $(systemctl list-units --failed $motr_services | awk '/failed/ {if ($4 == "failed") print $2}'); do
m0_log "Resetting failed state for $s."
Expand Down
61 changes: 32 additions & 29 deletions scripts/jenkins/motr-hare-1node-cluster.groovy
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
#!/usr/bin/env groovy
pipeline {
pipeline {
agent {
node {
label 'ssc-vm-g3-rhev4-1327'
label 'sncr'
}
}

parameters {
string(name: 'NODE_HOST', defaultValue: '', description: 'Node 1 Host FQDN', trim: true)
string(name: 'NODE_USER', defaultValue: '', description: 'Host machine root user', trim: true)
string(name: 'NODE_PASS', defaultValue: '', description: 'Host machine root user password', trim: true)
}

options {
timeout(time: 180, unit: 'MINUTES')
timestamps()
ansiColor('xterm')
ansiColor('xterm')
buildDiscarder(logRotator(numToKeepStr: "30"))
}

environment {
NODE_PASS = "${NODE_PASS.isEmpty() ? NODE_DEFAULT_SSH_CRED_PSW : NODE_PASS}"
}

stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "main"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'PathRestriction', excludedRegions: '', includedRegions: 'scripts/third-party-rpm/.*']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'cortx-admin-github', url: "https://github.com/Seagate/cortx-motr"]]])
}
}
stage ('Build rpm packages') {
stage ('Create Single node cluster') {
steps {
script { build_stage = env.STAGE_NAME }
sh label: 'to build motr and hare rpm', script: '''
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} hostname
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} git clone https://github.com/Seagate/cortx-motr
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "cd /root/cortx-motr ; /root/cortx-motr/scripts/build-prep-1node.sh -dev"
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "hctl bootstrap --mkfs singlenode.yaml"
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "dd if=/dev/urandom of=/tmp/128M bs=1M count=128"
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "/opt/seagate/cortx/hare/libexec/m0crate-io-conf > /root/crate.yaml"
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} "/root/cortx-motr/utils/m0crate -S /root/crate.yaml"
sh label: 'Download code and install single node cluster', script: '''
hostname
pwd
ln -s "$WORKSPACE" ../cortx-motr
#rm -rf cortx-motr
#git clone https://github.com/Seagate/cortx-motr
#cd cortx-motr
./scripts/install/usr/libexec/cortx-motr/motr-cleanup || true
losetup -D
./scripts/build-prep-1node.sh -dev
hctl bootstrap --mkfs ../singlenode.yaml
dd if=/dev/urandom of=/tmp/128M bs=1M count=128
/opt/seagate/cortx/hare/libexec/m0crate-io-conf > ./crate.yaml
./utils/m0crate -S ./crate.yaml
'''
}
}
}

post {
always {
script {
sh label: 'download_log_files', returnStdout: true, script: """
sshpass -p ${NODE_PASS} ssh -o StrictHostKeyChecking=no ${NODE_USER}@${NODE_HOST} rm -rf /root/cortx-motr
sh label: 'Clean up work space', returnStdout: true, script: """
pwd
cd "$WORKSPACE"
./scripts/install/usr/libexec/cortx-motr/motr-cleanup || true
losetup -D
make uninstall || true
ls -l ..
cd ../cortx-hare
make uninstall || true
cd ..
rm -f hare cortx-motr
echo Done
"""
cleanWs()
}
}
}
Expand Down

0 comments on commit 36a3611

Please sign in to comment.