Commit Graph

199 Commits

Author SHA1 Message Date
Leo Hemsted
e7b13e727a don't capture logs directly from stdout
previously in run_app_paas.sh, we captured stdout from the app and
piped that into the log file. However, this came up with a bunch of
problems, mainly:

* exceptions with stack traces often weren't formatted properly,
  and kibana could not parse them
* celery logs were duplicated - we'd collect both the json logs and
  the human readable stdout logs.

instead, with the updated utils library, we can use that to log json
straight to the appropriate directory directly.
2017-08-09 15:29:39 +01:00
Imdad Ahad
6da3d3ed0b Remove wheels-ing on deployment 2017-07-21 14:26:59 +01:00
minglis
033fe0f4dd Merge pull request #998 from alphagov/update-queues-script
Did some work around the delete queues script
2017-05-31 15:08:35 +01:00
Martyn Inglis
b98b97c4a2 Added a comment about delete queues 2017-05-31 15:06:21 +01:00
Martyn Inglis
68e15b57f5 Fixed pep8 2017-05-30 17:29:14 +01:00
Martyn Inglis
8f7afcdb16 Did some work around the delete queues script 2017-05-30 17:07:43 +01:00
Imdad Ahad
a58e724d21 Add a script and make command to detect if there are any migration changes 2017-05-26 16:44:23 +01:00
Imdad Ahad
586c83a2c7 Add a script to delete sqs queues:
* Uses boto to retrieve/delete queues
* Additional functions to output/read from csv
2017-05-25 13:33:26 +01:00
bandesz
bacce90ac2 PaaS run script: redirect stderr to stdout 2017-03-21 15:03:03 +00:00
bandesz
b453dd59d0 Add termination timeout to run_app_paas.sh 2017-02-28 17:39:04 +00:00
imdadahad
4ac6043701 Revert "Ensure all wheels are installed offline from the wheelhouse directory" 2017-02-23 16:43:09 +00:00
imdadahad
1254008e2e Merge pull request #831 from alphagov/feat-install-all-wheels-offline
Ensure all wheels are installed offline from the wheelhouse directory
2017-02-23 15:58:12 +00:00
bandesz
72dc93c6db Add awslogs logging for PaaS 2017-02-16 17:38:30 +00:00
Imdad Ahad
79ae0219e6 Ensure all wheels are installed offline from the wheelhouse directory 2017-02-15 16:57:44 +00:00
Imdad Ahad
2e4b09154e Remove verbose logging of directory creation 2017-02-14 11:37:47 +00:00
Imdad Ahad
5ac3643d9d Cancel uninstalling all py3 packages 2017-02-14 11:36:38 +00:00
Imdad Ahad
383553b964 Remove notify app folder and installed python packages before we deploy the app 2017-02-13 17:13:39 +00:00
Martyn Inglis
19fd4b3ce9 Log which file we're trying to stop. 2017-02-08 16:58:26 +00:00
Martyn Inglis
a7cfaf3f13 Better logging for multiple instances running. 2017-02-08 16:35:09 +00:00
Martyn Inglis
703e12e516 Code style check passed. 2017-02-08 16:26:12 +00:00
Martyn Inglis
5d0bc0abe8 Add a stop celery script into the scripts folder.
Stopping celery via upstart issues a TERM signal to the whole process group, which immediately kills the worker threads. This can lead to inconsistentcy in the state of a notification as an API call, for example, can take several seconds consequently the likelihood of the call being lost due to a restart is relatively high.

We need to ensure that we stop cleanly to ensure code deploys and autoscale events do not cause issues.

this script is called as part of a pre-stop hook in upstart, which passes a pid file location to the script. The script will then issues the TERM signal to only the master celery process. which will cleanly shut down the workers and exit.

the script will loop based on the existence of a /proc/{pid} for the celery master process. Once the file is gone the script will exit. Upstart blocks on this script before issuing kill on whatever processes may be left hanging around.

the length of the loop is a maximum 15 minutes - which is the tested max time a task may take. In reality it will exit much quicker.
2017-02-08 16:17:50 +00:00
Chris Hill-Scott
c2999ed5ad Use pycodestyle instead of PEP8
PEP8 was renamed to pycodestyle; this issue explains why:
https://github.com/PyCQA/pycodestyle/issues/466

This commit changes our tests to use pycodestyle instead of pep8.

It also means:
- making a couple of whitespace changes to appease the linter
- disabling warnings for bare `Except`s (ie `Except` instead of `Except
  ValueError`) – this seems like a sensible thing to catch but I’m not
  going to make meaningful code changes in this commit
2017-02-01 09:19:32 +00:00
Rebecca Law
4e4afc5d0b Rename test with duplicate name 2017-01-27 15:21:59 +00:00
Imdad Ahad
177515de8f Use python wheels to speed up AS deployment:
* Create wheels from python dependencies on building codedeploy artifact
* Update script to install wheels and default to pypi if not found
2016-10-21 16:16:10 +01:00
Peter Chamberlin
b0d0a5627d Use make to generate version file 2016-10-04 12:03:07 +01:00
Peter Chamberlin
1539a527e6 Updated bootstrap to copy version.py.dist as required 2016-10-04 11:13:43 +01:00
Martyn Inglis
19f2a6cb65 Added stop for research mode worker 2016-09-30 11:25:12 +01:00
Martyn Inglis
6ce85878d8 Added start for research mode worker 2016-09-30 11:23:54 +01:00
bandesz
8ab7fa3395 Build db migration codedeploy artifact 2016-09-21 11:21:12 +01:00
Leo Hemsted
b294568a91 Merge pull request #653 from alphagov/junit-test-results
add junit xml reporting to pytest
2016-09-02 09:38:01 +01:00
Leo Hemsted
00cac0f88b add junit xml reporting to pytest
also add file location to gitignore preemptively
2016-08-31 15:03:28 +01:00
Martyn Inglis
ce006bd92d Start/Stop the new worker scripts on the code deploy actions. 2016-08-31 11:40:47 +01:00
Leo Hemsted
7835339165 Merge branch 'master' into test-fixes 2016-08-26 10:57:41 +01:00
bandesz
9b4188f05a Travis cleanup: remove deploy + functest trigger 2016-08-25 16:19:52 +01:00
Leo Hemsted
9d624ef280 prevent errors if user has no venv setup at all 2016-08-23 13:56:10 +01:00
Leo Hemsted
a3843053cd improved local test-running ability
call generate-version-file before tests, since they'll fall over if the version file isn't present
use /Users/leohemsted/.virtualenvs/api rather than looking for ./venv/ - if there's some other venv already active, then don't try and look for a current venv to activate
2016-08-23 12:17:56 +01:00
bandesz
68c1135379 Create Docker build image, build project with Docker 2016-08-22 17:25:41 +01:00
Martyn Inglis
e606202a08 Increase ELB wait time 2016-07-29 10:15:34 +01:00
Martyn Inglis
7bd1ea1a45 Wrong path to app 2016-07-29 10:15:33 +01:00
Martyn Inglis
d34ae9edbc Fixed some bash if blocks and removed env file from db.py 2016-07-29 10:15:33 +01:00
Martyn Inglis
26890c6436 Added basic elb/instance lookups 2016-07-29 10:15:33 +01:00
Martyn Inglis
0933c153ea Added notify-app if/else block so can run on new staging and preview 2016-07-29 10:15:33 +01:00
Leo Hemsted
f034f99b8d Update bootstrap.sh
force python3 when creating virtualenv
2016-07-15 10:24:44 +01:00
minglis
7e7f221461 Update bootstrap.sh 2016-07-12 13:28:03 +01:00
Martyn Inglis
2cf5f4ed24 updated bootstrap 2016-07-11 10:22:59 +01:00
Chris Hill-Scott
4f145c245a Add code coverage 2016-06-17 17:09:50 +01:00
Leo Hemsted
54a1adfe8b fix copypasta error with ses test 2016-06-02 16:30:40 +01:00
Martyn Inglis
b550ee1e8f Lowercasing the instance name to ensure that matches across AWS builds 2016-05-19 14:33:14 +01:00
Martyn Inglis
5f7292f92c Renamed the instance keys 2016-05-19 14:07:02 +01:00
Martyn Inglis
41512435e3 Adding nodowntime scripts as used in the admin app
Adapted to look up instance name from instance Tags
Allows app to choose correct ELB to de/register with
Delivery apps exit with code 0 earlier in the process
2016-05-19 11:37:23 +01:00