Граф коммитов

102 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley 27d8f69dee Bug 1169178 - Consolidate peep invocations
There's no need to make multiple calls to peep - we can just combine
them into one. Not changing the puppet instances for Vagrant, since the
calls are made in two separate puppet modules and so would require a bit
of refactoring, which is going to occur in bug 1074151 and friends.
2015-05-28 09:40:20 +01:00
Ed Morley da294ba761 Bug 1056877 - Stop using/referring to the separate treeherder-ui repo
Since it has now been merged into this one.
2015-05-20 16:55:55 +01:00
Ed Morley 57af1d7e2d Merge pull request #537 from MikeLing/bugfix-1160873
Bug 1160873 - Add timeout to requests that are missing them
2015-05-16 01:45:04 +01:00
MikeLing 4dc05d21b5 Bug 1160873 - Add timeout to requests that are missing them 2015-05-16 08:34:56 +08:00
Ed Morley 343d112f93 Bug 1158893 - Delete any existing Cython build output as part of deploy
The Cython build process creates .c and .so files in the log_parser
directory, which only get re-created if the original source changes.
We recently updated the version of Cython, however this doesn't trigger
re-building them. To avoid surprises, we should purge them like we do
for the .pyc files.

In addition, there is no need to delete .pyc files from the UI source
directory, since that does not contain any Python files.
2015-04-27 18:06:55 +01:00
Ed Morley bd60d36364 Bug 1076886 - Deploy: Don't specify the wrong revision to New Relic
We're passing settings.UPDATE_REF, which is the default ref value, not
the actual value that was passed via the Chief web UI. As such, New
Relic was always displaying the revision deployed as "master", even if
it was a non-master branch deploy. Ideally we'd use the value of 'ref'
from pre_update(), but that's not available during the deploy() task
(the script is run in three independent stages & Chief unhelpfully only
passes 'ref' to the first stage), so we'll have to read it back from the
media/revision file - which will require more mangling in bug 1076886.

For now, seeing as the 'revision' property is optional, lets just omit
it, rather than setting it to a sometimes wrong value.
2015-04-23 14:19:04 +01:00
Ed Morley 72ca5826fe Bug 1146184 - Use virtualenv and peep for stage/prod package management
Prior to this change, on stage/production we didn't use virtualenvs
(unlike dev/the local Vagrant project) and instead pip installed
packages globally (when puppet ran periodically), using requirements
files that are not in the repo.

Now during deployment, a virtualenv is created and then populated using
peep (which uses hashes to verify the contents of packages before pip
installing them). The virtualenv is then made relocatable (as best as it
can, the feature isn't perfect), the lib64 symlinks are made relative,
and then the virtualenv is rsynced to all nodes, along with the source.

The one main remaining limitation of --relocatable is that the bash
activate script will not work on the other nodes - however the wrapper
scripts under treeherder-service/bin/ add venv/bin/ to PATH so using the
activate script is unnecessary for them. This just leaves running
manage.py commands locally on a node, for we can use:
|../venv/bin/python manage.py foo|, an alias or else we can fix up the
activate scripts in a follow-up bug.
2015-04-20 23:48:27 +01:00
Ed Morley d40ce31922 Bug 1156457 - Set the New Relic deploy user to "Chief"
So we don't use the default.
2015-04-20 21:13:31 +01:00
Ed Morley 96470f8d19 Bug 1076737 - Correct New Relic deployment URL and attribute name
The current values were copied from another project's deploy script, but
they are not working - so let's use what the latest New Relic docs say
we should use.
2015-04-20 15:08:18 +01:00
Ed Morley 45cee6856e Bug 1076737 - Followup to fix exception whilst notifying New Relic 2015-04-20 14:49:16 +01:00
Mauro Doglio 8039330160 Bug 1076737 - notify newrelic on deployment 2015-04-20 13:39:24 +01:00
Ed Morley e889dd1c95 Bug 1139917 - Deploy script: Don't restart apache in rsync_code()
The restart-jobs script now also gracefuls apache (after draining the
nodes to avoid errors), so we don't want to do so in update.py any more.
2015-03-05 15:15:23 +00:00
Ed Morley b4a2fb6ea8 Bug 1138392 - Deploy script: don't pass 'ctx' to @hostgroups functions
...same as @task. Oops.
2015-03-02 17:57:18 +00:00
Ed Morley cc60b10517 Bug 1138392 - Deploy script: @task functions shouldn't be passed 'ctx'
...since the decorator does that for us.
2015-03-02 17:54:02 +00:00
Ed Morley c0e59f9bea Bug 1059814 - Deploy script: Fix commander_settings import
Apparently the current directory is only sometimes on the path & I
mis-read or understood the docs, sigh. Let's just keep the sys.path
manipulation and use #noqa to keep flake8 quiet.
2015-03-02 17:44:46 +00:00
Ed Morley 87f7a32e00 Bug 1138392 - Deploy script: Make IRC output more accurate
Anything in the deploy script decorated with @task or @hostgroups ends
up having it's progress displayed in IRC by the bot - eg:
[2015-02-23 20:09:40] Finished deploy_log (0.454s)

However, the "deploy_X" @hostgroup functions were actually only
rsyncing the code (which is fast compared to restarting the processes),
but the name used to imply the whole deploy for that node type was
complete.

The new structure not only reduces code duplication, but makes the IRC
output more accurate, to provide a better idea as to what stage the
deploy is at, and which are the problematic steps in the case of errors.
2015-03-02 15:47:41 +00:00
Ed Morley 532429a9c4 Bug 1088705 - Deploy script: Make the git output less chatty
The git reset already outputs the SHA/commit message for HEAD so
most of this additional output is unnecessary.
2015-03-02 15:47:40 +00:00
Ed Morley 0e67ca47a4 Bug 1088705 - Deploy script: Generate revision file before rsyncing it
Previously the revision file was regenerated after it had already been
rsynced to the webheads, and as such the publicly accessible file
displayed the previous revision, not the new revision.
2015-03-02 15:47:40 +00:00
Ed Morley d011d2f9bd Bug 1135798 - Deploy script: Remove unnecessary submodule git commands
We don't use git submodules, so let's not bother trying to update them.
2015-03-02 15:47:39 +00:00
Ed Morley c3afe9584d Bug 1135798 - Deploy script: Fix the git fetch/reset commands
The current fetch/reset/checkout doesn't correctly update the working
directory when switching between branches. This new approach is
recommended by:
http://stackoverflow.com/a/9589927
2015-03-02 15:47:39 +00:00
Ed Morley ebd237d5a0 Bug 1059814 - Deploy script: Remove unnecessary sys.path additions
The directory of the currently running script is already on the path:
https://docs.python.org/2/tutorial/modules.html#the-module-search-path
...so adding it is unnecessary.

In addition, I don't believe we need the treeherder-service directory on
the path, since we don't directly import anything from there.
2015-03-02 15:47:38 +00:00
Cameron Dawson eabe3a47de Bug 1119479 - Fix update script and puppet manifest 2015-02-10 11:34:56 -08:00
Ed Morley 7fa4e973b2 Bug 1130408 - deploy: Only call restart-jobs once per hostgroup
The @hostgroups decorator was causing us to call restart-jobs multiple
times (once for each host within a host group), when we only want to
call it once per group of hosts.

Abstracting the restart-jobs call to its own method also means the IRC
bot will output "restart_jobs complete" after each restart-jobs call,
making the progress through the deployment task clearer.
2015-02-09 13:29:35 +00:00
mdoglio 864148d099 Bug 1079270 - Restart workers individually 2015-02-03 14:04:49 +00:00
mdoglio d88791068f Bug 1079270 - Use new restart command on deploy 2015-01-27 16:59:43 +00:00
camd c21f697685 Merge pull request #304 from mozilla/fetch-with-chief-deploy
Bug 1113160 - add git fetch to get new branches for deploying
2015-01-06 09:14:26 -08:00
Ed Morley a2e1cbc79d Bug 1117096 - Update commander_settings.py-example to reflect production 2015-01-05 16:00:25 +00:00
Cameron Dawson 44e4c2025d Bug 1113160 - add git fetch to get new branches for deploying 2015-01-02 16:51:58 -08:00
mdoglio 0352043443 fixup! Bug 1112290 - Fix UI revision path on deployment 2014-12-16 23:10:31 +00:00
Mauro Doglio aacc1ed941 Bug 1112290 - Fix UI revision path on deployment 2014-12-16 23:05:40 +00:00
mdoglio de5845e864 Bug 1112290 - Rename celery services 2014-12-16 22:37:09 +00:00
Mauro Doglio 86f514c826 Bug 1112290 - Rename the various services in update.py 2014-12-16 21:17:56 +00:00
Jonathan French dbb4d11e09 Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-03 13:06:03 -05:00
Ed Morley 73f64550ef Bug 1087313 - Update example commander settings to reflect production
...and rename to make it clearer that this file is just an example.
2014-10-27 10:13:31 +00:00
mdoglio 703bf33297 Bug 1074199 - add clear_cache command to the update script 2014-09-29 16:35:36 +02:00
Ed Morley f7fed3e46e Bug 1070471 - Update example commander settings to mirror production 2014-09-23 14:12:47 +01:00
Ed Morley 41384c5b6b Bug 1069283 - Call manage.py init_datasources during Chief deployment 2014-09-23 11:29:26 +01:00
Ed Morley 2b8b12db78 Bug 1069290 - Remove redundant manage.py params from the deploy script
manage.py sets the DJANGO_SETTINGS_MODULE env variable, so it's
unnecessary to pass |--settings ...| when we call it from the Chief
deploy script.
2014-09-20 10:24:44 +01:00
Ed Morley 0830f3dbf9 Bug 1065754 - On deployment update prod DB using in-repo fixtures 2014-09-12 12:27:24 -07:00
Ed Morley f5793c48ef Bug 1066264 - Refactor update.py: Remove unnecessary wrapping 2014-09-11 14:42:40 -07:00
Ed Morley 7f011e09ae Bug 1066264 - Refactor update.py: Move contents of deploy() inline 2014-09-11 14:27:04 -07:00
Ed Morley c207c0594e Bug 1066264 - Refactor update.py: Clean up comments 2014-09-11 14:17:43 -07:00
Ed Morley d5f31ced1d Bug 1066264 - Refactor update.py: Move contents of update() inline 2014-09-11 14:17:43 -07:00
Ed Morley cfef06799b Bug 1066264 - Refactor update.py: Move contents of pre_update() inline 2014-09-11 14:17:42 -07:00
Ed Morley 7775a57b99 Bug 1064646 - Collect static assets and rebuild pyx files before deploy
Previously changes were made to the srcdir after the IT deploy script
had already run, so were not rsynced until the next deploy push.
2014-09-11 11:57:56 -07:00
Ed Morley 423446402c Bug 1064646 - Comment and PEP8 cleanup 2014-09-11 11:57:56 -07:00
mdoglio 38f8d5eb8d fixup! Add a chdir before celery worker restartin the update script 2014-07-09 12:36:54 +01:00
mdoglio 6225c1f5c9 fixup! Add a chdir before celery worker restartin the update script 2014-07-09 12:33:10 +01:00
mdoglio 042535a47d Add a chdir before celery worker restartin the update script
Also fix the commands order in the whole script
2014-07-09 12:25:07 +01:00
mdoglio 6c3939fce0 add celery warm shutdown command to update.py 2014-07-08 15:49:40 +01:00