Commit Graph

96 Commits

Author SHA1 Message Date
Ben Newman
647f13cabb Only require a ctl program when deploying to Galaxy. 2014-10-14 18:32:59 -04:00
Sashko Stubailo
3189a364e9 Rename livedata to ddp, meteor test-packages passes 2014-08-28 12:53:34 -07:00
Emily Stark
81a0a0c7e2 Update to new package stats format 2014-08-21 18:23:38 -07:00
David Glasser
9054effdeb Fix ServiceConnection DDP negotiation
Now ServiceConnection's guarantee is that once a DDP connection is
successfully negotiated, it won't restart. This relies on the assumption
that the only use of reconnect({_force: true}) is DDP protocol
negotiation!

Drop some unnecessary (and flawed, for this application) `disconnect`
stream events.

Also, remove some unnecessary `new` calls.

Fixes 'meteor mongo some-galaxy app'.
2014-08-18 17:09:04 -07:00
David Glasser
08a6fa99fd Don't use _.once or instanceof with uniload
_.once has the problem that if you call the once'd function while it is
still in progress (re-entrantly or in another Fiber), it returns
undefined immediately.  That's bad for uniload! uniload already has a
cache, so just use that.  (In the future, perhaps detect an attempt to
uniload something that's currently in the process of being uniloaded in
another fiber and block until the other fiber is ready.)

Using instanceof with things you've uniloaded is a little sketchy: maybe
two different uniload calls will end up with two different copies of
Package.meteor.Meteor.Error, and it seems kind of hairy to ensure you're
not mixing and matching copies.  However, Meteor.Errors are all tagged
with a string errorType, which fills me with much less fear,
uncertainty, and doubt than instanceof.
2014-08-17 23:37:38 -07:00
David Glasser
acd5e0b04c remove deprecated release option from uniload.load 2014-08-17 23:33:06 -07:00
David Glasser
3b3e8d7b93 Simplify ServiceConnection.
- ServiceConnection should never try to reconnect. It's already the case
  that we don't hold open ServiceConnections over long periods while
  idle; it makes the class much simpler if it corresponds to a single
  TCP connection. This also means that as soon as we have one connection
  failure (eg you're offline) we can fail instantly instead of retrying
  pointlessly.

- Drop the explicit timeout code in ServiceConnection. There's already
  timeout handling in stream_client, and now that we don't retry, it
  actually takes effect.

- Be more rigorous about uses of Future in ServiceConnection. Ensure
  that each Future is only used once (ie, avoid "Future resolved more
  than once" errors).  Hopefully fixes #2390.

- ServiceConnection constructor now blocks until it's connected (and
  throws if there's a connection failure).  Maybe this introduces a tiny
  bit more latency to the connection, but it makes it much easier to
  handle errors properly.

- In packageClient.handlePackageServerConnectionError, show the error
  message corresponding to the connection failure.

- In Node, the (newish) error passed to the Stream callback is now a
  "DDP.ConnectionError" object. We can detect this in the tool (and we
  don't even need to do some complex uniload/instanceof dance, since
  error classes made with Meteor.makeErrorType label themselves with a
  string errorType).  We also no longer have a special
  ServiceConnection.ConnectionTimeoutError.
2014-08-17 21:34:57 -07:00
David Glasser
b6955a3899 Move towards non-singleton catalog.complete
We're going to make uniload use a different flavor of "complete" catalog
soon.  So we need to reduce the number of singleton-ish references to
it.

Also, we need one PackageCache per catalog, so stop it from being a
singleton too.
2014-08-13 18:11:46 -07:00
Avital Oliver
aff7dfdb50 Record package usage on meteor bundle
Also eliminated arguments that weren't used anywhere,
and removed an XXX comment that was false (recordPackages
doesn't use buildmessage to report connection failures)
2014-08-13 13:57:08 -07:00
David Glasser
4d1f7b58d0 missing newline 2014-08-08 00:30:36 -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
06a7dc90b5 Add many buildmessage.capture/assertInCapture
Moving towards a world where all things that might invoke buildmessage.error are
encouraged to be in a buildmessage.capture.

This commit is the answer to the question "how many small changes need to be
made to add buildmessage.assertInCapture to PackageCache.loadPackageAtPath?"

Next steps include:
 - Making catalog.resolveConstraints ALWAYS buildmessage.assertInCapture
   (not just when ignoreProjectDeps isn't passed)
 - Then changing resolveConstraints to complain using buildmessage
 - Removing the process.exit(1) in _ensureDepsUpToDate
 - Adding a more structured way to ensure that most commands
   call _ensureDepsUpToDate at an unsurprising location
2014-07-30 22:16:21 -07:00
David Glasser
ddba5d4a3f Never copy dev bundle node_modules into bundle
symlink as a special case for runner only

future commits on this branch will add a
package.json/npm-shrinkwrap.json that can be used by "meteor bundle"
users
2014-07-01 14:09:44 -07:00
Avital Oliver
600ae65304 Don't print errors on stream level failures, and a little reorg
In particular, this becomes especially important with packaging
since we ping the server with a DDP connection every time you
run an app. Multiple times actually.

So now there's no ECONN error messages printed
2014-06-16 16:33:07 -07:00
ekatek
1cf0655da4 Bundler should not take appDir and loader as arguments anymore 2014-05-30 18:32:49 -07:00
ekatek
6f3504a2d3 project refactoring, wip 1 2014-05-21 15:42:12 -07:00
Emily Stark
4997d57b5b Report package usage on bundle and deploy 2014-05-12 11:02:49 -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
Emily Stark
4368309b3f Factor out ServiceConnection 2014-03-25 10:04:42 -07:00
ekatek
4f84ac57ba add in ctl hack and factor out project package loader 2014-03-18 16:24:45 -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
Emily Stark
9c1dc8782c Clean up ServiceConnection timer when we receive a result.
Previously, we could make a connection, do some method calls, and then
10 seconds later the connection happens to be dropped and the connection
timer fires, which not only throws an unexpected error into the future,
but also resolves the future twice. I think ServiceConnection is just
supposed to time out if you don't hear anything from the server within
10 seconds, so it now no longer times out if you hear things from the
server but then happen to be not connected when 10 seconds has elapsed.
2014-02-27 08:09:31 -08:00
Emily Stark
bc4524b544 Set up onReconnect after initial sub on the connection to log-reader.
If we set it up before `subscribeAndWait` returns, then we'll end up
with two subscriptions; we don't have the log-reader sub yet, so we
can't stop it when `onReconnect` runs the first time, so we end up with
a redundant subscription. This means that if a real reconnect happens
later, we'll stop the sub that we set up inside `onReconnect`, but not
the initial sub, so we've leaked a sub and end up with duplicate
messages after reconnect.
2014-02-27 07:56:36 -08:00
Emily Stark
9d5782b9a0 Return the sub from ServiceConnection.subscribeAndWait 2014-02-27 07:56:19 -08:00
Emily Stark
35c1a5fc45 Replace subscribeAndWait with subscribe inside onReconnect 2014-02-26 23:57:18 -08:00
Emily Stark
825082b3a8 Add missing semicolon in deploy-galaxy 2014-02-26 23:49:18 -08:00
Emily Stark
d6f04ba5dd Fix exceptions in galaxy deploy 2014-02-22 17:45:24 -08:00
Geoff Schmidt
31b387b775 fixed for 'meteor logs' on a galaxy 2014-02-19 12:34:08 -08:00
Geoff Schmidt
b940e06006 make getSettings report problems cleanly
(using buildmessages rather exceptions)
2014-01-08 17:18:32 -08:00
Geoff Schmidt
054ab2da94 Eliminate last process.exit call!
(other than main.js and tests, where it's OK)
2014-01-07 23:50:25 -08:00
Geoff Schmidt
a1decc47af eliminate process.exit calls in deploy.js 2014-01-07 19:04:48 -08:00
Geoff Schmidt
04b2957670 better error handling in deploy-galaxy.js 2014-01-07 18:52:59 -08:00
Geoff Schmidt
608123d886 runner refactor - WIP (factor out AppRunner, Updater) 2014-01-02 11:26:51 -08:00
Geoff Schmidt
95e3959165 The period goes outside the parens (like this).
(Except when the parenthetical is a complete sentence.)
2013-12-30 06:20:49 -08:00
Geoff Schmidt
4fc8c0d1f3 Eliminate context everywhere!!
Add release.js to manage current release.
2013-12-30 05:16:21 -08:00
Geoff Schmidt
5e4607badb big refactor of command handling. only superficially tested. 2013-12-29 06:04:42 -08:00
Geoff Schmidt
15730a89ce Merge branch 'refs/heads/sso' into sso2
Conflicts:
	tools/auth.js
2013-12-12 17:40:49 -08:00
Emily Stark
71fbcb4f28 Fix call to DDP.connect with cookie header 2013-12-10 17:01:13 -08:00
Emily Stark
740e0ff1a0 Allow galaxy discovery urls to have https:// already 2013-12-10 16:54:24 -08:00
Geoff Schmidt
a74e351705 centralize service configuration 2013-12-06 19:10:15 -08:00
Emily Stark
cd6770eb81 Remove ssh tunnel code from meteor tool 2013-12-03 08:56:37 -08:00
Emily Stark
6d82b723cf Replace ssh tunnel deploy with cookie-based auth. 2013-11-08 10:29:40 -08:00
Naomi Seyfer
7994ccc1a8 Push the star manifest to galaxy on star upload 2013-10-31 18:08:56 -07:00
Nick Martin
3177d9ad41 Use http_proxy environment variable so meteor update and deploy work behind an http proxy. 2013-09-27 15:06:43 -07:00
Emily Stark
bc815ac5e7 Remove unused mongo-livedata package for deploy-galaxy.
mongo-livedata uses galaxy package, which has a connection to galaxy that
doesn't get closed, which leads to commands hanging. We should probably have a
way to close galaxy's connection, but for now removing mongo-livedata at least
stops commands from hanging.
2013-08-14 17:46:23 -07:00
Naomi Seyfer
3df06fc1b9 Re-allow the BIND_IP env var to affect things. Put settings in the right place. 2013-08-14 17:46:23 -07:00
Emily Stark
cd8248cb33 Comment about why we don't connect to galaxy before bundling 2013-08-12 14:35:29 -07:00
Emily Stark
ca067ad816 Connect to galaxy for deploys only after bundling is done.
The connection was timing out during the bundle process (the setTimeout callback
was being enqueued before the connect event fired).
2013-08-07 18:38:57 -07:00
Emily Stark
c74e969892 Move delete app logic into galaxy 2013-07-29 10:16:56 -07:00