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

102 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley 321fafa5a2 Bug 1230104 - Vagrant: Update virtualenv from v12.1.1 to v13.1.2
Now that peep is compatible with pip v7.x, we can update to the latest
virtualenv that includes pip v7.1.2.

https://virtualenv.readthedocs.org/en/latest/changes.html
https://github.com/pypa/virtualenv/compare/12.1.1...13.1.2
2015-12-03 11:05:38 +00:00
Ed Morley cd353f5e3c Bug 1160561 - Add support for setting BROKER_URL via the environment
The individual RABBITMQ_* variables are never used on their own, so it
makes more sense to switch to a URL variable that combines all of them.

Travis/Vagrant have also had BROKER URL explicitly set, since we're
generally moving away from having testing defaults set in settings.py.

Once stage/prod have BROKER_URL set, we can remove the fallback to the
old variable names, and also remove defaults entirely, making missing
settings fail fast.
2015-11-25 21:48:15 +00:00
Ed Morley 5fc4a1a8b9 Bug 1160561 - Remove unnecessary DEBUG define in local settings file
Now that we're using django-environ's env.bool() in settings.py, the
value of TREEHERDER_DEBUG set in the Vagrant environment is correctly
picked up, so the local settings file DEBUG define is unnecessary.
2015-11-25 21:48:13 +00:00
Cameron Dawson 86b40997e6 Bug 1221516 - Adds command to get vagrant databases and env back to a clean state
This will empty all the per-repo databases, empty all the refdata and
then clear all the rabbitmq queues.
2015-11-04 13:44:48 +00:00
Mauro Doglio 078f5902d8 Bug 1193836 - use `--noinput` on migrate
This is a followup of 829cf22bc4
2015-10-27 12:05:03 +00:00
Mauro Doglio 829cf22bc4 Bug 1193836 - Update vm provisioning
This patch replaces the use of init_master_db with django `migrate`
and `load_initial_data` commands.
2015-10-27 11:19:17 +00:00
Ed Morley 3ddf626c9c Bug 1217374 - Output hawkrest WARNINGs to help debug hawk auth problems
This means rather than just returning this to the client:
'{"detail":"Hawk authentication failed"}'

We'll output more information to the stage/prod/Vagrant console and thus
logs. eg:

WARNING [hawkrest:81] access denied: MacMismatch: MACs do not match;
ours: 8HqvrjA7MO0CmJ3c6Ij2VfEuZxkchEL+pOL6Cw7At2c=; theirs:
CyDv9vnmqP6yGqT+LknMA+FOwJvSLATJwvVgG0OTl8A=

Thanks to the log.warn() here:
https://github.com/kumar303/hawkrest/blob/0.0.8/hawkrest/__init__.py#L80

I've removed the log level set on the console handler, since I think
it's clearer to set them on the loggers themselves, but it's not
entirely clear what Django logging best practices are, since the Django
docs are not very specific.
2015-10-22 15:21:03 +01:00
Ed Morley 8ae9071901 Bug 1197186 - Move settings to treeherder/config/
Since they're not specific to the Django app 'webapp'.

Whilst we're there, the local & example settings files have been
renamed. In the future I'd like to combine settings_local.example.py
with puppet/files/treeherder/local.vagrant.py, but I'll do that in
another bug.
2015-10-08 19:59:46 +01:00
Ed Morley d9bd20efd1 Bug 1212822 - Only load local.py in the Vagrant environment
Ideally we'd remove local.py entirely, in favour of environment
variables. However at least for now, it's still needed for setting the
logging preferences/enabling debugging apps for the Vagrant environment.
As such, it's being kept but disabled everywhere other than for local
development.

The stage/prod local.py files have been vetted, and (a) the contents
confirmed to match that in the environment, and (b) all affected
settings in base.py checked to ensure they read the correct environment
variable. Heroku doesn't have a local.py. As such, this should be a
no-op other than locally, where a Vagrant provision will be required.
2015-10-08 13:42:58 +01:00
Mauro Doglio be64542d11 Bug 1209555 - switch etl requests to hawk
I added a create_credentials command to help setting up the initial
development environment. The puppet setup now creates a new user and set
it as the owner of the treeherder-etl credentials.
2015-10-08 13:11:54 +01:00
Cameron Dawson b0b5460441 Bug 1207403 - don't replace existing local.py on vagrant 2015-09-24 09:11:53 -07:00
Mauro Doglio 04836704f0 Bug 1204918 - upgrade to mysql 5.6 for local development 2015-09-15 16:17:48 +01:00
Ed Morley ad3dc73715 Bug 1199179 - Remove default Django SECRET_KEY
Previously if TREEHERDER_DJANGO_SECRET_KEY was not set, we'd silently
fall back to a default value for SECRET_KEY, meaning we wouldn't realise
we were using an insecure key on a live deployment instance.

With this change, TREEHERDER_DJANGO_SECRET_KEY being missing from the
environment is fatal, resulting in:
"ImproperlyConfigured: The SECRET_KEY setting must not be empty."
2015-08-28 10:03:15 +01:00
William Lachance cc78bb50ea Bug 1198502 - Add bash aliases for restarting rabbitmq and memcached 2015-08-25 18:17:56 -04:00
Ed Morley 90ba77e596 Bug 1192801 - Remove per-file MPL boilerplate since it's unnecessary
The MPL 2.0 terms state that as long as a LICENSE file is present, the
per-file header text is not required. See "Exhibit A" at the end of:
https://www.mozilla.org/MPL/2.0/
2015-08-18 23:32:11 +01:00
Ed Morley f9ee81d999 Bug 1169944 - Always install the New Relic package, not just on prod
For bug 1124278, we're going to want to sprinkle new relic annotations
around the codebase, so by always installing it, we save having to stub
these out in development/on Travis. It also seems wise to have prod
running as close to the same packages as in development.

Since NEW_RELIC_LICENSE_KEY isn't set locally, plus
NEW_RELIC_DEVELOPER_MODE is set to true, the New Relic agent doesn't
submit anything. See:
https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#developer_mode
2015-08-11 23:23:26 +01:00
Ed Morley f92065534a Bug 1175432 - Make it more obvious if DATABASE_URL is not set
Removes the default value for DATABASE_URL and DATABASE_URL_RO, so that
if either are not set, there is a clearer upfront Django error about
Databases not being configured, rather than timeouts trying to connect
to localhost.

This makes it more obvious when setting up a new instance that the
variables are not present in the environment (and would have avoided
some confusion on Heroku today, when DATABASE_URL was set, but
DATABASE_URL_RO was not) - in exchange for now needing two extra lines
in the puppet config for local testing.
2015-07-15 16:20:39 +01:00
Ed Morley 58813b0c51 Bug 1169916 - Stop using Cython to build the log parser
Since it only speeds up parsing by a few percent of total runtime, and
is therefore not worth the added complexity for deployment and local
hack-test-debug cycles when working on the log parser.

The .gitignore and update.py entries will be removed in a later commit,
once the stage/prod src directories have been cleaned up.
2015-06-30 14:51:57 +01:00
Cameron Dawson 0bba64b620 Cleanup syntax in .bash_aliases 2015-06-30 12:37:31 +01:00
Ed Morley bf4c7c05ff Bug 1151803 - Serve the UI using gunicorn/WhiteNoise instead of Apache
In order that we can serve the UI on Heroku, we wrap the Django wsgi app
with WhiteNoise, so both the UI and API requests are served by gunicorn.

In the Vagrant environment, Apache has been removed and Varnish instead
now proxies all requests to gunicorn/Django runserver directly, without
Apache as a go-between.

The UI on production will not be affected by this commit, since the
Apache config there will still intercept requests for the UI assets
rather than proxying them to gunicorn.

It's worth noting too, that we're not able to make use of WhiteNoise's
automatic Django GZip/caching support since that assumes we are using
Django templates and referring to resources using {% static "foo.css" %}

However, we can sub-class WhiteNoise (or more specifically the
DjangoWhiteNoise class) and override the is_immutable_file() method to
add caching support at a later date:
http://whitenoise.evans.io/en/latest/base.html#caching-headers

Documentation for WhiteNoise can be found at:
http://whitenoise.evans.io/
2015-06-19 15:56:23 +01:00
Ed Morley 4c827ab288 Bug 1151803 - Vagrant: Stop using Varnish to gzip json/text
Since we should be doing this using Django's GZip middleware, not in
Varnish, which is only used in development. At least with this removed,
we won't check a local instance and believe we have everything set up
correctly if its not.
2015-06-19 13:20:33 +01:00
Ed Morley fca98929db Bug 1151803 - Vagrant: Remove socketio remnant from Varnish config
Leftover from bug 1076710.
2015-06-19 13:20:32 +01:00
Cameron Dawson 9acd164b8a Merge branch 'vagrant-thresetall-alias-improvements' 2015-06-17 15:30:58 -07:00
William Lachance 5fea0d4b13 Bug 1167349 - Turn swagger back on in production and update to latest 2015-06-17 14:13:14 -04:00
Cameron Dawson 5afcf40f13 Bug 1175334 - improve thresetall alias in vagrant
delete ``celerybeat-schedule``, restart rabbitmq, and echo what it’s
doing as it goes.
2015-06-16 16:23:03 -07:00
Cameron Dawson 111c09ad05 Merge branch 'fix-thresetall' 2015-06-10 12:42:31 -07:00
Cameron Dawson f238a9cf31 Bug 1173192 - Fix and enhance the .bash_aliases file 2015-06-10 12:42:13 -07:00
Ed Morley 80537079c8 Bug 1172036 - Vagrant: Run export_project_credentials during provision
This means there is one less manual step that has to be performed during
initial setup.
2015-06-10 00:02:55 +01:00
Cameron Dawson 37d8a6b4c6 Bug 1171757 - create a vagrant .bash_aliases with helpful functions 2015-06-09 10:52:20 -07:00
Ed Morley e20a80ddcb Bug 1170805 - Vagrant: Reduce repetition in apache config 2015-06-03 11:56:52 +01:00
Ed Morley 6583580291 Bug 1170805 - Vagrant: Remove redirect for old style /ui/ URLs 2015-06-03 11:56:51 +01:00
Ed Morley 81c5c67a2a Bug 1170167 - Vagrant: cd into the treeherder directory on login
Also switches the activate-venv-on-login .bashrc entry to use an
absolute path, in case it gets added to .bashrc after the 'cd' line.
2015-06-02 13:44:55 +01:00
Ed Morley 6d813129a4 Bug 1170167 - Vagrant: Use a $HOME_DIR variable to reduce repetition 2015-06-02 13:44:54 +01:00
Ed Morley 9472ffabf7 Bug 1144804 - Vagrant: Remove workaround for older versions of puppet
This removes the puppet workaround added by bug 1144805, since the
Ubuntu 14.04 vagrant image comes with puppet 3.4.3, and so includes the
fix for:
https://projects.puppetlabs.com/issues/10907
2015-06-01 11:37:04 +01:00
Ed Morley feb283bbdd Bug 1144804 - Vagrant: Stop installing make
Since it's available by default in Ubuntu 14.04.
2015-06-01 11:37:03 +01:00
Ed Morley 820e65be9d Bug 1144804 - Vagrant: Stop installing curl
Since it's available by default in Ubuntu 14.04.
2015-06-01 11:37:02 +01:00
Ed Morley a13b143c7b Bug 1144804 - Vagrant: Stop installing python-software-properties
Since we can use add-apt-repository in Ubuntu 14.04 without installing
additional packages.
2015-06-01 11:37:01 +01:00
Ed Morley b137b9148b Bug 1144804 - Vagrant: Update base image from Ubuntu 12.04 to 14.04
This uses the newer image from:
https://vagrantcloud.com/ubuntu/boxes/trusty32

This also updates us from apache 2.2 to apache 2.4, which means the
apache config must be changed to be compatible with apache 2.4:
http://httpd.apache.org/docs/2.4/upgrading.html
(The syntax for "Allow from all" has changed, plus the default config
now specifies a "Require all denied" which we have to override for the
UI directory)
2015-06-01 11:37:01 +01:00
Ed Morley 6f76ff1780 Bug 1144804 - Vagrant: Fix race conditions with apache setup
A few puppet steps were either depending on the wrong package (ie
apache2-dev instead of apache2) or else did not have a 'requires'
property set at all. This was causing errors during provision due to
races - particularly after updating to Ubuntu 14.04.
2015-06-01 11:37:00 +01:00
Ed Morley 82de9c16fd Bug 1160561 - Consolidate rabbitmq prefs
Sets the default values (and now also those used by Vagrant) to the same
as those used by Travis, so we can avoid specifying different values all
over the place.
2015-05-28 16:09:48 +01:00
Ed Morley b10646e74e Bug 1160561 - Consolidate memcached prefs 2015-05-28 16:09:47 +01:00
Ed Morley dec412e12d Bug 1160561 - Consolidate DB prefs
Sets the default values to something sensible, to reduce the number of
prefs we have to set in the environment everywhere.
2015-05-28 16:09:46 +01:00
Ed Morley a92ab9a96b Bug 1074151 - Vagrant: Remove unused production.pp
The only remaining difference between production.pp and vagrant.pp is
that the former uses a different local settings file
(local.production.py), which also outputs to the syslog. However we
don't need this for the local development environment, and nothing in
production is using the in-repo puppet, so it is no longer required.
2015-05-28 14:06:09 +01:00
Ed Morley 705140707e Bug 1074151 - Vagrant: Add a Vagrantfile pref for serving ui/ vs dist/
One of the few differences between vagrant.pp and production.pp is from
which directory the UI is served. This change adds the ability to toggle
the directory from the Vagantfile directly, thereby bringing
production.pp (and the duplication it brings) closer to being obsolete.
2015-05-28 14:06:09 +01:00
Ed Morley 2efb703f16 Bug 1056877 - Update UI path references after directory moves
As part of merging the UI repo into this one, the following directory
moves were performed:
  webapp/app/                   ->  ui/
  webapp/test/                  ->  tests/ui/
  webapp/config/                ->  tests/ui/config/
  webapp/scripts/               ->  tests/ui/scripts/
  webapp/scripts/web-server.js  ->  web-server.js
2015-05-20 16:55:55 +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
Jonathan French 19b71bc4b4 Bug 1164881 - Add MPL2.0 headers to recent treeherder repo files 2015-05-14 11:45:26 -04:00
Ed Morley ab530d6ff0 Bug 1159250 - Vagrant: Update virtualenv to v12.1.1
Main change is update of bundled pip from 6.0.8 to 6.1.1.

https://virtualenv.pypa.io/en/latest/changes.html
https://github.com/pypa/virtualenv/compare/12.0.7...12.1.1
2015-04-28 23:46:05 +01:00
Ed Morley 7980f313bd Bug 1158177 - Vagrant: Update from Python 2.7.3 to 2.7.9
Vagrant is using an Ubuntu 12.04 base image, for which the latest Python
available officially is 2.7.3, so we have to use a third party PPA:
https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes-python2.7
https://launchpad.net/+help-soyuz/ppa-sources-list.html

The easiest way to add this PPA is using |add-apt-repository|, but
Ubuntu 12.04 doesn't ship with it by default, so we also have to install
the python-software-properties package, sigh:
http://ubuntuforums.org/showthread.php?t=1320536
2015-04-27 14:13:14 +01:00
Ed Morley 878262b358 Bug 1155160 - Remove the vendor directory from the Python path
All packages in the vendor directory are now installed in the virtualenv
site-packages, so there's no need to add the in-repo vendor directory to
the Python path.
2015-04-22 11:23:26 +01:00