Commit graph

2599 commits

Author SHA1 Message Date
Matt Ellis fcefbcb0b8 Remove test token
We now handle test credentials via Travis, so we don't need this
anymore.
2018-05-04 18:02:25 -07:00
Pat Gavlin 2d6579acee
Enhance the engine's tracing support a bit. (#1328)
- Allow callers to provide a parent span for the engine's operations
- Tag each plan context with the name of its associated operation
2018-05-04 17:01:35 -07:00
Joe Duffy f92eb0a4e8 Run Configure calls in parallel (#1321)
As of this change, the engine will run all Configure calls in parallel.
This improves startup performance, since otherwise, we would block
waiting for all plugins to be configured before proceeding to run a
program.  Emperically, this is about 1.5-2s for AWS programs, and
manifests as a delay between the purple "Previewing update of stack"
being printed, and the corresponding grey "Previewing update" message.

This is done simply by using a Goroutine for Configure, and making sure
to synchronize on all actual CRUD operations.  I toyed with using double
checked locking to eliminate lock acquisitions -- something we may want
to consider as we add more fine-grained parallelism -- however, I've
kept it simple to avoid all the otherwise implied memory model woes.

I made the judgment call that GetPluginInfo may proceed before
Configure has settled.  (Otherwise, we'd immediately call it and block
after loading the plugin, obviating the parallelism benefits.)  I also
made the judgment call to do this in the engine, after flip flopping
several times about possibly making it a provider's own decision.
2018-05-04 14:29:47 -07:00
Pat Gavlin c3e4654507
Merge pull request #1322 from pulumi/FixTypo
Fix a typo.
2018-05-04 13:59:04 -07:00
Pat Gavlin a8b41c2324 Fix a typo. 2018-05-04 13:09:35 -07:00
Pat Gavlin 5e672564ef
Use git for detecting a dirty worktree. (#1319)
The `go-git` implementation of `git status` is outrageously expensive,
as it performs a hash-based comparision of the working tree against the
committed state with no caching. In some example runs, this takes
upwards of 15 seconds. Because this is on the startup path for updates,
this results in a rather poor user experience.

These changes replace the `go-git` implementation with a call to `git
status --porcelain -z`, which only writes data to stdout if the working
tree is dirty.

Note that these changes also make all git-related update metadata
best-effort.
2018-05-04 12:59:48 -07:00
Pat Gavlin ded25b11db
Add support for CPU and heap profiling. (#1318)
These changes add a new flag to the CLI, `--profiling`, that enables
CPU and heap profiling as well as execution tracing of the CLI itself.
The argument to this flag serves as a prefix for the profile outputs;
the CPU and heap profiles and execution trace are written to
`[filename].[pid].{cpu,mem,trace}`, respectively.

These changes also fix an issue with `cmdutil.RunFunc` wherein any error
would prevent the command's post-run hooks from executing.
2018-05-04 11:26:53 -07:00
Pat Gavlin 4f3d236606
Merge pull request #1317 from pulumi/IntegrationTestTracing
Enable tracing of integration tests.
2018-05-03 14:07:29 -07:00
Pat Gavlin c0ed11af14 Enable tracing of integration tests.
These changes add a new option to the integration test framework that
allows the specification of a tracing endpoint for Pulumi invocations.
2018-05-03 13:44:21 -07:00
CyrusNajmabadi 5387e78cfa
Support async function serialization. (#1311) 2018-05-03 12:25:52 -07:00
Luke Hoban cc8b87ce3d
Make debuggable promise properties as non-enumerable (#1315)
Fixes #1237.
2018-05-02 23:29:20 -07:00
Matt Ellis 05753ec350 Don't attempt to preview a destroy operation for a PPC hosted stack
The service has no good way to preview a destroy operation for a stack
managed by a PPC. Until it does, just behave as if --force was passed
to the CLI in this case (i.e. skip the preview).

Fixes #1301
2018-05-02 12:03:23 -07:00
Matt Ellis 409477b951 Invoke node directly from the language host
Instead of using a shell script to jump from the language host into
node, just invoke node directly. This makes our start-up path a little
simpler to understand and indirectly fixes pulumi/home#156, where we
would fail on Windows if the `-exec` script was in a folder that had
spaces in it (due to a subtle interaction between how go launches cmd
files and how cmd.exe parses arguments).
2018-05-02 11:16:58 -07:00
Matt Ellis c442ae70ca Use nicer URLs for stacks on the new identity model
When linking back to the service, use the newer, simpler, URLs for a
stack: `https://pulumi.com/<owner>/<stack-name>` instead of
`https://pulumi.com/<owner>/-/-/<stack-name>`
2018-05-02 09:52:43 -07:00
Chris Smith cb66264cf1
Put StartUpdateRequest in POST body (#1305) 2018-05-01 20:40:55 -07:00
Joe Duffy 80eac1c419
Merge pull request #1289 from pulumi/sdkless_brew
Remove SDK dependencies
2018-05-01 19:14:38 -07:00
Pat Gavlin 7ffadd34a8
Merge pull request #1302 from pulumi/Revert1261
Revert the changes from #1261.
2018-05-01 18:14:06 -07:00
Pat Gavlin 16f1930069
Pass "special" properties to Invoke. (#1277)
Rather than filtering out the `id` and `urn` properties when serializing
the inputs to an invoke, pass these properties along. This enables the
use of invoke endpoints that accepts these as inputs (e.g. the endpoint
that backs `aws.ec2.getSubnet`).
2018-05-01 15:05:42 -07:00
Matt Ellis d7d939cfd3 Fix Preview against a PPC
Refactoring to support "preview" and "update" as part of the same
operation interacted poorly with deploying into a PPC via the service.

Per Pat, this is the quickest fix that gets us off the floor.

Part of #1301
2018-05-01 11:15:25 -07:00
Pat Gavlin 639e605bed Revert the changes from #1261.
Restore the provider-first diff logic these changes disabled.

Part of #1251.
2018-05-01 10:01:18 -07:00
Matt Ellis 213c9c3c08 Use newer versions of the build-sdk.sh scripts 2018-04-30 20:44:01 -07:00
Joe Duffy b22a28ed34
Add necessary refresh apitypes (#1299)
This change adds the apitypes required to make refresh-style updates
work in the PPC and in the service.
2018-04-30 17:42:24 -07:00
joeduffy 4ef4eba01a Remove SDK dependencies
This change eliminates our dependencies on the SDK repo.  Now that
SDKs are comprised solely of pulumi/pulumi artifacts, a separate repo
isn't required.  This allows us to simplify some of the distribution.

The install.sh script is modified slightly, to permit overriding the
default install location using $PULUMI_INSTALL_PATH.
2018-04-30 16:39:17 -07:00
CyrusNajmabadi fd3ddda917
Disable interactive mode for a CI/CD server. (#1297) 2018-04-30 15:27:53 -07:00
Joe Duffy 088d6800d9
Improve two minor UX things in the CLI (#1293)
This changes three minor UX things in the CLI's update flow:

1. Use bright blue for column headers, since the dark blue is nearly
   invisible on a black background.

2. Move the operation symbol to the far left, as a sort of "bullet
   point" for each line of output.  This was how they initial symbols
   were designed and this helps to glance at the summary to see what's
   going on.

3. Shorten some of the column headers that didn't add extra clarity.
2018-04-30 12:31:57 -07:00
Matt Ellis e6d2854429 Remove pulumi history command
We already have a great history viewing experience on
Pulumi.com. `pulumi history` in the CLI today is basically unuseable,
and instead of working on trying to improve it, let's just remove it
for now.

Fixes #965
2018-04-30 12:12:27 -07:00
Sean Gillespie b48f230ce3
Fix an issue where errors outside of resource creation got dropped (#1285) 2018-04-30 10:27:04 -07:00
Matthew Riley 8ea6b24e21
Merge pull request #1282 from pulumi/etc-hosts
Add static entries for Pulumi backends to /etc/hosts
2018-04-29 14:54:46 -07:00
Joe Duffy 578f18831e
Add commands to generate goodies (#1288)
This change adds two new (hidden) CLI commands:

* `gen-bash-completion`: This command generates a bash completion
  script for the CLI, storing it in the file specified by the 1st arg.
  This fixes pulumi/pulumi#1172.

* `gen-markdown`: This command generates a directory of Markdown files,
  one per command, documenting the CLI commands and their usage.

I originally did these as separate scripts that we can use in our
build processes, but it was actually even easier to make `pulumi` able
to generate them for itself.  The nice part about this is that we don't
even need to bundle additional assets in order to distribute e.g. the
bash completion scripts, we can simply tell people to run

    $ pulumi gen-bash-completion /etc/bash_completion.d/pulumi

This can also be used in our upcoming Brew installer.
2018-04-28 11:18:21 -07:00
Matt Ellis b7b80f7ea1 Use glog instead of printf
When running `pulumi logs -f` we'd also see these messages printed to
standard out:

Getting more logs for /aws/lambda/urlshortenereeb67ce9-d8fa6fa...

This could be useful diagnostics information, but we should be
glog'ing it not unconditionally writing it to the terminal.
2018-04-27 18:27:37 -07:00
Luke Hoban 7dac925bcf
Fix handling of nested archives (#1283)
AssetArchives which include nested archives were not embedding content from the nested archive underneath the key of the nest archive.

Fixes #1272.
2018-04-27 17:10:50 -07:00
Sean Gillespie 5decc10cbb
Improve the error message if Pulumi runtime SDK isn't installed (#1286)
* Improve the error message when npm/yarn install hasn't been run

* Same thing, but for Python

* Use PULUMI_RUN in batch script

* Use -e, -f doesn't work for symlinked paths (e.g. yarn link)
2018-04-27 16:55:41 -07:00
Matt Ellis 94d11884f8 Fix login/logout issue against non api.pulumi.com clouds
Pat ran into a weird error when trying to do some development agains
the testing cloud:

```
$ pulumi logout
$ pulumi login --cloud-url [test-cloud-url]
Logged into [test-cloud-url]
$ pulumi stack ls
Enter your Pulumi access token from https://pulumi.com/account:
```

In his case, we did not have `current` set in our credentials.json
file (likely due to him calling `pulumi logout` at some point) but we
did have stored credentials for that cloud. When he logged in the CLI
noticed we could reuse the stored credentials but did not update the
the current setting to set the current cloud.

While investigating, I also noticed that `logout` did not always do
the right thing when you were logged into a different backend than
pulumi.com
2018-04-27 15:41:50 -07:00
Matt Ellis 943b8ff554
Merge pull request #1274 from pulumi/ellismg/minor-cli-improvements
Minor CLI improvements
2018-04-27 09:29:48 -07:00
Matthew Riley 088a06034e Add static entries for Pulumi backends to /etc/hosts 2018-04-26 22:54:39 -07:00
Matt Ellis e6488ac17e Only show emojis on macOS
While emojis often work in the console on many newer Linux distros,
follow yarn's lead and only enable them on macOS (see
https://github.com/yarnpkg/yarn/pull/415).
2018-04-26 18:28:07 -07:00
Pat Gavlin da89733a26
Merge pull request #1275 from pulumi/StackURLs
Add a URL column to `stack ls`.
2018-04-26 09:39:40 -07:00
Pat Gavlin d0135ea1bb Add a URL column to stack ls.
Just what it says on the tin.
2018-04-25 21:17:46 -07:00
Sean Gillespie 14baf866f6
Snapshot management overhaul and refactor (#1273)
* Refactor the SnapshotManager interface

Lift snapshot management out of the engine by delegating it to the
SnapshotManager implementation in pkg/backend.

* Add a event interface for plugin loads and use that interface to record plugins in the snapshot

* Remove dead code

* Add comments to Events

* Add a number of tests for SnapshotManager

* CR feedback: use a successful bit on 'End' instead of having a separate 'Abort' API

* CR feedback

* CR feedback: register plugins one-at-a-time instead of the entire state at once
2018-04-25 17:20:08 -07:00
Matt Ellis 8f0dff3220 Minor CLI improvements
- Show Emojis on non-Windows platforms, instead of just macOS

- Change help text for `pulumi logs` to clarify the logs are specific
  to a stack, not a project

- Display stack name when showing logs

- Have preamble text show to users for engine operations read a little
  nicer
2018-04-25 16:52:31 -07:00
Matt Ellis 1994c94b8b Remove some obsolete flags from pulumi config rm
These flags were a hold-over from earlier iterations of the config
model and are not needed anymore.
2018-04-25 14:25:11 -07:00
CyrusNajmabadi 11f1e444f4
Require a resource's parent to actually be a resource. (#1266) 2018-04-24 17:23:18 -07:00
Matt Ellis 5f4189555a Fix update permalink for stacks on new identity model
We were generating incorrect URLs for stacks on the new identity
model. When we don't have a repository in our ProjectIdentifier, the
URL's in the service use "-" for the repository and project names.
2018-04-24 16:20:43 -07:00
CyrusNajmabadi 3b13803c71
Add a hidden --no-interactive flag so that we can reduce interactive noise when running jenkins. (#1262) 2018-04-24 14:23:08 -07:00
Pat Gavlin 1894e6e5af
Merge pull request #1261 from pulumi/Workaround1251
Work around issue #1251.
2018-04-24 13:07:35 -07:00
CyrusNajmabadi 42d7174c70
Add a new tree-view form for the progress view. (#1260) 2018-04-24 11:13:22 -07:00
pat@pulumi.com ca2e996428 Work around issue #1251.
This issue arises becuase the behavior we're currently getting from Diff
for TF-based providers differs from the behavior we expect. We are
presenting the provider with the old state and new inputs. If the old
state contains output properties that differ from the new inputs, the
provider will detect a diff where we may expect no changes.

Rather than deferring to the provider for all diffs, these changes only
defer to the provider if a legacy diff was detected (i.e. there is some
difference between the old and new provider-calculated inputs).
2018-04-24 10:35:27 -07:00
Sean Gillespie fba87909a0
Re-introduce interface for snapshot management (#1254)
* Re-introduce interface for snapshot management

Snapshot management was done through the Update interface; this commit
splits it into a separate interface

* Put the SnapshotManager instance onto the engine context

* Remove SnapshotManager from planContext and updateActions now that it can be accessed by engine Context
2018-04-23 14:12:13 -07:00
Chris Smith 6a0718bcff
Revert adding HEAD commit info to update env (#1257) 2018-04-23 14:01:28 -07:00
Matt Ellis fe8bad70d1 Don't mention PPC unless needed in the CLI
PPCs are no longer a central concept to our model, but instead a
feature that that pulumi.com provides to some organizations. Let's
remove most mentions of PPCs except for cases where we really need to
talk about them (e.g. when a stack is actually hosted in a PPC instead
of just via the normal pulumi.com service)

Also remove some "in the Pulumi Cloud" messages from the CLI, as using
the Pulumi Cloud is now the only real way to use pulumi.

Fixes pulumi/pulumi-service#1117
2018-04-23 16:50:48 -04:00