Closed Bug 864530 Opened 11 years ago Closed 11 years ago

Deploy thimble.webmaker.org on AWS

Categories

(Webmaker Graveyard :: DevOps, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jon, Assigned: johns)

References

Details

(Whiteboard: u=dev s=2013w17 p=1)

Tracking bug to deploy the nodejs rewrite of Thimble on AWS. This isn't ready to deploy yet, it still has a hardcoded dependency on sqlite that needs to be fixed up.

Repo: https://github.com/mozilla/thimble.webmaker.org
Config: https://github.com/mozilla/thimble.webmaker.org/blob/master/env.dist
Depends on: 864531
Tagged v0.0.2. This is ready to deploy.
Assignee: jon → johns
I'm seeing an issue with the .env file, not seeming to be picked up when just running node.
Is there an option to set the config file I should be setting?


root@i-2a8fef49:/home/ubuntu# /usr/bin/node /var/www/thimble/app.js

/var/www/thimble/lib/database.js:5
  sequelize = new Sequelize(options.name, options.user, options.password, {
                                   ^
TypeError: Cannot read property 'name' of undefined
    at module.exports (/var/www/thimble/lib/database.js:5:36)
    at Object.<anonymous> (/var/www/thimble/app.js:24:15)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Flags: needinfo?(jon)
Habitat will attempt to load `.env` from the current working directory, so you'll need to change the current working directory before running the process, or inject the environment variables into the environment.
Flags: needinfo?(jon)
Awesome!  Mark as resolved?
Flags: needinfo?
No, there's some config changes that need to be made before it'll work 100%
Flags: needinfo?
Whiteboard: u=dev s=2013w17 → u=dev s=2013w17 p=1
The latest tag had a build issue:

Note: checking out 'v0.0.3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 74c97b8... thimble v0.0.3
v0.0.3
Submodule 'public/friendlycode' () registered for path 'public/friendlycode'
npm http GET https://registry.npmjs.org/async/0.2.7
npm http GET https://registry.npmjs.org/express/3.1.1
npm http GET https://registry.npmjs.org/makeapi/0.0.7
npm http GET https://registry.npmjs.org/mysql/2.0.0
npm http GET https://registry.npmjs.org/sequelize/1.6.0
npm http GET https://registry.npmjs.org/request/2.16.6
npm http GET https://registry.npmjs.org/habitat/0.4.1
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/express-persona/0.0.7
npm http GET https://registry.npmjs.org/nunjucks/0.1.8a
npm http GET https://registry.npmjs.org/sqlite3/2.1.7
npm http GET https://registry.npmjs.org/grunt-contrib-csslint/0.1.2
npm http GET https://registry.npmjs.org/grunt-contrib-jshint/0.4.3
npm http GET https://registry.npmjs.org/htmlsanitizer/0.0.1
npm http 404 https://registry.npmjs.org/mysql/2.0.0
npm WARN optional dep failed, continuing mysql@2.0.0


I note that your updates from v0.0.2...v0.0.3 (https://github.com/mozilla/thimble.webmaker.org/compare/v0.0.2...v0.0.3 ) includes now pinning mysql package to 2.0.0 specifically.  That seems to have broken this build, and causes the app, when trying to start, to throw this:

root@i-d68a8dbc:/var/www/thimble# NODE_ENV="staging" /usr/bin/node /var/www/thimble/app.js

module.js:340
    throw err;
          ^
Error: Cannot find module 'mysql'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/var/www/thimble/app.js:12:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
This is now up:
http://thimble-node.mofostaging.net

A couple to'do's on the way to prod
- [ ] Add this app to New Relic (?)
- [ ] Security review?
- [ ] Load test it a bit
- [ ] Update logging to make it prettier.  RESPONSE_CODE="200" for example
- [ ] Add a health check
- [ ] Add caching?  Do we want CDN, assets loading from somewhere?
- [ ] Do we need sticky sessions?  How are sessions handled?
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.