← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium into lp:lp-staging-scripts

 

I think this is mostly OK, but would like to have another look over it once conflicts are fixed.

Diff comments:

> === modified file 'staging_restore.sh'
> --- staging_restore.sh	2020-05-22 13:39:08 +0000
> +++ staging_restore.sh	2020-05-28 08:56:52 +0000
> @@ -189,15 +189,31 @@
>      ssh launchpad@gandwana.internal rsync -a --delete /srv/staging.launchpad.net/staging/launchpad/ /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
>      ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/builddmaster.staging.launchpad.net/staging/launchpad/ /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
>      ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/importd.staging.launchpad.net/staging/launchpad/ /srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/bazaar.staging.launchpad.net/staging/launchpad/ /srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
> +    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete-after --exclude=sourcecode/launchpad-loggerhead/logs /srv/codebrowse.staging.launchpad.net/staging/launchpad/ /srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
>  
>      rsync -a --delete ${BUILTCODEDIR}/ importd@xxxxxxxxxxxxxxxxxxxxxxxx:/srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
>      rsync -a --delete ${BUILTCODEDIR}/ launchpad@xxxxxxxxxxxxxxxxxxxxx:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
> +<<<<<<< TREE
>      rsync -a --delete ${BUILTCODEDIR}/ launchpad@gandwana.internal:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
> +=======
> +    rsync -a --delete ${BUILTCODEDIR}/ launchpad@xxxxxxxxxxxxxxxxxxxxxx:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
> +    rsync -a -e 'ssh -p 922' --delete ${BUILTCODEDIR}/ supermirror@xxxxxxxxxxxxxxxxxxxxxxx:/srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
> +    rsync -a -e 'ssh -p 922' --delete ${BUILTCODEDIR}/ loggerhead@xxxxxxxxxxxxxxxxxxxxxxx:/srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
> +
> +>>>>>>> MERGE-SOURCE

You'll need to "bzr merge lp:lp-staging-scripts", resolve conflicts, and commit.

>      ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx "rsync -a --delete /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/" >> $LOGFILE 2>&1
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} build LPCONFIG=staging" >> $LOGFILE 2>&1
>      ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx "make -C /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging-ftpmaster" >> $LOGFILE 2>&1
>      ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
> +<<<<<<< TREE
>      ssh launchpad@gandwana.internal "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
> +=======
> +    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
> +    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
> +
> +>>>>>>> MERGE-SOURCE
>      # Let's put a "maintenance" file in place so nagios doesn't scream
>      # and cron jobs know to not process
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "date +%s > /srv/staging.launchpad.net/maintenance.txt"
> @@ -206,6 +222,14 @@
>      ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx touch /srv/importd.staging.launchpad.net/maintenance.txt >> $LOGFILE 2>&1
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "/srv/staging.launchpad.net/initscript stop" >> $LOGFILE 2>&1
>      ssh lp_buildd@xxxxxxxxxxxxxxxxxxxxx "sudo service buildd-manager stop" >> $LOGFILE 2>&1
> +    # Stop codehosting services on Tellurium

Machine names should normally be in all-lower-case.

> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging1 stop" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging1 stop" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging2 stop" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging2 stop" >> $LOGFILE 2>&1
> +    # Stop codebrowse services on Tellurium
> +    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "/srv/codebrowse.staging.launchpad.net/initscript stop" >> $LOGFILE 2>&1
> +
>      # Kill off any running cronjobs that block the DB updates
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "pkill -u 1000 -f staging.launchpad.net/staging/launchpad/cronscripts/"
>      ssh launchpad@gandwana.internal "pkill -u 1000 -f staging.launchpad.net/staging/launchpad/cronscripts/"
> @@ -330,14 +364,33 @@
>      # Now we want to restart the app server
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx /srv/staging.launchpad.net/initscript start >> $LOGFILE 2>&1
>      ssh lp_buildd@xxxxxxxxxxxxxxxxxxxxx sudo service buildd-manager start >> $LOGFILE 2>&1
> +<<<<<<< TREE
>      ssh launchpad@gandwana.internal "sudo service celeryd-staging_launchpad_job start" >> $LOGFILE 2>&1
>      ssh launchpad@gandwana.internal "sudo service celeryd-staging_bzrsyncd_job start" >> $LOGFILE 2>&1
> +=======
> +    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "sudo service celeryd-staging_launchpad_job start" >> $LOGFILE 2>&1
> +    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "sudo service celeryd-staging_bzrsyncd_job start" >> $LOGFILE 2>&1
> +
> +>>>>>>> MERGE-SOURCE
>      # Revert the offline message
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx rm -f /srv/staging.launchpad.net/www/root/offline.html
>      ssh launchpad@xxxxxxxxxxxxxxxxxxxxx ln -s /srv/staging.launchpad.net/staging/launchpad/lib/canonical/launchpad/offline-unplanned.html /srv/staging.launchpad.net/www/root/offline.html
>  
> -    # Can remove the maint file on tellurium once the app servers are back
> +    # bzr-sftp-staging wont start if maintanance file is active (currently) spm 2012-01-09

I think we can drop the sysadmin signature ("spm 2012-01-09") at this point.  Also fix the spelling mistakes ("won't", "maintenance").

> +    # Start codehosting services on tellurium and remove maintanance file

Similarly, "maintenance".

I think we should generally also avoid putting machine names in comments here.  The machine names are an implementation detail; comments explain the function, and don't need to repeat the implementation details.

> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging1 start" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging2 start" >> $LOGFILE 2>&1
>      ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "rm -f /srv/bazaar.staging.launchpad.net/maintenance.txt"
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging1 start" >> $LOGFILE 2>&1
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging2 start" >> $LOGFILE 2>&1
> +
> +    # Sync some branches from production for testing
> +    echo "$(date) Sync-ing branches from production"
> +    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/srv/bazaar.staging.launchpad.net/scripts/codehosting_branch_mirror.sh" >> $LOGFILE 2>&1
> +    echo "$(date) Sync-ed branches from production"

Just "Syncing" and "Synced", no hyphen.

> +
> +    # Start codebrowse services on tellurium
> +    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "/srv/codebrowse.staging.launchpad.net/initscript start" >> $LOGFILE 2>&1
>  
>      # Sync staging mailman to production
>      echo $(date) "About to sync mailman to production" >> $LOGFILE


-- 
https://code.launchpad.net/~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium/+merge/384703
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium into lp:lp-staging-scripts.


References