Commit graph

1618 commits

Author SHA1 Message Date
Matthew Riley 80364ac68d Publish builds for topic branches
Use $TRAVIS_BRANCH to name published artifact
2017-09-21 17:08:41 -07:00
Matt Ellis f87e4f5880 Merge pull request #355 from pulumi/windows-fixes
Windows fixes
2017-09-21 15:32:03 -07:00
Matt Ellis 5470418bea Disable ANSI Coloring on Windows
While these codes can be understood on newer versions of Windows 10 (if
we were to set the console properties correctly) in general they do not
work and cause garbage to be printed to the screen.  For now, just don't
colorize output on Windows.
2017-09-21 15:15:32 -07:00
joeduffy dcdf780b09 Move after_script steps to script so they fail fast
See https://blog.travis-ci.com/after_script_behavior_changes/.
2017-09-21 15:02:31 -07:00
Joe Duffy 5e3f8041bc Adopt new pulumi/home repo name 2017-09-21 14:09:35 -07:00
Matt Ellis fcc81bac24 Fix nativeruntime module build on Windows
There were two problems:

- node-gyp configure was failing because of different shell syntax
between windows and *nix.
- MSVC 2015 is not smart enough to understand our use of strlen actually
results in a constant value and prevents us from using it to create an
array, move to a macro based solution.
2017-09-21 11:49:03 -07:00
Matt Ellis 25ae463915 Listen only on 127.0.0.1
Instead of binding on 0.0.0.0 (which will listen on every interface)
let's only listen on localhost. On windows, this both makes the
connection Just Work and also prevents the Windows Firewall from
blocking the listen (and displaying UI saying it has blocked an
application and asking if the user should allow it)
2017-09-21 10:56:45 -07:00
joeduffy 1c2c972d37 Add back Computed<T> as a short-hand
This adds back Computed<T> as a short-hand for Promise<T | undefined>.
Subtly, all resource properties need to permit undefined flowing through
during planning  Rather than forcing the long-hand version, which is easy
to forget, we'll keep the convention of preferring Computed<T>.  It's
just a typedef and the runtime type is just a Promise.
2017-09-20 09:59:32 -07:00
joeduffy f8ee6c570e Eliminate Computed/Property in favor of Promises
As part of pulumi/pulumi-fabric#331, we've been exploring just using
undefined to indicate that a property value is absent during planning.
We also considered blocking the message loop to simplify the overall
programming model, so that all asynchrony is hidden.

It turns out ThereBeDragons 🐲 anytime you try to block the
message loop.  So, we aren't quite sure about that bit.

But the part we are convicted about is that this Computed/Property
model is far too complex.  Furthermore, it's very close to promises, and
yet frustratingly so far away.  Indeed, the original thinking in
pulumi/pulumi-fabric#271 was simply to use promises, but we wanted to
encourage dataflow styles, rather than control flow.  But we muddied up
our thinking by worrying about awaiting a promise that would never resolve.

It turns out we can achieve a middle ground: resolve planning promises to
undefined, so that they don't lead to hangs, but still use promises so
that asynchrony is explicit in the system.  This also avoids blocking the
message loop.  Who knows, this may actually be a fine final destination.
2017-09-20 09:59:32 -07:00
Pat Gavlin 4b9d933415 Merge pull request #343 from pgavlin/PathCommand
Early-out integration tests if PATH is incorrect.
2017-09-18 15:16:30 -07:00
Pat Gavlin c8f315227f Early-out integration tests if PATH is incorrect.
This provides a friendlier experience if the nodejs language service is
not on the path. Also, print a helpful message at the end of
`make configure` if PATH has not yet been setup.
2017-09-18 13:06:59 -07:00
joeduffy 22387d24cd Switch to a --parallel=P flag
This change flips the polarity on parallelism: rather than having a
--serialize flag, we will have a --parallel=P flag, and by default
we will shut off parallelism.  We aren't benefiting from it at the
moment (until we implement pulumi/pulumi-fabric#106), and there are
more hidden dependencies in places like AWS Lambdas and Permissions
than I had realized.  We may revisit the default, but this allows
us to bite off the messiness of dependsOn only when we benefit from
it.  And in any case, the --parallel=P capability will be useful.
2017-09-17 08:10:46 -07:00
joeduffy 087deb7643 Add optional dependsOn to Resource constructors
This change adds an optiona dependsOn parameter to Resource constructors,
to "force" a fake dependency between resources.  We have an extremely strong
desire to resort to using this only in unusual cases -- and instead rely
on the natural dependency DAG based on properties -- but experience in other
resource provisioning frameworks tells us that we're likely to need this in
the general case.  Indeed, we've already encountered the need in AWS's
API Gateway resources... and I suspect we'll run into more especially as we
tackle non-serverless resources like EC2 Instances, where "ambient"
dependencies are far more commonplace.

This also makes parallelism the default mode of operation, and we have a
new --serialize flag that can be used to suppress this default behavior.
Full disclosure: I expect this to become more Make-like, i.e. -j 8, where
you can specify the precise width of parallelism, when we tackle
pulumi/pulumi-fabric#106.  I also think there's a good chance we will flip
the default, so that serial execution is the default, so that developers
who don't benefit from the parallelism don't need to worry about dependsOn
in awkward ways.  This tends to be the way most tools (like Make) operate.

This fixes pulumi/pulumi-fabric#335.
2017-09-15 16:38:52 -07:00
joeduffy 016adec9f7 Allow unknowns in defaults
The "defaults" may include computed values, so we should pass
AllowUnknowns as true during unmarshaling of Check calls.
2017-09-15 09:56:42 -07:00
joeduffy 5b779798c4 Fix (don't torch) LUMIDL
This change finishes the conversion of LUMIDL over to the new
runtime model, with the appropriate code generation changes.

It turns out the old model actually had a flaw in it anyway that we
simply didn't hit because we hadn't been stressing output properties
nearly as much as the new model does.  This resulted in needing to
plumb the rejection (or allowance) of computed properties more
deeply into the resource property marshaling/unmarshaling logic.

As of these changes, I can run the GitHub provider again locally.

This change fixes pulumi/pulumi-fabric#332.
2017-09-14 16:40:44 -07:00
joeduffy 94207acf65 Upgrade to TypeScript ^2.5.2 2017-09-14 15:02:41 -07:00
joeduffy 2a30a0f5f0 Don't redundantly make configure twice 2017-09-14 14:33:33 -07:00
joeduffy a5706e0662 Update the gocover commands 2017-09-13 18:52:06 -07:00
joeduffy ba67a72d88 Eliminate unused envvar 2017-09-12 06:53:42 -07:00
joeduffy 324d3dad85 Generate module names with file parts 2017-09-11 17:08:41 -07:00
joeduffy 9c7f6b678c Bring LUMIDL up to code
This gets LUMIDL to generate code in the new way.
2017-09-11 16:58:25 -07:00
joeduffy 791b90aa33 Swap sdk / nodejs 2017-09-11 15:34:06 -07:00
joeduffy 2ef6b89b82 Add one-time Travis make configure in build dir 2017-09-11 15:30:42 -07:00
joeduffy 4c781da93b Add instructions for make configure
And also move the Node.js SDK-specific parts into the sdk/nodejs/ directory.
2017-09-11 15:17:11 -07:00
joeduffy ac786ed2c9 Clean up the READMEs 2017-09-11 13:18:09 -07:00
Luke Hoban 4704ac75fc Use curl instead of wget
Since wget is not installed by default on MacOS.
2017-09-11 09:33:54 -07:00
joeduffy 353b25205a Make install scripts part of the fabric LKG 2017-09-10 20:23:11 -07:00
joeduffy cf7ba79f81 Skip __awaiter this captures 2017-09-10 09:22:04 -07:00
joeduffy 443e1b9053 Use hasOwnProperty in case e.json is undefined 2017-09-10 08:24:02 -07:00
joeduffy 8ce07617c9 Implement recursive closure captures
This change implements recursive closure captures.  This permits
cases like the following

    {
        function f() { g(); }
        function g() { f(); }
    }

and the slightly more useful

    class C {
        this.x = 42;
        this.f = () => x;
    }

To do this requires caching the environment objects and permitting
cycles in the resulting environment graph.  The closure emitter code
already knows how to handle this.

In addition, we must mark captures of `this` as free variables.

This resolves pulumi/pulumi-fabric#333.
2017-09-10 07:40:53 -07:00
joeduffy 07f2c92c84 Add a custom unhandled promise error handler 2017-09-09 18:10:13 -07:00
joeduffy 1a64fc4bf3 Keepalive the RPC client until logs finish
This ensures RPC channels stay alive until logs finish.  It also
makes provisions for logs that come in *after* shutdown has begun,
but before it has finished, by observing that the keepalive promise
has changed between the time of initiating the callback and running it.
2017-09-09 14:09:21 -07:00
joeduffy 871943abfc Dial back the debug output slightly 2017-09-09 13:49:50 -07:00
joeduffy f9995159c6 Fix a handful of things, mostly logging
* Initialize the diganostics logger with opts.Debug when doing
  a Deploy, like we do Plan.

* Don't spew leaked promises if there were Log.errors.

* Serialize logging RPC calls so that they can't appear out of order.

* Print stack traces in more places and, in particular, remember
  the original context for any errors that may occur asynchronously,
  like resource registration and calls to mapValue.

* Include origin stack traces generally in more error messages.

* Add some more mapValue test cases.

* Only undefined-propagate mapValue values during dry-runs.
2017-09-09 13:43:51 -07:00
joeduffy f74e9e04bd Ensure we fail during deploys
If an error gets emitted during a deployment, we should fail.
This also reenables colors that seems to have gotten lost somewhere.
2017-09-09 12:42:04 -07:00
joeduffy f75b465052 Add some contextual error information 2017-09-09 11:19:35 -07:00
joeduffy 0147d487bd Serialize all resource operations
This change serializes all resource operations.  Please see
pulumi/pulumi#335 for more details.  In a nutshell, there are
resources that have implicit hidden dependencies and now that
the runtime is fully asynchronous, we are tripping over problems
left and right (even worse, they are non-deterministic).  All
of the problems have been in the AWS API Gateway resources;
until we come up with a holistic solution here, serializing all
calls should make things more stable in the interim.
2017-09-09 10:32:25 -07:00
joeduffy 8aba3aae12 Upgrade gRPC to 1.6.0; use full addresses
This change upgrades gRPC to 1.6.0 to pick up a few bug fixes.

We also use the full address for gRPC endpoints, including the
interface name, as otherwise we pick the wrong interface on Linux.
2017-09-09 07:37:10 -07:00
joeduffy 67e5750742 Fix a bunch of Linux issues
There's a fair bit of clean up in here, but the meat is:

* Allocate the language runtime gRPC client connection on the
  goroutine that will use it; this eliminates race conditions.

* The biggie: there *appears* to be a bug in gRPC's implementation
  on Linux, where it doesn't implement WaitForReady properly.  The
  behavior I'm observing is that RPC calls will not retry as they
  are supposed to, but will instead spuriously fail during the RPC
  startup.  To work around this, I've added manual retry logic in
  the shared plugin creation function so that we won't even try
  to use the client connection until it is in a well-known state.
  pulumi/pulumi-fabric#337 tracks getting to the bottom of this and,
  ideally, removing the work around.

The other minor things are:

* Separate run.js into its own module, so it doesn't include
  index.js and do a bunch of random stuff it shouldn't be doing.

* Allow run.js to be invoked without a --monitor.  This makes
  testing just the run part of invocation easier (including
  config, which turned out to be super useful as I was debugging).

* Tidy up some messages.
2017-09-08 15:11:09 -07:00
joeduffy 13df916cfe Put the Node.js SDK bin/ on $PATH for Travis 2017-09-08 06:19:22 -07:00
joeduffy 6aae028768 Move language host into bin/ 2017-09-08 06:13:09 -07:00
joeduffy 527aee7b15 Clone pulumi 2017-09-07 21:52:58 -07:00
joeduffy f3088149ec Make scripts agnostic to pwd 2017-09-07 21:29:50 -07:00
joeduffy 8180914f83 Don't keep the message loop alive during logging 2017-09-07 21:14:29 -07:00
joeduffy 4e96400c9e Only print leaks on successful exits 2017-09-07 15:19:08 -07:00
joeduffy ebc3bf1dd0 Reap the language host process 2017-09-07 15:03:48 -07:00
joeduffy a5a6c79925 Keep RPC connections alive for as long as we need them
The change to tear down RPC connections after the program exits --
to fix problems on Linux presumably due to the way libuv is implemented --
unfortunately introduces nondeterminism and overzealous termination that
can happen at inopportune times.  Instead, we need to wait for the current
RPC queue to drain.  To fix this, we'll maintain a list of currently active
RPC calls and, only once they have completed, will we close the clients.
2017-09-07 14:50:17 -07:00
joeduffy c6b626899b Flatten the Node.js SDK release structure 2017-09-07 14:33:00 -07:00
joeduffy 88a87569f5 Link the bin/ directory
This moves us closer to what we'll have with real NPM packages.
2017-09-07 12:43:12 -07:00
joeduffy b23338d4d1 Disconnect from the host/engine properly 2017-09-07 12:33:43 -07:00