Commit graph

3060 commits

Author SHA1 Message Date
Sean Gillespie ed0353e251
Process deletions conservatively in parallel (#1963)
* Process deletions conservatively in parallel

This commit allows the engine to conservatively delete resources in
parallel when it is sure that it is legal to do so. In the absence of a
true data-flow oriented step scheduler, this approach provides a
significant improvement over the existing serial deletion mechanism.

Instead of processing deletes serially, this commit will partition the
set of condemned resources into sets of resources that are known to be
legally deletable in parallel. The step executor will then execute those
independent lists of steps one-by-one until all steps are complete.

* CR: Make ResourceSet a normal map

* Only use the dependency graph if we can trust it

* Reverse polarity of pendingDeletesAreReplaces

* CR: un-export a few types

* CR: simplify control flow in step generator when scheduling

* CR: parents are dependencies, fix loop index

* CR: Remove ParentOf, add new test for parent dependencies
2018-09-27 15:49:08 -07:00
Matt Ellis d9e3c2c91d Restore build-sdk.sh script
It was not intended to be deleted as part of #1992, we just wanted to
delete `dist/install.sh`
2018-09-26 21:49:19 -07:00
Joe Duffy 197b239741
Merge pull request #1992 from pulumi/ellismg/remove-install-script
Remove install script from SDK tarball
2018-09-26 18:09:17 -07:00
Matt Ellis f91e1ba5c5 Remove install script from SDK tarball
Pulumi used to have a much more complicated install process, whereas
today, this is no longer the case. You simply unpack pulumi to a
folder of your choice, add it to the `$PATH` and then go.

The `install.sh` was writtten back when Pulumi had to be installed
into its own directory. It assumed that it "owned" this directory and
when the script hit an error would clean up its half processed state
before trying to exit. While this was fine out of the box (since we
default to installing to `/usr/local/pulumi`) if you overrode the
install location to just say `/usr/local` *and* we hit an error in the
script, the script would try to remove everything from `/usr/local` as
part of cleaning itself up.

Since we no longer need any of this extra install logic, we'll just
remove `install.sh` completely. The SDK tarball will now contain a
single top level directory (named `pulumi`) with all of our binaries
under it. Manual installs will now just mean unpacking the tarball
somewhere and putting that `pulumi` folder on your path, or as a
simplification, copying all the binaries from the `pulumi` folder into
an existing folder that is already on your path.

This also removes the need to ever ask the user to `sudo` during an
install. Users now have complete control over where they put our
binaries, which is exactly what you want from a manual install
process.
2018-09-26 14:05:56 -07:00
CyrusNajmabadi 177f0f7ca1
Fix computation of the isKnown bit for an Output (when the apply function returns an Output itself). (#1974) 2018-09-25 21:29:27 -07:00
CyrusNajmabadi 5d34e380ab
Prevent the same resource header from appearing multiple times during diagnostics. (#1985) 2018-09-25 10:58:22 -07:00
CyrusNajmabadi 431f5b3450
Fix rtti check. (#1983) 2018-09-24 20:06:31 -07:00
Matt Ellis d51e04f501 Write warnings from the Pulumi service
API calls agains the Pulumi service may start setting a new header,
`X-Pulumi-Warning`. The value of this header should be presented to
the user as a warning.

The Service will use this to provide additional information to the
user without having the CLI have to know about every specific warning
path.
2018-09-24 16:59:15 -07:00
CyrusNajmabadi d305b30f21 Revert RunError behavior. Introduce new ResourceError for errors assiated with a resource. (#1981)
* Revert RunError behavior.  Introduce new ResourceError for errors associated with a resource.

* Fix docs.

* Use resource error.

* Use ResourceError in more places.

* Use ResourceError in a few more places.

* Throw a resource error.

* Make required.

* Revert this.

* Lint.

* Only report errors once.

* Better comment.
2018-09-24 16:57:20 -07:00
Joe Duffy 4060851324
Merge pull request #1976 from pulumi/joeduffy/no_same_asterisk
Make a smattering if CLI UX improvements
2018-09-24 15:51:23 -07:00
joeduffy f4ed9763a7 Update test baselines
This updates the test baselines to validate the new output.
2018-09-24 15:22:50 -07:00
joeduffy b06a02f03c Use go-humanize instead of lame hand-pluralization 2018-09-24 14:40:14 -07:00
CyrusNajmabadi 04fe445c22
Allow Error instances to be reported against a resource. (#1980) 2018-09-24 13:42:16 -07:00
joeduffy 3468393490 Make a smattering of CLI UX improvements
Since I was digging around over the weekend after the change to move
away from light black, and the impact it had on less important
information showing more prominently than it used to, I took a step
back and did a deeper tidying up of things. Another side goal of this
exercise was to be a little more respectful of terminal width; when
we could say things with fewer words, I did so.

* Stylize the preview/update summary differently, so that it stands
  out as a section. Also highlight the total changes with bold -- it
  turns out this has a similar effect to the bright white colorization,
  just without the negative effects on e.g. white terminals.

* Eliminate some verbosity in the phrasing of change summaries.

* Make all heading sections stylized consistently. This includes
  the color (bright magenta) and the vertical spacing (always a newline
  separating headings). We were previously inconsistent on this (e.g.,
  outputs were under "---outputs---"). Now   the headings are:
  Previewing (etc), Diagnostics, Outputs, Resources, Duration, and Permalink.

* Fix an issue where we'd parent things to "global" until the stack
  object later showed up. Now we'll simply mock up a stack resource.

* Don't show messages like "no change" or "unchanged". Prior to the
  light black removal, these faded into the background of the terminal.
  Now they just clutter up the display. Similar to the elision of "*"
  for OpSames in a prior commit, just leave these out. Now anything
  that's written is actually a meaningful status for the user to note.

* Don't show the "3 info messages," etc. summaries in the Info column
  while an update is ongoing. Instead, just show the latest line. This
  is more respectful of width -- I often find that the important
  messages scroll off the right of my screen before this change.

    For discussion:

        - I actually wonder if we should eliminate the summary
          altogether and always just show the latest line. Or even
          blank it out. The summary feels better suited for the
          Diagnostics section, and the Status concisely tells us
          how a resource's update ended up (failed, succeeded, etc).

        - Similarly, I question the idea of showing only the "worst"
          message. I'd vote for always showing the latest, and again
          leaving it to the Status column for concisely telling the
          user about the final state a resource ended up in.

* Stop prepending "info: " to every stdout/stderr message. It adds
  no value, clutters up the display, and worsens horizontal usage.

* Lessen the verbosity of update headline messages, so we now instead
  of e.g. "Previewing update of stack 'x':", we just say
  "Previewing update (x):".

* Eliminate vertical whitespace in the Diagnostics section. Every
  independent console.out previously was separated by an entire newline,
  which made the section look cluttered to my eyes. These are just
  streams of logs, there's no reason for the extra newlines.

* Colorize the resource headers in the Diagnostic section light blue.

Note that this will change various test baselines, which I will
update next. I didn't want those in the same commit.
2018-09-24 08:43:46 -07:00
Thomas Schersach cb9cb7da94 Reworked gen-bash-completion into a more generic completion command (#1967)
## Why ?

I'm using Zsh (and I'm not the only one 🤣). Pulumi having Zsh completions is great. I will also add completions to the Homebrew Formula when this is merged.

## Why not use Cobra `GenZshCompletion`

It's currently not good enough. Maybe it will be when spf13/cobra#646 is done.

## Implementation

I did the same thing `kubectl` does for Zsh completion. Meaning using the bash completion generated by Cobra and adapting it to a zsh format. The resulting zsh completion file is not perfect (compared to one's where you have a short command description in the output) but it's good enough I think. 

I also changed the file output to a stdout output. I think it's better than outputting to a file and it will make adding completions in Homebrew straightforward. I don't know if the previous `gen-bash-completion` is used in any Pulumi project so this may break things.
2018-09-24 06:25:16 -07:00
CyrusNajmabadi e498cab239
Use test helper. (#1977) 2018-09-22 22:44:49 -07:00
joeduffy 8643bfec22 Don't print redundant "previewing"/"updating" prelude
Now that we're showing SpecUnimportant as regular text, the extra
"Previewing"/"Updating" line that we show really stands out as being
superfluous. For example, we previously said:

    Updating stack 'docker-images'
    Performing changes:

        ...

This change eliminates that second line, so we just have:

    Updating stack 'docker-images':

        ...
2018-09-22 13:34:43 -07:00
joeduffy be9ead855d Eliminate the same prefix
Recently, we eliminated bright black text, which IMHO makes the
"same" lines really stand out more than we want them to. This is
partly just due to the heavyweight nature of the "*" character,
which we precede every line with. This has the effect of making it
toughter to scan the update to see what's going to happen. The goal
of SpecUnimportant (bright black) was that we wanted to draw less
attention to certain elements of the CLI text -- and have them fade
into the background (apparently it was too successful at this ;-))

So, this change eliminates the "*" prefix for same operations
altogether. It reads better to my eyes and keeps the original intent.
2018-09-22 13:34:43 -07:00
Joe Duffy a977749b3d
Merge pull request #1907 from pulumi/chrsmith/1826/always-upload-previews
Always upload previews
2018-09-22 13:34:31 -07:00
Chris Smith 677af7fe18 Wire through ApplierOptions 2018-09-21 13:57:57 -07:00
CyrusNajmabadi 2b610ce577
Actually export type. (#1971) 2018-09-21 11:58:58 -07:00
Pat Gavlin 8f55a379f6
Return errors for unknown/invalid path archives. (#1970)
- Attempting to read an archive with an unknown type now returns an
  error
- Attempting to read a path archive that is neither a known archive
  format or a directory now returns an error

Fixes #1529.
Fixes #1953.
2018-09-21 11:53:39 -07:00
Chris Smith 3984cd96d7 Persist all previews, even those immediately before update 2018-09-21 11:41:31 -07:00
Chris Smith 9c042a3a5b Always upload previews 2018-09-21 11:38:12 -07:00
CyrusNajmabadi 08bfb69f7b
Move to an options-bag for computeCodePaths. (#1969) 2018-09-21 11:29:05 -07:00
Luke Hoban 375b75be84
Fix requireObject docs (#1961)
Fixes #1958
2018-09-21 07:58:14 -07:00
Joe Duffy d04acf4da1
Remember lazy stack selection (#1964)
If you run an operation that requires a stack, but you don't have
one selected, you'll be prompted. This happens all over the place.
Sadly, your selection at this prompt is not remembered (unless you
opt to create a new one), meaning you'll just keep getting prompted.

The fix is simple: we just ignored the setCurrent bool previously;
we need to respect it and call the SetCurrentStack function.

This fixes pulumi/pulumi#1831.
2018-09-21 07:45:23 -07:00
Nate Jones 0ea261baf4 Pass environment through to go language programs (#1965)
This allows those programs to use authentication credentials that are
in the environment to perform extra work.
2018-09-20 15:17:18 -07:00
Pat Gavlin 9c7fff2d7d
Improve integration test usability. (#1960)
Add two command-line options to the test framework, "-dirs" and
"list-dirs". The former accepts a regex that is used to select which
integration tests to run. The latter lists available integration tests
without running them.
2018-09-20 15:08:29 -05:00
Nate Jones 88efd73282 Search for Go project executables in more places than just $PATH (#1955)
* Search for Go project executables in more places than just $PATH

This searches the following in preferred order:

1. Local directory
2. $GOPATH/bin
3. In $PATH

* Check if program is not a directory before executing
2018-09-19 15:22:33 -07:00
Sean Gillespie d3f59831d2
Add URN to dummy row for new events (#1957) 2018-09-19 14:29:16 -07:00
CyrusNajmabadi 4f9db82a43
Stop using black/white colors directly when printing out console text. They can have issues with light/dark terminals. (#1951) 2018-09-19 01:40:03 -07:00
Nate Jones 10449c2991 Implement RegisterResourceOutputs so that outputs in Go work (#1954)
Fixes #1519
2018-09-18 15:32:30 -07:00
Sean Gillespie 2d4a3f7a6a
Move management of root resource state to engine (#1944)
* Protobuf changes

* Move management of root resource state to engine

This commit fixes a persistent side-by-side issue in the NodeJS SDK by
moving the management of root resource state to the engine. Doing so
adds two new endpoints to the Engine gRPC service: 1) GetRootResource
and 2) SetRootResource, which get and set the root resource
respectively.

* Rebase against master, regenerate proto
2018-09-18 11:47:34 -07:00
James Nugent 6af4ebe384 Allow any configured CI to use the GitHub app (#1947)
This commit adds checks for a set of predefined environment variables:

- PULUMI_CI_SYSTEM
- PULUMI_CI_BUILD_ID
- PULUMI_CI_BUILD_TYPE
- PULUMI_CI_BUILD_URL
- PULUMI_CI_PULL_REQUEST_SHA

If PULUMI_CI_SYSTEM is set in the environment, CI configuration is
extracted from the remaining variables for sending to the backend, and
disables the checks for supported systems (currently only Travis CI).

This increases the flexibility of the Pulumi CLI by not requiring
specific support for particular CI systems to be added, provided the
necessary environment variables are configured for the job - this should
be possible for at least TeamCity, Jenkins, AWS CodeBuild, Azure DevOps
Pipelines, and likely most other systems.

This should not replace native support for detecting more CI systems in
future, however, since it requires more work of the user.
2018-09-18 09:50:29 -07:00
Sean Gillespie f284112b4e
Use nightly protoc gRPC plugin for node (#1948)
* Use nightly protoc gRPC plugin for Node

Newer versions of the Node gRPC plugin accept the 'minimum_node_version'
flag, which we can use to instruct protoc to not support Node versions
earlier than Node 6. This allows the compiler to use 'Buffer.from'
instead of the deprecated 'Buffer' constructor, which fixes a
deprecation warning on Node 10.

* Protobuf changes
2018-09-17 15:16:31 -07:00
Sean Gillespie d80db466a6
Display diff when Protect bit changes (#1949)
It's useful to show a diff whenever a user toggles the protect bit on a
resource, so they can be sure that it has actually occured.
2018-09-17 15:03:06 -07:00
Sean Gillespie b98c5bb0d9
Fix preview display for replacements (#1945)
* Fix preview display for replacements

* Make gometalinter happy
2018-09-17 10:50:11 -07:00
CyrusNajmabadi 937391259e
Update linter version. (#1946) 2018-09-15 02:59:01 -07:00
Pat Gavlin d67e04247f
Fix a few dynamic provider issues. (#1935)
- Do not require replacement of dynamic resources due to provider
  changes. This is not necessary, and is almost certainly the wrong
  thing to do if the dynamic provider is managing a physical resource.

- Return all inputs by default from a dynamic provider's check method.
  Currently a dynamic provider that does not implement check will end up
  receiving no inputs. This is confusing, and is not the correct default.
2018-09-14 19:59:06 -07:00
Chris Smith 792c316e5e
Change backend.ListStacks to return a new StackSummary interface (#1931)
* Have backend.ListStacks return a new StackSummary interface

* Update filestake backend to use new type

* Update httpstate backend to use new type

* Update commands to use new type

* lint

* Address PR feedback

* Lint
2018-09-13 20:54:42 -07:00
Matt Ellis 3642cca98f Don't print junk when a unrecognized URL is passed to pulumi login
In order to present a message with a link to a user's access tokens in
the service, we have to convert the API server's URL to the URL for
the console.  We understand how to do this for servers that look like
our servers (i.e. their host name is `api.<whatever>`), but in general
we can't do this.

Rewrite the code such that we only print a message about how to find
your access tokens (and offer browser based login) only in cases where
we are able to construct a URL to the console.

Fixes #1930
2018-09-13 19:36:00 -07:00
Thomas Schersach c01023737e Copy missing pulumi-resource-pulumi-nodejs binary in node lang host dist target 2018-09-13 11:18:06 -07:00
Sean Gillespie 59098fb6b6
Clarify condition for displaying outputs (#1927) 2018-09-13 09:16:19 -07:00
Thomas Schersach 0b728a1c3c Added short description to pulumi root cmd (#1925)
* Added short description to pulumi root cmd

* Fixed formatting
2018-09-13 06:45:52 -07:00
CyrusNajmabadi 1b0780afda
Don't unwrap resources when producing an output. (#1923) 2018-09-11 21:49:36 -07:00
CyrusNajmabadi ba7be6a6dd
Update docts. (#1922) 2018-09-11 21:17:52 -07:00
CyrusNajmabadi 13800a89a0
Produce a strongly-typed 'unwrap' function to help with deep unwrapping of Input values. (#1915) 2018-09-11 19:38:45 -07:00
Matt Ellis c7f9f9d12c More macOS script fixes 2018-09-11 17:14:58 -07:00
Matt Ellis a57bdfbd52 Fix up scripts when running on macOS
macOS doesn't use GNU tools and so some options are missing.
2018-09-11 17:00:40 -07:00