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

134 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley 884fffefea Bug 1357595 - Update libmysqlclient from 5.7.14 to 5.7.18
Also switches to the official URLs (that 302 redirect) rather than
direct-linking, since the official URLs are now HTTPS. Avoids potential
breakage in the future as the CDN internal URLs change.

Changelog (most of the changes only affect mysql-server):
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-15.html
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-16.html
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-17.html
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-18.html
2017-04-19 00:47:55 +01:00
Ed Morley 42f240dbf8 Bug 1349405 - Delete .heroku/yarn/ during post_compile
Since it avoids including 4500 unused files (28MB) in the slug, now that
we're using the yarn support added to newer versions of the nodejs
buildpack.
2017-03-28 13:55:50 +01:00
Ed Morley 51c386ee21 Bug 1343928 - Switch from npm to yarn
Since it's faster, deterministic and doesn't given obscure errors when
using `--no-bin-links` (which is required for both npm and yarn on
Windows hosts), and as such unblocks the work in bug 1343624.

Many of the commands are the same as with npm. See:
https://yarnpkg.com/en/docs/usage
2017-03-13 15:27:46 +00:00
Ed Morley 21abe6ed75 Bug 1343624 - Add `npm run build` as an alias of `grunt build`
Routing commands via npm/yarn is preferred, since it avoids
having to do global installs of grunt-cli, which simplifies contributor
setup, and means less effort when we switch to Yarn (since it requires
manual PATH setup for globally installed packages).
2017-03-13 15:27:46 +00:00
Ed Morley 6502ec24b1 Bug 1340123 - Stop using --max-requests with gunicorn
Since hopefully now we're no longer using datasource, the leaks should
have gone. The gunicorn processes will now only be restarted at the
daily Heroku dyno restart, rather than multiple times per minute,
improving performance.
2017-02-16 17:38:01 +00:00
jgraham 10677eda26 Bug 1339510 - Remove unused detect intermittents code. (#2169) 2017-02-15 22:27:35 +00:00
Ed Morley f397b9819b Bug 1326207 - Replace Django system check hack with --fail-level
Django 1.10 added a new `--fail-level` option that allows overriding the
default of only exiting 1 for ERROR and above, avoiding the need to rely
on awk hacks:
https://docs.djangoproject.com/en/1.10/ref/django-admin/#check
2017-01-10 20:39:37 +00:00
William Lachance 012df34580 Bug 1329002 - Remove last pieces of and references to datasource 2017-01-06 15:01:19 -05:00
Armen Zambrano G ed8e39221d Bug 1306709 - Add SETA to Treeherder 2017-01-05 14:33:55 -05:00
Ed Morley 4df19bddd2 Bug 1318021 - Vagrant: Stop using log files for gunicorn/celery output
Outputting to the console rather than a log file:
* is more user-friendly during development
* is more consistent with Heroku
* means the Vagrant-specific Django LOGGING config is now closer to the
one in settings.py, and so more easily combined with it

Both gunicorn and celery default to outputting to stdout/stderr, so the
`logfile` options can be omitted entirely.
2016-11-23 11:47:04 +00:00
Ed Morley 08f16b31eb Bug 1310727 - Switch to new download URLs for libmysqlclient
The packages have been moved under the archives path, since there are
newer releases now available. The official download link has remained
unchanged, however it's a 302 redirect to a non-HTTPS version of these
links, so we intentionally deep-link, even if it means the URLs will
occasionally need updating.

Fixes the 404 whilst Vagrant provisioning, and failures that would occur
with a clean cache on Heroku/Travis.
2016-10-18 01:14:24 +01:00
William Lachance 61d89cd1a1 Bug 1308528 - Serialize ingestion of job data (#1906) 2016-10-11 17:13:42 -04:00
William Lachance 0300fb69ba Bug 1303055 - Increase the number of log processing workers (#1857)
This should increase throughput, especially in cases where we are backlogged
due to network latency.
2016-09-15 11:51:34 -04:00
Cameron Dawson 9c508817fd Bug 1302529 - Add store_pulse_resultsets to bin script 2016-09-13 13:15:17 -07:00
William Lachance f0105d47f5 Bug 1258861 - Move text log steps and errors into main database (#1696)
This changes ingestion, the API endpoints, and the frontend to match
the new structure. For now we continue to store text_log_summary artifacts,
though they don't do anything anymore.
2016-09-12 12:30:36 -04:00
Ed Morley 0a0a0b78f0 Bug 1299443 - Fix revision.txt on Heroku when SERVE_MINIFIED_UI is unset
Previously `<site-root>/revision.txt` would 404 if `SERVE_MINIFIED_UI`
was unset on Heroku, which would then cause the next deploy to fail.

It's now made available in both the `ui/` and `dist/` directories, so
it can be found regardless of the value of `SERVE_MINIFIED_UI`.
2016-09-06 19:25:08 +01:00
Cameron Dawson a236e69474 Bug 1264074 - Add execute permission to run_read_pulse_resultsets 2016-08-30 08:34:27 -07:00
camd b2e5e714aa Bug 1264074 - Use Pulse for creation of Github resultsets (#1692)
* Bug 1264074 - Move to_timestamp function to a reusable location

* Bug 1264074 - Refactor JobConsumer to have a PulseConsumer super class

Much of what was in the JobConsumer is reusable by the upcoming
ResultsetConsumer.  So refactor those parts out so that each specific
consumer can reuse code as much as possible.

* Bug 1264074 - Add ability to ingest Github Resultsets via Pulse

This introduces a ResultsetConsumer and a read_pulse_resultsets
management command to ingest resultsets from the TaskCluster
github exchanges.

When a supported Github repo has a Pull Request created or
updated, or a push is made to master, then it will kick off a
Pulse message.  We will receive it and then fetch any additional
information we need from github's API and store the Resultset.

This follows a very similar pattern to the Job Pulse ingestion.

* Bug 1264074 - Old code/comments cleanup

* Bug 1264074 - Tests for the Github resultset pulse loader
2016-08-22 16:29:55 -07:00
Ed Morley b3fc92d009 Bug 1289156 - Clean up vendor-libmysqlclient.sh bash conditional
We're using Bash errexit mode (`set -e`) so cannot directly use a
command that returns non-zero inside `[` style brackets (unless in a
`$(...)`), however the `(` form does work with errexit and is cleaner.
2016-08-11 00:48:21 +01:00
Ed Morley 34fdb458ad Bug 1289156 - Final tweaks for libmysqlclient deploy on Heroku/SCL3
There's a strange bug when creating relative symlinks on top of an
already existing symlink, in that the target resolves to the wrong file.
As such, we now explicitly check for an existing symlink first, to avoid
overwriting.

The SCL3 system check disabling has also been tweaked since #1770, since
the `HOSTNAME` environment variable doesn't appear to be set during
deploy, even though it appears in `env` on the same machine.

Yey for deployment code that can only really be tested by deploying \o/
2016-08-10 23:34:43 +01:00
Ed Morley 2f4f5019df Bug 1289156 - Update the Heroku PATH workaround so pip can be found
The Heroku pre_compile script is currently run prior to the cache being
restored (https://github.com/heroku/heroku-buildpack-python/pull/321),
which means we have to tweak PATH so vendor-libmysqlclient.sh can find
the binaries from the cache instead of the app directory.

However the workaround added in #1770 only added one of the two extra
required PATHs, this adds the other.

Prior to this the buildpack compile would output:
> ./bin/vendor-libmysqlclient.sh: line 65: pip: command not found

...and so wouldn't purge the old mysqlclient package, which is needed to
force recompilation against the newer libmysqlclient.

Once the PR against heroku-buildpack-python is merged, these workarounds
can be removed.
2016-08-10 14:34:55 +01:00
Ed Morley 3b1e45ce0c Bug 1289156 - Vendor libmysqlclient 5.7 to protect against CVE-2015-3152
The latest versions of libmysqlclient 5.5/5.6 (used by mysqlclient) are
still vulnerable to TLS stripping, even after last year's backports of
5.7.x fixes:
  - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3152
  - http://bugs.mysql.com/bug.php?id=82383

Ideally we'd just use the standalone Connector/C library instead of the
libmysqlclient packages, however the latest release is too old:
  - http://bugs.mysql.com/bug.php?id=82448

Heroku's cedar-14 stack comes with libmysqlclient 5.5.x, so until it is
updated to 5.7.x (see https://github.com/heroku/stack-images/pull/38) we
must manually vendor 5.7.x ourselves, so that connections between the
Heroku dynos and our public RDS instances are secure. We can do this and
still remain on MySQL server 5.6, since newer client releases are
backwards compatible with older server versions.

Whilst the Vagrant/Travis MySQL instances don't use TLS (and so aren't
affected), we still want them to use libmysqlclient 5.7, to be
consistent with production.

Installing the newer libmysqlclient isn't sufficient on it's own. Any
packages compiled against the older version (in our case mysqlclient)
need to be recompiled. We ensure this happens by pip uninstalling the
existing package if it was already installed.
2016-08-10 11:45:08 +01:00
Cameron Dawson b99e23ba1b Bug 1266229 - make run_read_pulse_jobs executable 2016-06-07 12:02:19 -07:00
Cameron Dawson 3402f00fbc Bug 1266229 - Create store_pulse_jobs queue and prep to turn on Pulse ingestion
Rename ``ingest_from_pulse`` management command to ``read_pulse_jobs`` to
indicate that this step does not actually do any ingesting.  It just populates
the celery queue ``store_pulse_jobs`` that DOES do the actual ingesting.
2016-06-01 16:31:14 -07:00
Ed Morley 53cd879c4d Bug 1276249 - Heroku: Wrap deploy migration/init with newrelic wrapper
This will give us greater visibility into slow migrations and help
correlate them against any perf issues seen elsewhere at the same time.
2016-05-27 18:43:12 +01:00
Ed Morley 92793e569e Bug 1191934 - Remove the now-redundant fetch-missing-pushlogs task
The task was a workaround for us missing pushes, however the root causes
of these have since been fixed.
2016-05-27 15:47:04 +01:00
Ed Morley a54d292673 Bug 1275761 - Remove the now unused high priority log parsing queues
Since they are unused after bug 1273231.
2016-05-26 15:34:55 +01:00
Cameron Dawson c0af32bf58 Bug 1266584 - Create ingest_from_pulse command script for supervisord 2016-05-25 15:23:37 -07:00
jgraham bb60ca6150 Merge pull request #1460 from mozilla/pre-deploy-skip-env
Bug 1270454 - Allow skipping the Heroku pre_deploy script entirely
2016-05-09 10:06:49 +01:00
Ed Morley 9e20b7934d Bug 1247344 - Enable Django system checks during testing and deployment
`manage.py check --deploy` is now run during Travis testing and as part
of stage/prod/Heroku deployment. It checks for a number of common
configuration mistakes & ensures security best practices are being
followed:
https://docs.djangoproject.com/en/1.8/ref/checks/
2016-05-06 16:09:11 +01:00
Ed Morley 680249cdeb Bug 1270454 - Allow skipping the Heroku pre_deploy script entirely
...by defining 'SKIP_PREDEPLOY' in the environment.

This is useful in cases where we want to avoid potentially destructive
actions (such as running migrations) from taking place, or know that the
migration is just going to time out unless run by hand.
2016-05-05 12:28:25 +01:00
Ed Morley 519bf901ad Bug 1169944 - Use the New Relic wrapper when running scripts locally too
Previously if the `bin/` directory scripts were run in the Vagrant
environment, the processes run would not have been started via the
New Relic wrapper command, since the New Relic licence key is not set.

For greater consistency between Vagrant and production, the wrapper
command is now always used.

This works since `NEW_RELIC_DEVELOPER_MODE` is defined in the Vagrant
environment (thanks to a previous commit in the same bug), which
prevents the agent from trying to submit real data:
https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#developer_mode
2016-05-03 21:21:04 +01:00
James Graham b98f7a81fa Remove support for parsing mozlog json logs 2016-04-19 19:16:08 +01:00
James Graham 7e4084d24f Bug 1252854 - Backend work for matching unstructured and structured log summary lines. 2016-04-19 19:16:08 +01:00
Ed Morley 5b48f4b49b Bug 1258700 - Update to WhiteNoise 3.0
There are some backwards incompatible changes:
http://whitenoise.evans.io/en/latest/changelog.html
https://github.com/evansd/whitenoise/compare/v2.0.6...v3.0

Specifically:
* The CLI compression utility must now be called via
`python -m whitenoise.compress` rather than `python -m whitenoise.gzip`.
* The `whitenoise.django.GzipManifestStaticFilesStorage` storage backend
has moved to `whitenoise.storage.CompressedManifestStaticFilesStorage`.
* The internal `add_files()` method has been split into two and the part
which we need to subclass is now named `update_files_dictionary()`. See:
07f9c0bece
2016-03-30 13:00:23 +02:00
Ed Morley 4b48c50615 Bug 1165229 - Heroku: Add option to make pre-deploy errors non-fatal
When first setting up a new app on Heroku, things like reporting the
deploy to New Relic will fail, since it requires that the app exist on
New Relic. However the app will only be created there once the Python
agent first reports app metadata, which won't happen until after the
deploy (there is no way to create the app via the web interface).

In addition, there may be cases in the future when stage/prod is broken,
and the pre-deploy tasks therefore fail, however we still want the
deploy to proceed.

To avoid needing to constantly edit this file, the environment variable
`IGNORE_PREDEPLOY_ERRORS` can now be set, in cases where the deploy
should continue even if there were errors. (Note this uses the bash 4.2+
`-v` option, see http://stackoverflow.com/a/18448624).
2016-03-17 13:12:43 +00:00
Ed Morley 9f4f439146 Bug 1165229 - Heroku: Report deployments to New Relic
Requires that `NEW_RELIC_APP_NAME` and `NEW_RELIC_API_KEY` be set in the
environment. NB: `NEW_RELIC_API_KEY` is different from the existing
`NEW_RELIC_LICENSE_KEY`.

We're also making use of the runtime-dyno-metadata labs feature, which
sets the slug/release related environment variables used in this PR:
https://devcenter.heroku.com/articles/dyno-metadata
2016-03-17 13:12:40 +00:00
Ed Morley 859230c9bf Bug 1165229 - Heroku: Move the deploy tasks to their own script
Since we'll soon be adding reporting deploys to New Relic, which will be
too verbose to include in the Procfile. Also adds additional log output
(which follows the buildpack compile log formatting convention) to make
it easier to find & follow the release tasks on Papertrail.

Uses the `set -euo pipefail` recommendation from:
http://redsymbol.net/articles/unofficial-bash-strict-mode/
2016-03-17 11:50:21 +00:00
James Graham b6f4533bd7 Bug 1255087 - Add detect_intermittents and autoclassify queues to celery worker files
This will not cause any additional tasks to actually run since
the code that adds messages to these queues is gated on the
AUTOCLASSIFY_JOBS setting.
2016-03-16 17:46:16 +00:00
Ed Morley b2ecb99390 Bug 1213230 - Remove peep.py
Since it's now unused.
2016-02-15 12:06:17 +00:00
Ed Morley aff281fa78 Bug 1246208 - Heroku: Remove manual collectstatic workaround
The Python buildpack has now rewritten the automatic collectstatic
feature, such that it no longer does an unnecessary (and time-consuming)
dry-run every time. As such, we can switch back to the buildpack's
automatic collectstatic:
https://github.com/heroku/heroku-buildpack-python/blob/master/bin/steps/collectstatic

Prior to this landing, I'll update us to the latest version of the
buildpack (using the `heroku buildpacks:set -i X ...` command) and
remove the `DISABLE_COLLECTSTATIC` environment variable.

[ci skip]
2016-02-08 10:21:12 +00:00
Ed Morley 6080a6cf95 Bug 1242471 - Heroku: Remove now obsolete node PATH workaround
Since the original issue has since been fixed.
2016-01-26 12:45:44 +00:00
Ed Morley 32222f4fe2 Bug 1242471 - Heroku: Remove nodejs files at the end of the compile step
Since once the `grunt build` has run they are no longer required, and
only serve to bloat the slug size, increase attack surface & overwrite
the Python .profile.d script's environment variables.
2016-01-26 12:45:44 +00:00
Cameron Dawson f3c0258a13 Bug 1241583 - celery scripts include autoclassify tasks that shouldn't be currently running
These tasks should not be currently running on stage and prod.  They
will be activated in a later PR.

r=emorley@mozilla.com
2016-01-21 11:02:51 -08:00
Ed Morley 8c5e12eadb Bug 1241144 - Update peep from v2.5.0 to v3.0.0
Is now compatible with pip 8.x.

https://github.com/erikrose/peep/releases/tag/3.0
https://github.com/erikrose/peep/compare/2.5...3.0
2016-01-21 11:12:05 +00:00
Ed Morley e98ff52d90 Bug 1230104 - Update peep from v2.4.1 to v2.5.0
* Is now compatible with pip 7.x
* Adds a `peep port` command to facilitate the transition to pip 8's
hashing feature:
https://pip.pypa.io/en/latest/reference/pip_install/#hash-checking-mode
* Fixes bug in which the right way to call `parse_requirements()` would
not be autodetected.

https://github.com/erikrose/peep/compare/2.4.1...2.5
2015-12-03 10:50:39 +00:00
William Lachance a8e663d61d Bug 1228154 - Generate new performance alerts as data is ingested 2015-12-02 13:20:17 -05:00
Ed Morley 620228cbf3 Bug 1196764 - Rename calculate_eta to calculate_durations
Since we're not calculating ETAs (the UI does that once it knows the
start time and expected duraction), we're calculating recent average
durations instead.
2015-11-30 11:36:18 +00:00
Alice Scarpa 5d9e430cac Bug 1194830: Add a runnable_job API endpoint
This creates a 'runnable_job' table in the database, as well as an API
endpoint at /api/project/{branch}/runnable_jobs listing all existing
buildbot jobs and their symbols. A new daily task 'fetch_allthethings' is
added to update the this table.
2015-11-14 13:56:06 -02:00
Ed Morley 50cec5c1fe Bug 1221806 - Change the stage/prod Gunicorn timeout from 120s to 30s
To help prevent excessively demanding queries from having a detrimental
effect on the API/DBs.
2015-11-05 14:22:30 +00:00