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

190 Коммитов

Автор SHA1 Сообщение Дата
Armen Zambrano deaf8c850c Bug 1169263 - Switch from Vagrant to docker-compose (#4901)
* Change permissions for docker/entrypoint.sh
* Allow using Django in localhost
* Documentation changes
Allow running shellcheck tests
Use docker-compose for the Selenium tests
Install docs updates
Switch to yarn cache instead of npm
Install UI dependencies
* Add ability to override DATABASE_URL and use a .env file
2019-05-16 14:56:02 -07:00
Ed Morley 6945c4c471
Bug 1165259 - Add infrastructure documentation (#4766)
- Adds a new "infrastructure" section to the docs, which describes
  architecture, administration and troubleshooting (fixes bug 1165259).
- Adds code comments to any deployment-related files in the repository.
- Adds documentation for the various ways in which users can access
  Treeherder data (fixes bug 1335172).
- Reorganises the structure of some of the existing non-infrastructure
  docs, to make the documentation easier to navigate.
2019-03-11 21:39:34 +00:00
Ed Morley cd826ef6d9 Bug 1530206 - Remove the bin/run_* scripts
Since they are out of sync with `Procfile` and long term are best replaced
with one of the solutions in bug 1318020.

The development setup instructions have been updated to stop recommending
gunicorn, since Django's runserver is more appropriate for beginners
(and I'm pretty sure the memory leaks seen previously no longer occur).
2019-02-27 07:12:33 +00:00
Ed Morley a0d1f5fccf
Bug 1330474 - Travis: Stop testing against Python 2 (#4675)
Since we've been using Python 3 in production for long enough that we're
confident we won't need to roll back to Python 2.
2019-02-25 06:54:46 +00:00
Ed Morley 86b7b32fd1 Bug 1527868 - Vagrant/Travis: Remove Elasticsearch server
To ensure the CI and local environments match stage/production (where
Elasticsearch is not configured) and don't run differing code-paths due
to the various `ELASTICSEARCH_URL` conditionals used in auto-classify.

At such time when work on the fuzzy auto-classify matcher continues,
this can be reverted.
2019-02-14 21:10:21 +00:00
Cameron Dawson deb71d65e0 Bug 1364045 - Convert all unit tests to Jest (#4603)
Also remove all Karma support and update the docs to only mention ``Jest``.

One of the test files was testing some AngularJS filters. I converted these
tests to test the equivalent helper functions.
2019-02-12 07:49:50 +00:00
Ed Morley fbe255ea86
Vagrant/Travis: Update Elasticsearch to 6.6.0 (#4614)
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.3.0.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.3.1.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.3.2.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.4.0.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.4.1.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.4.2.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.4.3.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.5.0.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.5.1.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.5.2.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.5.3.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.5.4.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/release-notes-6.6.0.html

Note: An Elasticsearch instance does not exist for stage/prod, so this
update is mostly a no-op ready for when/if development on the auto-classify
feature continues.
2019-02-11 11:56:11 +00:00
Ed Morley 979c22710f
Update geckodriver to 0.24.0 (#4610)
https://github.com/mozilla/geckodriver/releases/tag/v0.24.0
2019-02-11 10:21:17 +00:00
Sarah Clements 24bda1ed83
Bug 1508228 - Remove Intermittents Commenter celery task (#4300)
Remove celery task and change Commenter weekly_mode default arg in
preparation for the move to the heroku scheduler
2018-11-27 14:14:38 -08:00
Ed Morley 3decefed0b
Clean up the location of generated output directories (#4289)
So that their purposes are clearer and it's easier to differentiate
between generated content and files committed to the repository.

* Neutrino build: `build/` -> `.build/`
* Sphinx build: `_build/` -> `.build-docs/`
* Django collectstatic: `treeherder/static/` -> `.django-static/`
2018-11-16 19:18:18 +00:00
Ed Morley bb86b7fb6b
Bug 1504617 - Travis: Explicitly start redis-server (#4227)
Since the service is no longer started by default in the base Travis
image as of travis-ci/travis-cookbooks#999.

Fixes:

```
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
```
(eg https://travis-ci.org/mozilla/treeherder/jobs/450605269#L880)
2018-11-05 09:38:28 +00:00
Ed Morley 565ae4c13e
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216)
Neutrino controls our frontend linting, transpilation, source-maps,
testing, dev-server and optimisation of production builds.

Highlights of the upgrade are:

* Major version updates to the individual tools within (such as webpack,
  Babel and ESLint), significantly improving performance, fixing
  transpilation/minification correctness bugs, adding support for newer
  ECMAScript features, and increasing linter coverage.
* Hot reloading in the dev server now works for all entry-points and not
  just the jobs view, shortening the feedback cycle.
* Reduced bundle size due to webpack 4's tree shaking, scope hoisting,
  automatic shared/vendor code chunk splitting (no need for the manually
  maintained 'vendor' list).
* CSS is now extracted out of JS, which improves performance, reduces
  bundle size and prevents the initial white flash of un-styled content.
* Support for dynamic imports/code splitting (needed for bug 1502192).
* Support for Jest via a new Jest preset (unblocks bug 1364045).
* Support for public class field declarations (unblocks bug 1480166).
* Improved source-maps (increases the quality of production exception
  trace-backs and fixes several debugger breakpoint bugs).
* Reduced amount of custom configuration required for our fairly complex
  frontend needs, reducing maintenance burden and allowing for easier
  future Neutrino upgrades.

In addition this PR:

* Fixes the WhiteNoise `immutable_file_test()` regex, so that it now
  correctly enables browser caching of images, fonts and source maps.
* Enables webpack-dev-server's overlay feature, which displays any
  compilation errors in the browser, saving having to switch back
  to the console (this can be enabled for warnings too if desired).
* Enables webpack-dev-server's automatic browser-opening feature,
  which saves having to manually navigate to `localhost:5000` after
  running `yarn start`.
* Switches Karma tests to run Firefox in headless mode, reducing the
  workflow disruption when running `yarn test`.
* Uses the new webpack `performance` option to enable maximum asset
  file size thresholds, to help prevent bundle-size regressions.
* Rewrites the `package.json` script commands so that they now work
  correctly on Windows, even when setting environment variables.

Performance comparison:

* Local `yarn build`:
  - Cached: 2m34s -> 23s
  - Uncached: 2m34s -> 58s
* Local `yarn start`:
  - Cached: 34.5s -> 13.6s
  - Uncached: 34.5s -> 31.3s
* Local `yarn test`
  - Cached: 61.5s -> 19.8s
  - Uncached: 61.5s -> 22.0s
* Local `yarn lint`
  - Cached: 3.8s -> 1.8s
  - Uncached: 13.7s -> 13.4s
* Travis end-to-end time:
  9 minutes -> 6 minutes
* Heroku deploy end-to-end time:
  14 minutes -> 9 minutes
2018-11-02 18:48:28 +00:00
Ed Morley 47419fde6c
Bug 1428031 - Heroku: Increase max load_initial_data retries to 10 (#4203)
Since there was still a deploy failure after five attempts here:
https://dashboard.heroku.com/apps/treeherder-prototype/activity/releases/2847
2018-10-29 09:14:15 +00:00
Ed Morley 165ef15747
Bug 1428031 - Heroku: Retry load_initial_data up to 5 times (#4186)
To work around the intermittent MySQL deadlocks encountered during
a small percentage of deployments. This will ensure deployments don't
cause email spam to app collaborators and Heroku admins, as well as
saving us from having to manually retry the release each time it
occurs.

The `IGNORE_PREDEPLOY_ERRORS` option has also been removed, since
it's mostly redundant with `SKIP_PREDEPLOY`.
2018-10-25 19:07:37 +01:00
Ed Morley 22572cc5ad
Update geckodriver to 0.23.0 (#4100)
https://github.com/mozilla/geckodriver/releases/tag/v0.23.0
2018-10-04 15:19:31 +01:00
Ed Morley 445766d958
Bug 1443251 - Remove support for buildbot job ingestion (#4087)
The buildapi celerybeat tasks were disabled previously in #4007, so
these tasks are unused.
2018-10-02 11:07:27 +01:00
Ed Morley ffaa2e4b2a
Bug 1443251 - Remove runnable jobs support for buildbot (#4071)
Runnable jobs for buildbot were calculated via a celerybeat task
(that was disabled in #4007) and the results stored in the
`runnable_jobs` table. This can all be removed now that buildbot is
EOL, since the remaining support for Taskcluster runnable jobs does
not use that celery task/Django model.
2018-09-27 19:15:47 +01:00
Ed Morley ebc74b9098 Travis: Install a matching version of Yarn
Since Heroku uses the version in `package.json` whereas until now
Travis would use an older version installed in their image.
2018-09-27 00:15:59 +01:00
Ed Morley eae4fa006f
Bug 1492462 - Remove retrigger/cancel APIs and pulse publisher (#4042)
Since as of #3980 (bug 1470622) the frontend no longer calls the
`/retrigger/` `/cancel/` or `/cancel_all/` Treeherder APIs.

Whilst looking at the pulse related fixtures, I spotted that the
`mock_message_broker` fixture was already unused.
2018-09-21 17:39:03 +01:00
Ed Morley 6cd2d3e52e
Update geckodriver to 0.22.0 (#4035)
https://github.com/mozilla/geckodriver/releases/tag/v0.22.0
2018-09-16 21:40:22 +01:00
Ed Morley 817ac227f3
Bug 1489407 - Docs: Pin to older version of CommonMark to fix build (#3998)
CommonMark has made a breaking package change in a minor version
release (0.8.0), so we need to pin to the last working release. See:
https://github.com/rtfd/CommonMark-py/issues/134

Fixes:

```
  ...
  File ".../recommonmark/recommonmark/parser.py", line 9, in <module>
    from CommonMark import Parser
ImportError: No module named CommonMark
```

The Travis docs setup step has also been modified to always upgrade
dependencies, which will mean we will catch cases like this on Travis
next time.
2018-09-07 10:41:04 +01:00
Ed Morley 1b52b07728
Bug 1445325 - Stop mirroring classifications to OrangeFactor (#3677)
Now that consumers of OrangeFactor have been switched to the new
intermittent failures view UI/API, we can stop submitting failure
classifications to OrangeFactor's Elasticsearch instance.
2018-08-03 00:16:35 +02:00
Ed Morley ae0f12f5ba
Bug 1478344 - Travis: Switch from Ubuntu 14.04 to 16.04 (#3826)
* Adds a `rabbitmq-server` install step, since it's no longer
  installed in the image by default.
* Removes the MySQL 5.7 install step, since Ubuntu 16.04's default
  MySQL is now 5.7 rather than 5.6.
* Adjusts which services are manually started to account for changes
  in which are enabled by default in the new image.
2018-07-26 14:26:32 +02:00
Sarah Clements 5386f7ed40
Bug 1453760 - bug commentor (#3571)
* Bug 1453760 - bug commentor
replacement for Orange Factor bug commentor
2018-07-20 16:36:40 -07:00
Ed Morley 5439ddcb6a
Bug 1471182 - Update geckodriver to 0.21.0 (#3717)
https://github.com/mozilla/geckodriver/releases/tag/v0.21.0
2018-06-26 13:05:28 +01:00
Ed Morley 7c48aa1664
Bug 1459148 - Update geckodriver to 0.20.1 (#3520)
https://github.com/mozilla/geckodriver/releases/tag/v0.20.1
2018-05-08 08:22:22 +01:00
George Hickman d5b6cd3e53 Bug 1427598 - Bump Elasticsearch to 6.2.4 2018-04-25 08:37:07 +01:00
Ed Morley 023d31885a
Bug 1453850 - Enable Python 2's `-3` mode on Travis (#3444)
This enables `DeprecationWarnings` for things that Python 2 knows
are not compatible with Python 3. The `error` entry in the pytest
`filterwarnings` setting ensures these will be surfaced as Exceptions
and so result in test failures.

See:
https://docs.python.org/2/using/cmdline.html#cmdoption-3

The removal of `sorted()` from `test_bug_job_map_api.py` is to fix:
`DeprecationWarning: dict inequality comparisons not supported in 3.x`
2018-04-13 23:14:36 +01:00
Ed Morley 5a1b3d60ac
Bug 1445469 - Update to geckodriver v0.20.0 (#3339)
https://github.com/mozilla/geckodriver/releases/tag/v0.20.0
2018-03-13 23:23:33 +00:00
Ed Morley deb1fc86b7 Bug 1384518 - Switch from Memcached to Redis
Since:
* Redis has additional features we need (eg for bug 1409679)
* the Redis server, python client and Django backend are more
  actively maintained (so have persistent connections/pooling that
  actually works, which gives a big perf win)
* we can use Heroku's own Redis addon rather than relying on a
  third-party's (to hopefully prevent a repeat of the certificate
  expiration downtime)

This commit:
* Switches pylibmc/django-pylibmc to redis-py/django-redis, and
  configures the new backend according to:
  http://niwinz.github.io/django-redis/latest/
  https://github.com/andymccurdy/redis-py
* Uses redis-py's native support for TLS to connect to the Heroku
  Redis server's stunnel port directly, avoiding the complexity of
  using a buildpack to create an stunnel between the dyno and server:
  https://devcenter.heroku.com/articles/securing-heroku-redis#connecting-directly-to-stunnel
* Uses explicit `REDIS_URL` values on Travis/Vagrant rather than
  relying on the django-environ `default` value (for parity with
  how we configure `DATABASE_URL` and others).
* Removes the pylibmc connection-closing workaround from `wsgi.py`.

Note: Whilst the Heroku docs suggest using `django-redis-cache`, it's
not as actively maintained, so we're using `django-redis` instead:
https://devcenter.heroku.com/articles/heroku-redis
https://github.com/niwinz/django-redis
https://github.com/sebleier/django-redis-cache

Before this is merged, Heroku Redis instances will need to be created
for stage/production (prototype done) - likely on plan `premium-3`:
https://elements.heroku.com/addons/heroku-redis

We'll also need to pick an eviction policy:
https://devcenter.heroku.com/articles/heroku-redis#maxmemory-policy

Once deployed, the `memcachier-tls-buildpack` buildpack will no longer
be required and can be removed from prototype/stage/prod, along with
the `TREEHERDER_MEMCACHED` environment variable and Memcachier addon.
2018-01-21 14:41:35 +00:00
Ed Morley d9909d5fa2 Bug 1384518 - Add a Redis server instance to Vagrant/Travis
In preparation for later commits, this installs `redis-server` in
the Vagrant environment, and starts the pre-installed (but stopped
by default) `redis-server` on Travis:
https://docs.travis-ci.com/user/database-setup/#Redis

Production/stage/prototype will use Heroku's own Redis add-on:
https://elements.heroku.com/addons/heroku-redis
2018-01-21 14:41:35 +00:00
Ed Morley bc0ca97102
Bug 1419965 - Remove the estimated job time remaining backend (#2990)
The UI has already been removed. This cleans up the data ingestion
and removes the `JobDuration` model, however leaves the `running_eta`
field on the `Job` model for the next time that table is touched (since
the table is large, so altering the schema would likely require
downtime).
2017-12-04 22:09:38 +00:00
Ed Morley e55e58c834 Bug 1420891 - Docs: Test building the docs on Travis 2017-11-28 16:56:45 +00:00
Ed Morley e969648592 Bug 1389572 - Travis: Skip Elasticsearch install if version matches
Since after my update to the Travis images, the pre-installed version
of Elasticsearch matches the one we're looking for, meaning the
download/install can be skipped, saving time.
2017-11-27 16:39:02 +00:00
Ed Morley 4b4a7341c3 Bug 1389572 - Travis: Don't install custom yarn
Since I've adjusted the Travis images to always use the latest yarn
at the time the images are created, so it's not worth installing the
latest version at every runtime:
https://github.com/travis-ci/travis-cookbooks/pull/935
2017-11-27 16:39:02 +00:00
Ed Morley 3f5ef6b352 Bug 1418956 - Set yarn's no-bin-links option via .yarnrc
To save having to pass it each time when using `yarn {install,add}`.
2017-11-20 18:59:26 +00:00
Ed Morley be843a8837 Bug 1414255 - Fix shellcheck warnings about sourced files
```
SC1090: Can't follow non-constant source. Use a directive to specify location.
SC1091: Not following: /etc/profile.d/treeherder.sh was not specified as input (see shellcheck -x).
```

See:
https://github.com/koalaman/shellcheck/wiki/SC1090
https://github.com/koalaman/shellcheck/wiki/SC1091
2017-11-05 20:53:29 +00:00
Ed Morley 37b2c9855e Bug 1414255 - Fix shellcheck warnings about missing quotes
`SC2086: Double quote to prevent globbing and word splitting`

See:
https://github.com/koalaman/shellcheck/wiki/SC2086
2017-11-05 20:53:29 +00:00
Ed Morley 934c6a2ab9 Bug 1414255 - Enable bash 'strict mode' in all shell scripts
This makes some of the error checking in `runtest.sh` redundant.
The shebangs have also been made more consistent.

See:
http://redsymbol.net/articles/unofficial-bash-strict-mode/
2017-11-05 20:53:29 +00:00
Ed Morley 9b3b216b86
Bug 1414667 - Travis: Test using Firefox beta instead of stable (#2916)
Since it reduces the intermittent failure rate in bug 1401048 and is
also likely more representative of what people are using to access
Treeherder in production (whilst still being more stable than Nightly).
2017-11-05 20:48:48 +00:00
Ed Morley 2ad4b2e0ab
Bug 1414247 - Travis: Use Firefox headless mode instead of xvfb (#2907)
Now that Firefox supports being run in headless mode, we no longer
need to use the xvfb workaround on Travis.
2017-11-03 16:10:48 +00:00
Ed Morley 624d2f43a9 Bug 1414094 - Travis: Move setup steps to a reusable script
This:
* reduces duplication
* opens the door to sharing functionality with `vagrant/setup.sh`
* will make it easier to visualise the Travis bootstrap process
  when moving both Travis and Vagrant to a unified Docker environment.
2017-11-03 12:01:26 +00:00
Ed Morley 08430370bd Bug 1176412 - Heroku: Remove New Relic host display name workaround (#2844)
Previously New Relic displayed the hostname for each dyno as
"Dynamic Hostname", due to the randomly generated Heroku hostnames.
As such, we had to set a manual display name to identify the dyno
type reported for each transaction. This was only partly useful, since
New Relic doesn't use it in all places of their UI.

However the New Relic Python agent 2.96.0.80 release has now added
official support for Heroku dyno names, making this workaround
unnecessary:
https://docs.newrelic.com/docs/release-notes/agent-release-notes/python-release-notes/python-agent-252040
d2c4aa097e (diff-a57cabe85e94b1050fb4ff1749effcf5R335)
2017-10-17 18:43:15 +02:00
Ed Morley bbbaf01c6c Bug 1394128 - Heroku: Fail gracefully if revision.txt inaccessible (#2754)
This allows deploys to succeed even if the live version of revision.txt
is not currently accessible, such as when maintenance mode is enabled.
2017-09-06 15:50:15 +01:00
Alisha Aneja e842ae7701 Bug 1330773 - Use the term 'runnablejobs' rather than 'allthethings' (#2743) 2017-09-03 22:10:56 +01:00
Ed Morley da1f9ebbf8 Bug 1394593 - Heroku: Use .profile instead of set-env
set-env was renamed in the buildpack to set_env, breaking this script.
Rather than just renaming our usage, it makes more sense to stop using
what is really an internal buildpack API and instead use `.profile`:
https://devcenter.heroku.com/articles/dynos#the-profile-file
2017-09-01 18:56:40 +01:00
Ed Morley 1fbf5dff99 Bug 1394593 - Heroku: Use 'DYNO' to check if running on Heroku
On Heroku, the environment variable `DYNO` is always set in the
environment. As such, we can just use that to determine whether
code is being run on Heroku, rather than having to add our own
environment variable.
2017-09-01 18:56:40 +01:00
Ed Morley 33fa97ec84 Bug 1387487 - Reduce gunicorn maximum request time to 20 seconds
To ensure that:
* the Heroku router's 30 second timeout doesn't beat gunicorn to it,
  given that routing time is included in Heroku's timing
* the app is more likely to remain responsive, when receiving many
  badly filtered API calls
2017-08-04 18:49:35 +02:00
Max Chehab c6e0c26bc8 Bug 1336272 - Refactor changing wording from resultset to push (#2644)
Change of new environment variable `PULSE_PUSH_SOURCES`.

Keep old `publish-resultset-runnable-job-action` task name by creating a 
method that points to `publish_push_runnable_job_action`.
2017-08-04 09:38:57 -07:00
Ed Morley 2ae5c57959 Bug 1365567 - Remove unused libmysqlclient vendoring support
All environments are now using the native MySQL 5.7 libmysqlclient
library, so the custom vendoring script is unused. The tests checking
that the library isn't vulnerable aren't needed any more, since
heroku-16 doesn't even have that package installed (it's not available
on Xenial).
2017-08-03 11:53:16 +01:00