From 99a13c6057a07b7c87643f47a3d3e1c99872f3d3 Mon Sep 17 00:00:00 2001 From: ohnickmoy Date: Thu, 29 Feb 2024 13:29:01 -0500 Subject: [PATCH] fix: update user retirement scripts owned by SRE --- devops/jobs/MongoPruner.groovy | 16 ++++++++-------- devops/jobs/ReplaceUsernames.groovy | 10 +++++----- devops/resources/mongo-pruner.sh | 6 +++--- devops/resources/replace-usernames.sh | 6 +++--- devops/resources/user-retirement-archiver.sh | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/devops/jobs/MongoPruner.groovy b/devops/jobs/MongoPruner.groovy index cb5004051..520424fb1 100644 --- a/devops/jobs/MongoPruner.groovy +++ b/devops/jobs/MongoPruner.groovy @@ -3,8 +3,8 @@ Variables consumed for this job: * NOTIFY_ON_FAILURE: alert@example.com * FOLER_NAME: folder - * TUBULAR_REPO: repo where the mongo pruner script is located (required) - * TUBULAR_BRANCH: default is master + * EDX_PLATFORM_REPO: repo where the mongo pruner script is located (required) + * EDX_PLATFORM_BRANCH: default is master * DEPLOYMENTS: (required) environments: environment (required) @@ -43,25 +43,25 @@ class MongoPruner { } } - assert extraVars.containsKey('TUBULAR_REPO') : "Please define a tubular repo where the mongo pruner script is located" + assert extraVars.containsKey('EDX_PLATFORM_REPO') : "Please define a edx-platform repo where the mongo pruner script is located" parameters{ - stringParam('TUBULAR_REPO', extraVars.get('TUBULAR_REPO'), + stringParam('EDX_PLATFORM_REPO', extraVars.get('EDX_PLATFORM_REPO'), 'Git repo which contains the mongo pruner script.') - stringParam('TUBULAR_BRANCH', extraVars.get('TUBULAR_BRANCH', 'master'), + stringParam('EDX_PLATFORM_BRANCH', extraVars.get('EDX_PLATFORM_BRANCH', 'master'), 'e.g. tagname or origin/branchname') } multiscm{ git { remote { - url('$TUBULAR_REPO') - branch('$TUBULAR_BRANCH') + url('$EDX_PLATFORM_REPO') + branch('$EDX_PLATFORM_BRANCH') } extensions { cleanAfterCheckout() pruneBranches() - relativeTargetDirectory('tubular') + relativeTargetDirectory('edx-platform') } } } diff --git a/devops/jobs/ReplaceUsernames.groovy b/devops/jobs/ReplaceUsernames.groovy index 5b5c3f97c..d348b8c0c 100644 --- a/devops/jobs/ReplaceUsernames.groovy +++ b/devops/jobs/ReplaceUsernames.groovy @@ -24,7 +24,7 @@ class ReplaceUsernames { extraVars.get('ENVIRONMENTS').each { environment -> dslFactory.job("Enterprise/" + "${environment}-replace-usernames") { parameters { - stringParam('TUBULAR_BRANCH', 'master', 'Repo branch for the tubular scripts.') + stringParam('EDX_PLATFORM_BRANCH', 'master', 'Repo branch for the edx-platform scripts.') fileParam( 'username_replacements.csv', 'A CSV of [current_username,desired_username] for username replacement' @@ -41,11 +41,11 @@ class ReplaceUsernames { multiscm { git { remote { - url('https://github.com/edx/tubular.git') + url('https://github.com/openedx/edx-platform.git') } - branch('$TUBULAR_BRANCH') + branch('$EDX_PLATFORM_BRANCH') extensions { - relativeTargetDirectory('tubular') + relativeTargetDirectory('edx-platform') cloneOptions { shallow() timeout(10) @@ -69,7 +69,7 @@ class ReplaceUsernames { publishers { /* Save CSV from python script as artifact to be downloaded/viewed */ archiveArtifacts { - pattern('tubular/username_replacement_results.csv') + pattern('edx-platfor/username_replacement_results.csv') allowEmpty() defaultExcludes() } diff --git a/devops/resources/mongo-pruner.sh b/devops/resources/mongo-pruner.sh index 94f3e37ed..9201fce2c 100644 --- a/devops/resources/mongo-pruner.sh +++ b/devops/resources/mongo-pruner.sh @@ -8,8 +8,8 @@ create_virtualenv --python=python3.8 --clear . "$venvpath/bin/activate" set -u -cd $WORKSPACE/tubular -pip install -r requirements.txt +cd $WORKSPACE/edx-platform +pip install -r scripts/user_retirement/requirements/base.txt pip install awscli set +x @@ -36,7 +36,7 @@ IP_ADDRESSES=`aws ec2 describe-instances\ MONGO_IPS=`echo $IP_ADDRESSES | sed 's/ /,/g'` -python scripts/structures.py\ +python scripts/user_retirement/structures.py\ --database-name ${DATABASE_NAME}\ --connection "mongodb://${MONGO_USER}:${MONGO_PASSWORD}@${MONGO_IPS}/${DATABASE_NAME}" make_plan --retain 10 plan.json diff --git a/devops/resources/replace-usernames.sh b/devops/resources/replace-usernames.sh index 38909ee35..facfb1caf 100644 --- a/devops/resources/replace-usernames.sh +++ b/devops/resources/replace-usernames.sh @@ -22,10 +22,10 @@ export PYTHONIOENCODING=UTF-8 export LC_CTYPE=en_US.UTF-8 # prepare tubular -cd $WORKSPACE/tubular -pip install -r requirements.txt +cd $WORKSPACE/edx-platform +pip install -r scripts/user_retirement/requirements/base.txt # Call the script to replace the usernames for all users in the CSV file. -python scripts/replace_usernames.py \ +python scripts/user_retirement/replace_usernames.py \ --config_file=$USERNAME_REPLACEMENT_CONFIG_FILE \ --username_replacement_csv=$WORKSPACE/username_replacements.csv diff --git a/devops/resources/user-retirement-archiver.sh b/devops/resources/user-retirement-archiver.sh index 88d827b95..58014b659 100644 --- a/devops/resources/user-retirement-archiver.sh +++ b/devops/resources/user-retirement-archiver.sh @@ -30,7 +30,7 @@ set -x assume-role ${ROLE_ARN} -# prepare tubular +# prepare edx-platform cd $WORKSPACE/edx-platform pip install -r scripts/user_retirement/requirements/base.txt