You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Scap/Release: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>JMeybohm
imported>Elukey
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
To prepare a new release of the Debian package for Scap, the '''Release Engineering Team''' needs to follow the steps in [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/tools/scap/+/master/RELEASE.md RELEASE.md] (in the Scap git repository), and then the '''SRE team''' needs to build and deploy the package, which are listed below.
To prepare a new release of the Debian package for Scap, the '''Release Engineering Team''' needs to follow the steps in [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/tools/scap/+/master/RELEASE.md RELEASE.md] (in the Scap git repository), and then the '''SRE team''' needs to build and deploy the package, which are listed below.


The Debian package for scap can be built with <code>git-buildpackage</code>. More specifically: for production the standard procedure is to have a Debian source package built on the <tt>package_builder</tt> machine.
The Debian package for scap can be built with <code>git-buildpackage</code>. More specifically: for production the standard procedure is to have a Debian source package built on the <tt>package_builder</tt> machine (deneb).


   git clone <nowiki>https://gerrit.wikimedia.org/r/mediawiki/tools/scap</nowiki>  
   git clone <nowiki>https://gerrit.wikimedia.org/r/mediawiki/tools/scap</nowiki>  
Line 17: Line 17:


   export DIST="buster"
   export DIST="buster"
   V=4.1.1 # Change as appropriate
   V=4.0.0 # Change as appropriate
   rsync -vaz deneb.codfw.wmnet::pbuilder-result/$DIST-amd64/*scap*$V* deb/
   rsync -vaz build2001.codfw.wmnet::pbuilder-result/$DIST-amd64/*scap*$V* deb/
   sudo -i reprepro --ignore=wrongdistribution include $DIST-wikimedia $(pwd)/deb/scap_${V}-1_amd64.changes
   sudo -i reprepro --ignore=wrongdistribution include $DIST-wikimedia $(pwd)/deb/scap_${V}-1_amd64.changes
   # scap is compatible as-is with stretch and bullseye, just copy the package there
   # scap is compatible as-is with stretch and bullseye, just copy the package there
Line 36: Line 36:


* If you just uploaded the package, use cumin to run <code>apt-get update</code> on the hosts or wait until puppet will do it automatically
* If you just uploaded the package, use cumin to run <code>apt-get update</code> on the hosts or wait until puppet will do it automatically
*Start by deploying to <code>mw-canary</code>, <code>mw-jobrunner-canary</code>, <code>parsoid-canary</code> (cumin aliases), then login to '''<code>mwdebug*</code>''' servers and check there if a '''<code>scap pull</code>''' still works:<syntaxhighlight lang="bash">
*Generate a debdeploy-spec using <code>generate-debdeploy-spec</code> on cumin:
**name: <code>scap</code>
**comment: optional or task ID
**update type: <code>tool</code>
**fixed versions in bullseye, buster and stretch: <code>4.0.0-1</code> (change as appropriate, use Debian naming schema)
**skip renaming
*Start by deploying to <code>mw-canary</code>, <code>mw-jobrunner-canary</code>, <code>parsoid-canary</code> (on cumin using following aliases)<syntaxhighlight lang="bash">
sudo debdeploy deploy -Q 'A:mw-canary or A:parsoid-canary or A:mw-jobrunner-canary' -u $(date '+%Y-%m-%d-scap.yaml')
sudo debdeploy deploy -Q 'A:mw-canary or A:parsoid-canary or A:mw-jobrunner-canary' -u $(date '+%Y-%m-%d-scap.yaml')
</syntaxhighlight>  
</syntaxhighlight>  
*login to '''<code>mwdebug*</code>''' servers and check there if a '''<code>scap pull</code>''' still works


*Also deploy to <code>restbase-canary</code> so someone can check that scap still works for the scap3 code path, and on stretch. You will need someone to run a null deployment on restbase.<syntaxhighlight lang="bash">
*Also deploy to <code>restbase-canary</code> (on cumin using following aliases):<syntaxhighlight lang="bash">
cd /srv/deployment/restbase/deploy; scap deploy -l restbase-canary-host "scap testing"
sudo debdeploy deploy -Q 'A:restbase-canary' -u $(date '+%Y-%m-%d-scap.yaml')
</syntaxhighlight>
*Check if scap still works for the scap3 code path, and on stretch. You will need to run a test deployment to test environment. Run the following deploy from deploy hosts:<syntaxhighlight lang="bash">
cd /srv/deployment/restbase/deploy/; scap deploy --environment dev-cluster
...
canary deploy successful. Continue? [y]es/[n]o/[c]ontinue all groups: n
Rollback all deployed groups? [Y/n]: Y
</syntaxhighlight>
*Later or the next day you can rollout to <code>all</code> (on cumin).<syntaxhighlight lang="bash">
sudo debdeploy deploy -s all -u $(date '+%Y-%m-%d-scap.yaml')
</syntaxhighlight>
</syntaxhighlight>
*Later or the next day you can rollout to <code>all</code>.




===Resources===
===Resources===
There are Debian [https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version Versioning guidelines]
There are Debian [https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version Versioning guidelines]

Revision as of 08:27, 28 April 2022

This page is documentation for releasing a new version of Scap to Wikimedia Production.

Building

To prepare a new release of the Debian package for Scap, the Release Engineering Team needs to follow the steps in RELEASE.md (in the Scap git repository), and then the SRE team needs to build and deploy the package, which are listed below.

The Debian package for scap can be built with git-buildpackage. More specifically: for production the standard procedure is to have a Debian source package built on the package_builder machine (deneb).

 git clone https://gerrit.wikimedia.org/r/mediawiki/tools/scap 
 cd scap
 V=4.0.0 # Change value as appropriate
 git checkout -b $V $V
 WIKIMEDIA=yes gbp buildpackage -sa -us -uc --git-pbuilder --git-no-pbuilder-autoconf --git-dist=buster --git-debian-branch=$V

Uploading to apt repos

The resulting package will be in /var/cache/pbuilder/result/buster-amd64/ and needs to be uploaded to the apt repo (e.g. from apt1001.wikimedia.org)

 export DIST="buster"
 V=4.0.0 # Change as appropriate
 rsync -vaz build2001.codfw.wmnet::pbuilder-result/$DIST-amd64/*scap*$V* deb/
 sudo -i reprepro --ignore=wrongdistribution include $DIST-wikimedia $(pwd)/deb/scap_${V}-1_amd64.changes
 # scap is compatible as-is with stretch and bullseye, just copy the package there
 sudo -i reprepro copy stretch-wikimedia $DIST-wikimedia scap
 sudo -i reprepro copy bullseye-wikimedia $DIST-wikimedia scap

If you get errors about a missing GPG key and therefore not exporting indices you need to import the right key like described on Reprepro#Adding_a_new_external_repository.

If signing still fails after you imported the key you need to ensure it looks for them in the right home dir, see Reprepro#If_signing_fails.

If this already happened and you can't get it to export indices by repeating the "include" command you can work around it by copying it back from another distro (reprepro copy stretch-wikimedia buster-wikimedia scap).

Not having exported indices will manifest as "reprepro ls shows the right version but it is not found on a client even after running apt-get update".

Roll out to production

You will then need to use Debdeploy to deploy the new package in production.

  • If you just uploaded the package, use cumin to run apt-get update on the hosts or wait until puppet will do it automatically
  • Generate a debdeploy-spec using generate-debdeploy-spec on cumin:
    • name: scap
    • comment: optional or task ID
    • update type: tool
    • fixed versions in bullseye, buster and stretch: 4.0.0-1 (change as appropriate, use Debian naming schema)
    • skip renaming
  • Start by deploying to mw-canary, mw-jobrunner-canary, parsoid-canary (on cumin using following aliases)
    sudo debdeploy deploy -Q 'A:mw-canary or A:parsoid-canary or A:mw-jobrunner-canary' -u $(date '+%Y-%m-%d-scap.yaml')
    
  • login to mwdebug* servers and check there if a scap pull still works
  • Also deploy to restbase-canary (on cumin using following aliases):
    sudo debdeploy deploy -Q 'A:restbase-canary' -u $(date '+%Y-%m-%d-scap.yaml')
    
  • Check if scap still works for the scap3 code path, and on stretch. You will need to run a test deployment to test environment. Run the following deploy from deploy hosts:
    cd /srv/deployment/restbase/deploy/; scap deploy --environment dev-cluster
    ...
    canary deploy successful. Continue? [y]es/[n]o/[c]ontinue all groups: n
    Rollback all deployed groups? [Y/n]: Y
    
  • Later or the next day you can rollout to all (on cumin).
    sudo debdeploy deploy -s all -u $(date '+%Y-%m-%d-scap.yaml')
    


Resources

There are Debian Versioning guidelines