Bouncerscript README
In order to rollout a new version of bouncerscript for testing, one must roll-out a new version, deploy it within puppet internal pypi mirrors and pin the bouncerworkers to one's environment.
- Once your PR is ready for testing, make sure to create a new version like
<next-version>.dev0+pr<pr number>
underversion.txt
. - Create wheel with
python3 setup.py bdist_wheel
and scp that file under puppet - Login in puppet and change directory in your environment (e.g.
/etc/puppet/environments/$whoami
) - Make sure to have the puppet repo up-to-date there
- Tweak the
bouncerscript
version in the module's requirements.txt to reflect the new value, and also to force all the dev bouncerworkers to be chained to your environment. Something like this:
diff --git a/manifests/moco-nodes.pp b/manifests/moco-nodes.pp
index a8357fb..1982cec 100644
--- a/manifests/moco-nodes.pp
+++ b/manifests/moco-nodes.pp
@@ -977,7 +977,7 @@ node /^bouncerworker-dev.*\.srv\.releng\..*\.mozilla\.com$/ {
$only_user_ssh = true
+ $pin_puppet_server = 'releng-puppet2.srv.releng.mdc1.mozilla.com'
+ $pin_puppet_env = 'mtabara'
include toplevel::server::bouncerscriptworker
}
diff --git a/modules/bouncer_scriptworker/files/requirements.txt b/modules/bouncer_scriptworker/files/requirements.txt
--- a/modules/bouncer_scriptworker/files/requirements.txt
+++ b/modules/bouncer_scriptworker/files/requirements.txt
@@ -5,7 +5,7 @@ aiohttp==3.2.1
PyYAML==3.12
aiohttp==3.3.2
arrow==0.12.1
async_timeout==3.0.0
-bouncerscript==2.0.0 # puppet: nodownload
+bouncerscript==X.X.X # dev version to be tested
attrs==18.1.0
certifi==2018.4.16
...
- Login to all machines to chain them to your environment and also deploy the newer testing version
# vpn
for i in {1..10}; do
nslookup bouncerworker-dev$i | grep Name: | sed -e 's/Name:\t//'
done > /src/ops/hosts/bouncer-dev
csshX --hosts /src/ops/hosts/bouncer-dev
sudo puppet agent --test --server=releng-puppet2.srv.releng.mdc1.mozilla.com --environment=mtabara # or unpin or w/e
- Once your PR is reviewed and passes the tests, have one of the admins review & merge it
- Bump to new version in
version.txt
. - Amend the
CHANGELOG.md
to reflect the new changes - Commit with a "%VERSION%" message
git tag -s %VERSION%
git push
git push --tags
- Create wheel with
python3 setup.py bdist_wheel
and scp that file under puppet - Wait for that file to be synchronized across all puppet instances (emails arrive to confirm that)
- Tweak the
bouncerscript
version in the module's requirements.txt to reflect the new value - Create a PR for your change and get review
- Merge it when approved and tests pass
- There are currently a single prod and a single dev bouncerworkers. You can wait for the cron job to run puppet to deploy new changes every 30 mins or so. Alternatively, can wait for the puppet masters to sync the change (~5 minutes, see mail again), and force the puppet run by logging-in to each of the machines:
# vpn
for i in {1..10}; do
nslookup bouncerworker-$i | grep Name: | sed -e 's/Name:\t//'
done > /src/ops/hosts/bouncer-prod
csshX --hosts /src/ops/hosts/bouncer-prod
sudo puppet agent --test