Closed Bug 836289 Opened 13 years ago Closed 13 years ago

puppetize release runner deployment

Categories

(Release Engineering :: Release Automation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: rail)

References

Details

Attachments

(6 files, 2 obsolete files)

bug 810393 did deployment of release runner by hand, because the master it's running on doesn't have a properly functioning puppet (bug 777742). Once that's fixed we need to puppetize release runner.
Depends on: 803823
No longer depends on: 777742
P3 for now, not working on it actively, blocked by another bug.
Priority: -- → P3
back to the pool
Assignee: rail → nobody
Priority: P3 → --
Rail, is your manual deployment documented somewhere? If not, can you provide details here?
Flags: needinfo?(rail)
That's Bug 810393. * /etc/supervisor.conf can be grabbed from bm36 * no need to checkout from git anymore
Flags: needinfo?(rail)
Attached patch puppetize release-runner (obsolete) — — Splinter Review
* not tested at all
Assignee: nobody → rail
Attachment #764192 - Flags: feedback?(dustin)
Comment on attachment 764192 [details] [diff] [review] puppetize release-runner Review of attachment 764192 [details] [diff] [review]: ----------------------------------------------------------------- It doesn't look like you actually declare the releaserunner class anywhere. I assume this will be a new toplevel class that just gets included in the node def along with the buildmaster toplevel? ::: manifests/extlookup/secrets-template.csv @@ +51,5 @@ > win_tests_password,"" > +releaserunner_api_username,"" > +releaserunner_api_password,"" > +releaserunner_ssh_username,"" > +releaserunner_ssh_password,"" password? itym private key? ::: modules/mercurial/manifests/repos.pp @@ +1,4 @@ > +# This Source Code Form is subject to the terms of the Mozilla Public > +# License, v. 2.0. If a copy of the MPL was not distributed with this > +# file, You can obtain one at http://mozilla.org/MPL/2.0/. > +define mercurial::repos($hg_repo, $dst_dir, $branch="default", $user='') { The name should probably be singular (mercurial::repo) @@ +2,5 @@ > +# License, v. 2.0. If a copy of the MPL was not distributed with this > +# file, You can obtain one at http://mozilla.org/MPL/2.0/. > +define mercurial::repos($hg_repo, $dst_dir, $branch="default", $user='') { > + include packages::mozilla::py27_mercurial > + include users::builder It'd be better to put this inside a conditional, so that we can use mercurial::repos on a host without a builder user (e.g. an imaging server). ::: modules/releaserunner/manifests/services.pp @@ +16,5 @@ > +logfile_maxbytes=50MB > +logfile_backups=10 > +; once we upgrade tto 3.0b2: stopasgroup=true > +; once we upgrade tto 3.0b2: killasgroup=true > +" This string might do better as a template - $extra_config = template("${module_name}/extra_config.erb")
Attachment #764192 - Flags: feedback?(dustin) → feedback+
(In reply to Dustin J. Mitchell [:dustin] from comment #6) > It doesn't look like you actually declare the releaserunner class anywhere. > > I assume this will be a new toplevel class that just gets included in the > node def along with the buildmaster toplevel? Yes. One of the masters should just work. > > +releaserunner_ssh_password,"" > > password? itym private key? Yup. A silly calque... > The name should probably be singular (mercurial::repo) +1 > It'd be better to put this inside a conditional, so that we can use > mercurial::repos on a host without a builder user (e.g. an imaging server). Agree. > This string might do better as a template - > $extra_config = template("${module_name}/extra_config.erb") Good idea. I'll update the patch after I test it (probably next week after releases). Thanks!
Attached patch tools — — Splinter Review
pass virtualenv directory and logfile to release-runner.sh and fallback to bm36 values by default.
Attachment #768449 - Flags: review?(bhearsum)
Attached patch puppetize release-runner (obsolete) — — Splinter Review
* address comments * full list of pip packages * add gcc/make/mysql-devel so fabric/buildbot are installed properly * it works! :)
Attachment #764192 - Attachment is obsolete: true
Attachment #768459 - Flags: review?(dustin)
Attachment #768449 - Flags: review?(bhearsum) → review+
Comment on attachment 768449 [details] [diff] [review] tools https://hg.mozilla.org/build/tools/rev/db090f1d4c67 deployed on bm36 (and properly restarted)
Attachment #768449 - Flags: checked-in+
Comment on attachment 768459 [details] [diff] [review] puppetize release-runner Review of attachment 768459 [details] [diff] [review]: ----------------------------------------------------------------- Just a few minor changes to the config, and this will be good to go. ::: modules/config/manifests/base.pp @@ +46,5 @@ > + $releaserunner_notify_from = "Release Eng <release@mozilla.com>" > + $releaserunner_notify_to = "Release Eng <release@mozilla.com>" > + $releaserunner_smtp_server = "localhost" > + $releaserunner_hg_username = "ffxbld" > + $releaserunner_hg_ssh_key = "/home/cltbld/.ssh/ffxbld_dsa" It doesn't make a lot of sense to use config to point to a local file which isn't managed by puppet. Can you make this (and the $releaserunner_ssh_key below) settings for now, with plans to actually manage those keys directly at a later time? @@ +56,5 @@ > + $releaserunner_tools_branch = "default" > + $releaserunner_production_masters = "http://hg.mozilla.org/build/tools/raw-file/default/buildfarm/maintenance/production-masters.json" > + $releaserunner_sendchange_master = "buildbot-master36.srv.releng.scl3.mozilla.com:9301" > + $releaserunner_ssh_username = "cltbld" > + $releaserunner_ssh_key = "/home/cltbld/.ssh/release-runner" Many of the defaults here are moco-specific (basically, everything but the repos/branches). Can you move those values to moco-config.pp? ::: modules/mercurial/manifests/repo.pp @@ +5,5 @@ > + include packages::mozilla::py27_mercurial > + > + if $user == '' { > + include users::builder > + $hg_user = $users::builder::username This reference would technically need an `include users::builder`, but then you couldn't use a mercurial repo without the builder, which would be problematic on e.g., signing servers. Better to just always pass this argument, I think. ::: modules/releaserunner/manifests/init.pp @@ +36,5 @@ > + ]; > + } > + > + file { > + "${users::builder::home}/.release-runner.ini": This is kind of yucky. I don't like daemons running out of /home, or production configuration hidden in dotfiles. Not blocking this particular bug, but it'd sure be nice to clean that up sometime. ::: modules/releaserunner/manifests/settings.pp @@ +5,5 @@ > +class releaserunner::settings { > + include ::config > + include users::builder > + > + $root = "${users::builder::home}/release-runner" Would moving this tool to /builds/releaserunner be as easy as changing this path?
Attachment #768459 - Flags: review?(dustin) → review-
Attached patch tools #2 — — Splinter Review
don't hard code the config file location
Attachment #770131 - Flags: review?(bhearsum)
* moved the root directory to /builds/releaserunner * moved most of releaserunner config variables to moco-config.pp * mercurial::repo requires $user now * enabled stopasgroup/killasgroup interdiff: https://gist.github.com/rail/5908786
Attachment #768459 - Attachment is obsolete: true
Attachment #770132 - Flags: review?(dustin)
Attachment #770131 - Flags: review?(bhearsum) → review+
Comment on attachment 770132 [details] [diff] [review] puppetize release-runner Awesome! r+ with two quick changes: The config parameters still need to appear in modules/config/manifests/base.pp, just with empty values rather than moco-specific values. It doesn't look like you've made the change to pass CONFIG to release-runner.sh, which from the previous attachment appears to be necessary.
Attachment #770132 - Flags: review?(dustin) → review+
Attachment #770131 - Flags: checked-in+
* Added 2 values to secrets.csv (the API credentials) * Disabled release-runner on bm36: * stopped supervisor * commented out release runner section in supervisor.conf * mv ~cltbld/release-runner ~cltbld/release-runner-disabled * Copied .ssh directory (keys) from bm36 to bm81 It's up and running! TODO: * add nagios checks for release-runner.py process * monitor the next release
I had to remove mercurial-1.4-3.el6.x86_64 to make release-runner work. Probably it would be better to explicitly pass path to hg (via config)
It should probably always use the mozilla hg..
There is no easy way to specify path to hg to be used by hg modules. Installing mercurial into virtualenv will resolve the issue.
Attachment #770298 - Flags: review?(dustin)
oh, sorry, I thought you meant for mercurial::repo
Attachment #770298 - Flags: review?(dustin) → review+
Callek suggested to avoid installing mercurial in virtualenv to avoid pains when we upgrade the mercurial version next time. We can alter PATH either in supervisor config (environment=PATH=/tools...:/bin:/usr/bin) or in release-runner.sh
Depends on: 889992
Ben, do you have any strong opinion regarding using hg installed into a virtualenv vs the one we use for everything else (/tools/python/bin/python)? Currently we use http://hg.mozilla.org/build/puppet/file/7f8a1adc0e8c/modules/releaserunner/manifests/init.pp#l37
Flags: needinfo?(bhearsum)
(In reply to Rail Aliiev [:rail] from comment #26) > Ben, do you have any strong opinion regarding using hg installed into a > virtualenv vs the one we use for everything else (/tools/python/bin/python)? > Currently we use > http://hg.mozilla.org/build/puppet/file/7f8a1adc0e8c/modules/releaserunner/ > manifests/init.pp#l37 Seems a little silly to install a different hg for this, but I don't have strong feelings either way.
Flags: needinfo?(bhearsum)
Attached patch use mozilla hg — — Splinter Review
Attachment #771384 - Flags: review?(bhearsum)
Attachment #771385 - Flags: review?(bugspam.Callek)
Comment on attachment 771385 [details] [diff] [review] no mercurial in venv Review of attachment 771385 [details] [diff] [review]: ----------------------------------------------------------------- ahh wonderful
Attachment #771385 - Flags: review?(bugspam.Callek) → review+
Comment on attachment 771384 [details] [diff] [review] use mozilla hg Review of attachment 771384 [details] [diff] [review]: ----------------------------------------------------------------- why is the supervisor file getting removed? because it moved to puppet?
Attachment #771384 - Flags: review?(bhearsum) → review+
(In reply to Ben Hearsum [:bhearsum] from comment #31) > Comment on attachment 771384 [details] [diff] [review] > use mozilla hg > > Review of attachment 771384 [details] [diff] [review]: > ----------------------------------------------------------------- > > why is the supervisor file getting removed? because it moved to puppet? Yeah, that file isn't used anywhere, we added that just as an example.
Attachment #771384 - Flags: checked-in+
[cltbld@buildbot-master81.srv.releng.scl3.mozilla.com releaserunner]$ source /builds/releaserunner/bin/activate (releaserunner)[cltbld@buildbot-master81.srv.releng.scl3.mozilla.com releaserunner]$ pip uninstall mercurial Uninstalling mercurial: /builds/releaserunner/bin/hg /builds/releaserunner/lib/python2.7/site-packages/hgext /builds/releaserunner/lib/python2.7/site-packages/mercurial /builds/releaserunner/lib/python2.7/site-packages/mercurial-2.5.4-py2.7.egg-info Proceed (y/n)? y Successfully uninstalled mercurial
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: