Skip to content

Commit

Permalink
Merge pull request #1713 from edx/ihassan/GSRE-997_update_dead_lock_job
Browse files Browse the repository at this point in the history
chore: Update check dead lock job to run for whitelisted regions
  • Loading branch information
syedimranhassan authored Dec 12, 2023
2 parents 245c19e + caaea74 commit 4ad2e30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions devops/jobs/ExportRDSDeadLocks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ class ExportRDSDeadLocks {
rdsignore = "${rdsignore}-i ${ignore} "
}

def whitelistregions = ""
configuration.REGION_LIST.each { include ->
whitelistregions = "${whitelistregions}-r ${include} "
}

environmentVariables {
env('AWS_DEFAULT_REGION', extraVars.get('REGION'))
env('ENVIRONMENT', environment)
env('HOSTNAME', extraVars.get('SPLUNKHOSTNAME'))
env('PORT', extraVars.get('PORT'))
env('INDEXNAME', INDEXNAME)
env('RDSIGNORE', rdsignore)
env('WHITELISTREGIONS', whitelistregions)
}

multiscm {
Expand Down
6 changes: 3 additions & 3 deletions devops/jobs/ListMysqlProcess.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class ListMysqlProcess {
rdsignore = "${rdsignore}-i ${ignore} "
}

def regioninclude = ""
def whitelistregions = ""
configuration.REGION_LIST.each { include ->
regioninclude = "${regioninclude}-r ${include} "
whitelistregions = "${whitelistregions}-r ${include} "
}

environmentVariables {
env('AWS_DEFAULT_REGION', extraVars.get('REGION'))
env('ENVIRONMENT', environment)
env('RDSIGNORE', rdsignore)
env('REGIONINCLUDE', regioninclude)
env('WHITELISTREGIONS', whitelistregions)
}

multiscm {
Expand Down
5 changes: 4 additions & 1 deletion devops/resources/export-dead-locks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ set -x
if [[ ! -v RDSIGNORE ]]; then
RDSIGNORE=""
fi
if [[ ! -v WHITELISTREGIONS ]]; then
WHITELISTREGIONS=""
fi

python export_dead_locks.py --environment ${ENVIRONMENT} --hostname ${HOSTNAME} --port ${PORT} --indexname ${INDEXNAME} ${RDSIGNORE}
python export_dead_locks.py --environment ${ENVIRONMENT} --hostname ${HOSTNAME} --port ${PORT} --indexname ${INDEXNAME} ${RDSIGNORE} ${WHITELISTREGIONS}
6 changes: 3 additions & 3 deletions devops/resources/list-mysql-process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ set -x
if [[ ! -v RDSIGNORE ]]; then
RDSIGNORE=""
fi
if [[ ! -v REGIONINCLUDE ]]; then
REGIONINCLUDE=""
if [[ ! -v WHITELISTREGIONS ]]; then
WHITELISTREGIONS=""
fi

python list_mysql_process.py --environment ${ENVIRONMENT} ${RDSIGNORE} ${REGIONINCLUDE}
python list_mysql_process.py --environment ${ENVIRONMENT} ${RDSIGNORE} ${WHITELISTREGIONS}

0 comments on commit 4ad2e30

Please sign in to comment.