Commit graph

19 commits

Author SHA1 Message Date
Karim Hamidou
ae32666609 [cloud-api] Base infrastructure for running cloud workers
Summary:
I've decided to break my snooze patches in multiple parts to make it easier to review. This diff contains all the code related to running workers in the cloud. Cloud workers all inherit from the `Worker` class which defines a bunch of useful things like error handling.

What's left to do:
- spawn workers based on the plugin type
- add monitoring (I'm going to add a simple HTTP endpoint for that)
- writing a migration for the local sync db and the prod metadata db.

Test Plan: Tested manually.

Reviewers: halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3814
2017-02-02 16:14:59 -08:00
Evan Morikawa
83744c73d0 Add redis back into pm2 2017-01-31 10:57:24 -08:00
Karim Hamidou
44d47ce278 Changes to get the cloud workers to run in our staging environment
Summary:
Summary of the changes:
- renamed some files to es6 to be able to use babel
- only try to create a db folder when we're using sqlite
- drop use of redis
- create a skeleton folder for workers.

Test Plan: Works on staging.

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3784
2017-01-25 16:26:40 -08:00
Evan Morikawa
28a0a929bb [cloud-core] make DB_NAME an environment variable
Default to nylasmailclouddb
2017-01-16 10:56:46 -08:00
Evan Morikawa
d55a2af2cd [cloud-api] refactor cloud API routes to use es6 & fix Gmail Auth
Summary:
This is a refactor of the auth APIs to use async/await. Gmail Auth is
pretty confusing and I wanted to make it cleaner to read and easier to
use. This is also part of the general API upgrade to modern ES6

This also fixes the Gmail auth error we saw at showcase

Test Plan: manual

Reviewers: halla, jackie, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3535
2016-12-19 09:25:07 -08:00
Evan Morikawa
1d254a7aaa [*] Add basic babel toolchain
Summary:
Adds babel to K2
Creates a simple build script so it'll run on prod.

Test Plan: manual

Reviewers: jackie, halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3527
2016-12-16 13:08:21 -05:00
Ben Gotow
0aac73b6d2 [cloud-api] New honeycomb ingestion endpoint 2016-12-01 11:21:28 -08:00
Ben Gotow
27ba2544dd Pull in cloud packages 2016-11-22 10:58:27 -08:00
Ben Gotow
e10e51ab5d A few changes to support linking to K2 via the new GUI 2016-10-11 00:44:10 -07:00
Ben Gotow
ea497f7ea2 A few changes for upcoming db refactoring 2016-07-14 15:48:48 -07:00
Evan Morikawa
1c0c4ee61e Add redis-server back into pm2 2016-07-13 11:41:46 -07:00
Ben Gotow
826db2e6f4 Remove redis from pm2 2016-07-11 16:57:27 -07:00
Halla Moore
8a63ace9e3 Change config to watch just the 'packages' directory 2016-07-11 13:27:44 -07:00
Evan Morikawa
84815ce2fa Add file watching to restart server 2016-07-11 12:00:20 -07:00
Juan Tejada
dce872fac8 Adds bunyan for json logging on every package!
- Bunyan logs json output, and added a stream to send our logs to
cloudwatch
- Replaces /all/ instances of console.log. Turned eslint rule back on,
so we don't use console.log ever again.
- Added npm scripts to view pretty logs
2016-07-08 17:30:24 -07:00
Evan Morikawa
ab3713830c Readme fixes 2016-07-08 12:12:11 -04:00
Evan Morikawa
6fecf0e40d Add redis to local pm2 2016-07-08 12:00:57 -04:00
Evan Morikawa
0972592aa5 Add ports to pm2-dev 2016-07-07 16:05:44 -07:00
Ben Gotow
63f66fb7e7 Switch to PM2 for dev + prod 2016-07-07 15:25:45 -07:00