Commit Graph

40 Commits

Author SHA1 Message Date
Sashko Stubailo
baf410a236 Forgot to return 2015-01-20 22:04:22 -08:00
Sashko Stubailo
e16e051090 Also convert dbPath 2015-01-20 22:04:21 -08:00
Sashko Stubailo
387cc5cb5d Factor out spawning mongod 2015-01-20 22:04:21 -08:00
Sashko Stubailo
2456bf97dc Add mongo fix 2015-01-20 22:03:22 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
21a34a98b3 Show mongod exit message if it started up OK
Fixes "run with mongo crash" test
2014-12-09 19:52:03 -08:00
Ben Newman
ff7863d3e2 Start Mongo in parallel with the build.
For freshly created apps, this commit reduces the time required to start
the development server from 4.6s to 2.5s on my machine.

Not calling findMongoAndKillItDead unless Mongo fails to start shaves off
a few hundred milliseconds, too.

Fixes #3010.
2014-12-02 18:21:36 -05:00
David Glasser
a9a3411703 checkpoint on 'meteor run' 2014-11-25 09:06:17 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
9cab094f18 uniload now works via named "isopackets"
You can only request a named set of packages, not a random assortment.

In future commits, we will pre-build these packages into JsImages and
load them from that. Building packages for uniload will eventually not
involve the .build.foo directories at all.  (All saved packages will be
built in app context, eventually.)
2014-11-07 16:45:57 -08:00
Sashko Stubailo
be8c503760 Rename mongo-livedata to mongo 2014-08-28 11:14:40 -07:00
David Glasser
7d05640ea0 Make buildmessage fiber-aware
Port a simplified version of Meteor.EnvironmentVariable and
Meteor.bindEnvironment to fiber-helpers.js to deal with this.

Identify uses of fiberHelpers.inFiber and switch them to either
fiberHelpers.bindEnvironment (if the callback they are wrapping is
semantically "part of" the context that creates the callback) or
fiberHelpers.inBareFiber (otherwise).

Without this, concurrency was causing the wrong buildmessage message
sets and jobs to be active when builds yielded.
2014-08-04 19:03:05 -07:00
David Glasser
c5e5305a3b Merge branch 'devel' into packaging
Conflicts:
	tools/bundler.js
	tools/packages.js
2014-06-11 12:02:57 -07:00
David Glasser
2e79408658 start up mongo even if 'ps ax' output is >200KB
10MB should really be enough though.

Fixes #2158.
2014-05-23 18:08:13 -07:00
David Glasser
21bc8be7df get error message in 'ps ax' failure case
We still want JSON.stringify too because that includes stuff like the
exit code.

See #2158
2014-05-22 15:43:26 -07:00
David Glasser
9d70ff64c9 springboard almost works
springboarding happens infinitely because of build ids

have to manually bootstrap a tropohouse

fixed some other things:

 - store package server token in correct domain
 - copy files (eg packages pre-publish) with +x flags
 - catalog.getReleaseTrack works
 - don't pass release to uniload (Meteor.release will always
   end up 'UNILOAD')
 - fix building meteor-tool again
 - stop supporting apps without .meteor/release
 - merging unipackages with tools works

springboarding to warehouse releases totally not supported
2014-05-05 19:18:34 -07:00
David Glasser
fbde0a00a7 Merge branch 'publish-packages' into library-refactor
Conflicts:
	packages/domutils/package.js
	packages/handlebars/package.js
	packages/htmljs/package.js
	packages/liverange/package.js
	packages/spark/package.js
	packages/universal-events/package.js
	tools/bundler.js
	tools/help.txt
	tools/packages.js
	tools/run-app.js
	tools/run-mongo.js
	tools/skel/.meteor/packages
2014-04-24 17:01:36 -07:00
David Glasser
1d5da6b439 Add a flag to MongoRunner which runs 3 mongods
This is only intended for testing. No data is preserved from one run to
the next, and if any mongod exits for any reason, the rest are killed;
there is no mongod restarting.

It takes a while (~20 seconds) to start up because it waits for the
replset to be ready.
2014-04-10 16:56:31 -07:00
David Glasser
3405644027 Fix runner.stop() while waiting for file change
Before this, if the runner decided to stop (eg, because mongod is
crashing too much) while waiting for file change, it would crash due to
an attempt to wait within a fiber.  Fixing that bug by adding an inFiber
would then lead to the process just not exiting, because nothing stops
the wait-specific future.
2014-04-02 21:16:59 -07:00
David Glasser
3e76ad7946 Don't use require('./run-log.js').runLog
If you happen to introduce a circular require into the stack, this
object will be undefined.

Instead, hang on to `require('./run-log.js')`, which is the exports
module which does get filled in later.
2014-03-31 19:52:02 -07:00
Geoff Schmidt
688f7b3643 rename unipackage.load to uniload.load 2014-03-13 21:47:12 -07:00
Geoff Schmidt
3f8beb0935 unipackage.load no longer takes a library 2014-03-11 14:42:42 -07:00
David Glasser
2586a50cd0 Refactor RunLog to be a singleton
The rationale: RunLog is an object that is hardcoded around managing two
other singletons: stdout and stderr. Having multiple RunLogs wouldn't
work well without improving RunLog to have the ability to control other
streams.

We'd like to be able to use RunLog from other places in the tool, most
notably from code called from bundler (while running an app) such as the
npm updater. But threading a RunLog object through that code is
difficult (especially as bundling takes a detour through
release.current.library).
2014-02-13 19:11:30 -08:00
David Glasser
408f9c6068 clear mongo timers when shut down 2014-02-11 01:02:50 -08:00
David Glasser
ea6173d1fe MongoRunner.stop() always must set shuttingDown
Previously, if stop() was invoked during the 1-second restart timeout,
it would not stop running.
2014-02-11 01:00:54 -08:00
David Glasser
923887b731 Actually kill the mongod process on stop
Also some comment/style tweaks
2014-02-11 00:48:42 -08:00
David Glasser
132ab0c81b Fix visibility of a listener to remove 2014-02-11 00:44:36 -08:00
David Glasser
9303f6914b add XXX comment about bad mongo urls
Not fixing this, as there is no regression from devel.
2014-02-11 00:35:04 -08:00
David Glasser
4518d8c53b find_underscores_and_kill_them_dead 2014-02-11 00:32:27 -08:00
David Glasser
7c02e4a59d utils.sleep -> utils.sleepMs
multiply one by a thousand
2014-02-04 17:46:19 -08:00
Geoff Schmidt
e1994f6ece First installment of 'meteor run' tests.
Tests meteor --once and restarting on upgrade.
2014-01-29 02:02:17 -08:00
Geoff Schmidt
377d940ba0 fake-mongod, a stub mongod for automated testing 2014-01-28 19:36:04 -08:00
David Glasser
4f5d114771 Don't call onListen more than once
eg, maybe the replset loses and regains its PRIMARY.

(Manually ported to tool-refactoring from devel.)
2014-01-16 10:43:58 -08:00
David Glasser
aa68610b46 Don't leave invalid METEOR-PORT files around
Could cause mongo startup to hang.

Reproduction:

  $ meteor
  => Meteor server running on: http://localhost:3000/
  # ... wait for server to start, ctrl-c.
  # leaves '3002' in .meteor/local/db/METEOR-PORT
  $ meteor -p 5000
  # ctrl-c in about a second: once we've wiped the old local db
  # but before we've configured the new one.
  # before this commit, '3002' is still in the METEOR-PORT file.
  $ meteor
  # before this commit, hangs with:
  Initializing mongo database... this may take a moment.

(Manually ported to tool-refactoring from devel.)
2014-01-16 10:42:54 -08:00
David Glasser
1d39c2fb5e mongo_runner: Don't send rs.initiate too early
Fixes #1696. Thanks to @Maxpain177 for reporting and providing access to
a machine where this was easily reproducible.

(Manually ported to tool-refactoring from devel.)
2014-01-16 10:36:59 -08:00
Geoff Schmidt
be0a11802d Print progress messages on startup. Fix some bugs. 2014-01-07 16:55:58 -08:00
Geoff Schmidt
9813345e15 move runMongoShell to appropriate file. fix some bugs. 2014-01-06 23:30:19 -08:00
Geoff Schmidt
dbe6edf11c read ROOT_URL from environment in commands.js, not runner.js 2014-01-06 22:28:29 -08:00
Geoff Schmidt
4ccfa114c8 read MONGO_URL from environment in commands.js, not run*.js 2014-01-06 22:16:13 -08:00
Geoff Schmidt
088d70da36 runner refactor - WIP (break runner.js up into several files) 2014-01-03 20:36:13 -08:00