Commit graph

3299 commits

Author SHA1 Message Date
Matt Ellis 6a2e20a289 Rename projName to projectName in apitype.Stack
This value was never used before, but it had a shorter name. In other
API Types we are using `projectName` which we all prefer. Since we are
going to start using this value going forward, let's adopt the good
name now when it won't break anyone.
2019-01-14 14:40:00 -08:00
Matt Ellis 732166450e Add projectName member of StackSummary API type
This will allow the service to include information about what project
a stack is assocated with when listing all stacks a user has access
to.

This was not previously needed because the project did not play into
the stack identity, but it will shortly.
2019-01-08 12:52:09 -08:00
Sean Gillespie 8b52e480ed
Implement first-class providers for invokes (#2339)
Invoke in Node.js allows users to optionally pass a parent or a provider
to the invoke, which dictates either explicitly or implicitly which
provider to use when performing an invoke. If a provider is specified
explicitly, that provider is used to perform the invoke. If a parent is
specified, that parent's provider is used to perform the invoke.
2019-01-07 12:53:08 -08:00
Pat Gavlin b85f95acd9
Fix error codes for early exceptions (#2337)
It is possible for the sub-process responsible for running a NodeJS
Pulumi program to exit with a success code before the user's program has
run if the process of loading the runtime generates an unhandled promise
rejection. These changes fix this by registering the unhandled exception
and rejection handlers that are responsible for ensuring a non-zero exit
code in these cases before any other action is taken.

Note that this issue is really only possible because the Node language
host (like the Python language host) is composed of two processes: one
that serves the language host gRPC service and one that loads and runs
the user's program. The former launches the latter in response to a call
to its `Run` gRPC endpoint. The lifetime of the user's program is
considered to be bounded by the lifetime of the `Run` invocation. The
NodeJS process maintains its own connection to the engine over which
resource registrations are communicated. It is tempting to add a message
to the resource monitor RPC interface that signals that no further
registrations are performed, but this is complicated due to the
three-party topology and the possibility that such an RPC may never be
sent (e.g. due to a crash or a downlevel version of the Pulumi Node
runtime).

Fixes #2316.
2019-01-07 09:59:29 -08:00
Matt Ellis 08ed8ad97e
Relax baseline for the TestEngineEventPerf test (#2336)
* Relax baseline for the TestEngineEventPerf test

The mesurments we used to compute the baseline were on a local recent
MacBook. We added some slack, but we've already seen instances of the
baseline being too tight, even with no changes in product code.

This is most common on the OSX machines in Travis, which in general
seem quite slow for many workloads.

We'll bump it up to 8 seconds and if we start hitting that as well,
we'll need to do something more serious.
2019-01-05 23:58:11 -08:00
Sean Gillespie a37b3d89e3
Implement first-class providers for Python (#2335)
* Implement first-class providers for Python

First-class providers are an explicit projection of providers themselves
into Pulumi programs. For the most post, providers are just regular
resources, but the addition of providers to the fray (and the ability of
resources to be constructed by providers in the same program) requires
some changes to the Python resource model.

A summary of the changes:

1. Added ProviderResource, a custom resource that is the base class of
all providers.
2. ResourceOptions now has 'provider' and 'providers' fields.
'provider', when passed to a custom resource, allows users to override
the provider that is used to construct a resource to an instance of a
ProviderResource. 'providers', when passed to a component resource,
allows users to override providers used to construct children of the
component resource.
3. 'protect', 'providers', and 'provider' are all now inherited from
a resource's parent if they aren't specified in the child.

This commit adds the requisite code for the above changes and, in
addition, adds a number of new tests that exercise them and related code
paths.

* Rebase against master
2019-01-04 15:44:27 -08:00
Justin Van Patten 5d3d8c01dd
Add commands for managing stack tags (#2333)
Adds `pulumi stack tag` commands for managing stack tags.
2019-01-04 13:23:47 -08:00
Pat Gavlin 3e65bc6517
Fix TestCanceledRefresh (#2331)
This test had been intermittently failing due to a race condition. Its
implementation of `plugin.Provider.Read` was intended to ensure that
the cancellation of a refresh operation occurred. As written, it was
only able to ensure that the cancellation was requested.

These changes ensure that cancellation has been acknowledged by the engine by
implementing providing an implementation for `plugin.Provider.Cancel`
that closes a channel on which the implementation of `Read` waits.
2019-01-03 19:40:07 -08:00
Pat Gavlin 1a651ab0e0
Always read StackReference resources (#2332)
This is something of a quick hack to work around the limitations that
are at the root of #2310. In short, `StackReference` resources do not
change during a update because their inputs have not changed and we do
not refresh resources as part of the update by default. We want
`StackReference` to remain a resource for myriad reasons (not the least
of which is to avoid a breaking change), but it does seem correct for it
to refresh its state during each update. Because there is no actual CRUD
operation associated with a `StackReferece`, we can obtain this behavior
by changing the implementation of its ctor in the various SDKs s.t. its
options bag always contains an appropriate `id`, thus indicating a
`Read`.

Fixes #2310.
2019-01-03 16:06:21 -08:00
Chris Smith 5619fbce49
Add EngineEvents perf test (#2315)
* Add EngineEvents stress test

* Address PR feedback

* Specify value to config bag

* Don't test run in parallel
2019-01-03 14:18:19 -08:00
CyrusNajmabadi 87e5a441f5
Convert resource to pojo objects when used as stack outputs. (#2311) 2019-01-03 10:03:11 -08:00
Chris Smith f49fb626bb
Run 'dep ensure --update github.com/uber/jaeger-client-go' (#2329) 2019-01-02 11:19:07 -08:00
Justin Van Patten ea3b681a54
Link directly to /account/tokens (#2328)
We're changing /account to redirect to /account/profile instead of
/account/tokens as the user profile settings are a more natural place
to land when going into account settings.

This commit changes the CLI to link
directly to /account/tokens, avoiding having to click on
"Access Tokens" to go to the tokens page to get an access token when
coming from the URL outputted by the CLI.
2018-12-28 18:06:03 -05:00
Matt Ellis fc14d50359 Update CHANGELOG.md for 0.16.9 release 2018-12-24 20:41:44 -08:00
Chris Smith c189a49172
Wait until all EEs are recorded after CancelEvent (#2325)
When returning immediately from the loop, we are closing the `done` channel early. This signals that we have finished processing every engine event, however that isn't true. Since some events may still be in-flight in `recordEngineEvent`. (This could potentially lead to a race condition in the `diag.Sink` passed to the API client used to record the call.)
2018-12-24 10:23:32 -08:00
Matt Ellis 3ef40c6ba6 Update CHANGELOG.md
Add in some fixes and features that were missing from `CHANGELOG.md`
2018-12-24 09:56:31 -08:00
Chris Smith 3045236dec
Record engine events concurrently (#2314)
* Record engine events concurrently

* Drop errors recording engine events
2018-12-20 15:34:30 -08:00
CyrusNajmabadi c3c51e6ea7
Don't record reads as changes during updates unless something actually changed. (#2308) 2018-12-19 13:19:56 -08:00
CyrusNajmabadi f7e6368218
During preview, don't record reads if they didn't actually result in any property changes. (#2305) 2018-12-18 16:33:13 -08:00
Pat Gavlin 24f89e1121
Close plugin context on plan creation failure (#2304)
This ensures that the gRPC server is properly shut down. This fixes an
issue in which a resource plugin that is still configuring could report
log messages to the plugin host, which would in turn attempt to send
diagnostic packets over a closed channel, causing a panic.

Fixes #2170.
2018-12-18 13:25:52 -08:00
Sean Gillespie 81c0de1e4e
Add 'Output.all' combinator for Python (#2293)
* Add 'Output.all' combinator for Python

Output.all is a useful combinator that we already have in Node that
allows the composition of a list of outputs into an output of a list.
This is very useful when authoring components and its lack of presence
in Python was an oversight.

This commit adds 'Output.all' and 'Output.from_input', adding tests and
documentation for each.

* start unwrap

* Add functionality and test for nested inputs
2018-12-18 13:22:04 -08:00
CyrusNajmabadi e86ea70ea0
Force rebuild of htis package to wipe out previously published 'dev' package. (#2300) 2018-12-17 16:00:31 -08:00
Matt Ellis d6a8fd6189
Merge pull request #2294 from pulumi/ellismg/merge-v-0-16-8-to-master
Merge v0.16.8 into master
2018-12-17 10:59:55 -08:00
CyrusNajmabadi 7e7544e27e
Revert https://github.com/pulumi/pulumi/pull/2281 (#2297) 2018-12-15 21:04:53 -08:00
CyrusNajmabadi 2d92b516b2
Do not pass component resource properties to the engine. (#2296) 2018-12-15 15:32:19 -08:00
Matt Ellis b03c48e852 Merge v0.16.8 into master 2018-12-14 15:32:48 -08:00
Matt Ellis d2bd696d15 Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.

(cherry picked from commit ded3882afd)
2018-12-14 14:19:01 -08:00
Pat Gavlin ded3882afd
Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.
2018-12-13 19:58:26 -08:00
Matt Ellis 89f862e74e Update webhook notification endpoint
The app for our build notification was re-deployed an its URL changed. This adopts the new endpoint
2018-12-12 13:24:52 -08:00
CyrusNajmabadi b94cfb22d5
Handle cycles in component resources more simply. (#2283) 2018-12-11 13:42:49 -08:00
CyrusNajmabadi 05f5311055
Prevent cycles when serializing props. (#2281) 2018-12-10 14:31:54 -08:00
Matt Ellis 59a54f1802
Add --stack argument to a few missing commands (#2278)
As of this change, all of the stack specific commands for `pulumi` now
allow passing `--stack` to operate on a different stack from the
default one.

Fixes #1648
2018-12-10 10:10:43 -08:00
Matt Ellis ad78f3ef59 Improve error message when Pulumi.yaml can't be found
Fixes #2234
2018-12-06 14:04:01 -08:00
Matt Ellis 7b74f3b1be Update CHANGELOG.md for v0.16.7 2018-12-05 14:32:32 -08:00
Matt Ellis d7575072f2 Do not use relative path when launching dynamic provider
Previously, we assumed that the dynamic provider was located in
`./node_modules/@pulumi/pulumi/../` which is correct in the majority
of cases. However, tools like lerna or yarn workspaces (or custom
workflows) allow the node_modules folder to be located elsewhere on
disk, and node will still find it because of its algorithm for module
resolution.

So, do what we do in the language host itself, first launch node and
ask it to tell us where it resolves a require statement to on disk and
then launch node against that script.

Fixes #2261
2018-12-05 13:45:06 -08:00
Pat Gavlin 663e5342b0
Inherit custom resource providers (#2264)
If a custom resource has explicitly specified a provider, add that
provider to the resource's provider map under the resource's package.
This allows children of the custom resource to inherit the resource's
provider.

Fixes #2262.
2018-12-05 12:35:19 -08:00
Matt Ellis 01d58ad7e4 Fix +dirty tag on Windows for tagged versions
The logic to append the `+dirty` tag to a generated version on Windows
was incorrect in the case where we were producing a version for a
tagged build. In that case we would append `+dirty` when the work tree
was clean and not append it when it was dirty.
2018-12-05 11:11:43 -08:00
Matt Ellis bb1fa36a47
Enable ANSI colorization in Windows terminal (#2269)
Before the windows console will understand ANSI colorization codes the
terminal must be put in a special mode by passing
ENABLE_VIRTUAL_TERMINAL_PROCESSING to SetConsoleMode. This was
happening as a side effect of term.StdStreams() from a docker package,
which we did before displaying the update data. However, any
colorization done before that call would just show the raw ANSI escape
codes.

Call this helper much earlier (i.e. as soon as the CLI starts up) so
any messages that we print will have the correct colorization applied
to them.

Fixes #2214
2018-12-04 16:58:32 -08:00
Chris Smith 84ea2f0df7
Don't emit pre-rendered update logs (#2268)
* Don't emit pre-rendered update logs

* Retry posting engine events if needed

* Update comment
2018-12-04 14:46:32 -08:00
Matt Ellis f3fbc1d9ee Do not disable echo when stdin is not a terminal
When reading values like access keys or secrets from the terminal, we
would use the `terminal.ReadPassword` function to ensure characters
the user typed were not echo'd back to the console, as a convience.

When standard input was not connected to a tty (which would happen in
some cases like in docker when -t was not passed or in CI), this would
fail with an error about an bad ioctl. Update our logic such that
when standard in is not connected to a terminal, we just read input
normally.

While I was in the area, I unified the code for Windows and *NIX for
these functions.

Fixes #2017
2018-12-03 16:40:51 -08:00
Luke Hoban d9f37e6667
Add Roadmap to README (#2271) 2018-12-03 16:31:49 -08:00
Chris Smith 71375fe47e
Record engine events by default (#2256) 2018-12-03 08:25:58 -08:00
CyrusNajmabadi ca8169e344
Use 'output<...>' as our terminology for 'computed' properties. (#2267) 2018-12-02 19:44:50 -08:00
CyrusNajmabadi d93e930856
Provide an actual 'table' printing routine so that we can appropriate choose columns widths dynamically. (#2266) 2018-12-02 00:22:07 -08:00
Pat Gavlin 9c5526e7dd
Add a --config-file option for stack ops (#2258)
This option allows the user to override the file used to fetch and store
configuration information for a stack. It is available for the config,
destroy, logs, preview, refresh, and up commands.

Note that this option is not persistent: if it is not specified, the
stack's default configuration will be used. If an alternate config file
is used exclusively for a stack, it must be specified to all commands
that interact with that stack.

This option can be used to share plaintext configuration across multiple
stacks. It cannot be used to share secret configuration, as secrets are
associated with a particular stack and cannot be decryptex by other
stacks.
2018-11-30 15:11:05 -08:00
Chris Smith 55bea65276
Fix error when canceling update (#2254)
* Fix error when canceling update

* Update error message
2018-11-29 12:54:05 -08:00
Pat Gavlin 95db6439f5
Add stackReference.ts to tsconfig.json (#2253)
Otherwise this file is not picked up by typedoc.
2018-11-29 10:27:29 -08:00
CyrusNajmabadi e53f746c35
Export our 'unwrap' types so that downstream packages can create combinators that TS will accept. (#2252) 2018-11-28 13:33:33 -08:00
CyrusNajmabadi af9671a4dd
Add test helper function. (#2251) 2018-11-28 11:46:10 -08:00
Pat Gavlin 3e913d2577
Update changelog (#2250)
Stamp in release info for 0.16.6.
2018-11-28 10:02:13 -08:00