Commit graph

16 commits

Author SHA1 Message Date
Matt Ellis acf0fb278a Fix wierd interactions due to Cobra and glog
The glog package force the use of golang's underyling flag package,
which Cobra does not use. To work around this, we had a complicated
dance around defining flags in multiple places, calling flag.Parse
explicitly and then stomping values in the flag package with values we
got from Cobra.

Because we ended up parsing parts of the command line twice, each with
a different set of semantics, we ended up with bad UX in some
cases. For example:

`$ pulumi -v=10 --logflow update`

Would fail with an error message that looked nothing like normal CLI
errors, where as:

`$ pulumi -v=10 update --logflow`

Would behave as you expect. To address this, we now do two things:

- We never call flag.Parse() anymore. Wacking the flags with values we
  got from Cobra is sufficent for what we care about.

- We use a forked copy of glog which does not complain when
  flag.Parse() is not called before logging.

Fixes #301
Fixes #710
Fixes #968
2018-08-20 14:08:40 -07:00
Alex Clemmer 08b7b1e76e Make protobuf build more reproducible 2018-07-02 13:31:39 -07:00
Sean Gillespie 68911900fd
Graceful shutdown (#1320)
* Graceful RPC shutdown: CLI side

* Handle unavailable resource monitor in language hosts

* Fix a comment

* Don't commit package-lock.json

* fix mangled pylint pragma

* Rebase against master and fix Gopkg.lock

* Code review feedback

* Fix a race between closing the callerEventsOpt channel and terminating a goroutine that writes to it

* glog -> logging
2018-05-16 15:37:34 -07:00
CyrusNajmabadi e8485c2388
Lighten our dependency on the docker cli (#1238) 2018-04-19 15:55:24 -07:00
Sean Gillespie 70cc3f3796
Revert "Upgrade to latest gRPC (#1071)" (#1091)
This reverts commit 8c0d1698b0.
2018-03-29 22:24:26 -07:00
Luke Hoban 8c0d1698b0
Upgrade to latest gRPC (#1071)
We previously locked our dependency on google.golang.org/grpc to 1.7.2 due to issues we had seen on 1.8.x as noted in #701. However, this has prevented us using some other dependencies which require newer grpc. A test in this repo and AWS showed no problems with the latest 1.10.x versions of the library in our tests.

We'll go ahead and remove this constraint and allow grpc to float forward. If we see issues again, we'll use that repro case to investigate an alternative fix in our code.

Resolves #701.
2018-03-22 16:27:28 -07:00
Joe Duffy 776a76dffd
Make some stack-related CLI improvements (#947)
This change includes a handful of stack-related CLI formatting
improvements that I've been noodling on in the background for a while,
based on things that tend to trip up demos and the inner loop workflow.

This includes:

* If `pulumi stack select` is run by itself, use an interactive
  CLI menu to let the user select an existing stack, or choose to
  create a new one.  This looks as follows

      $ pulumi stack select
      Please choose a stack, or choose to create a new one:
        abcdef
        babblabblabble
      > currentlyselected
        defcon
        <create a new stack>

  and is navigated in the usual way (key up, down, enter).

* If a stack name is passed that does not exist, prompt the user
  to ask whether s/he wants to create one on-demand.  This hooks
  interesting moments in time, like `pulumi stack select foo`,
  and cuts down on the need to run additional commands.

* If a current stack is required, but none is currently selected,
  then pop the same interactive menu shown above to select one.
  Depending on the command being run, we may or may not show the
  option to create a new stack (e.g., that doesn't make much sense
  when you're running `pulumi destroy`, but might when you're
  running `pulumi stack`).  This again lets you do with a single
  command what would have otherwise entailed an error with multiple
  commands to recover from it.

* If you run `pulumi stack init` without any additional arguments,
  we interactively prompt for the stack name.  Before, we would
  error and you'd then need to run `pulumi stack init <name>`.

* Colorize some things nicely; for example, now all prompts will
  by default become bright white.
2018-02-16 15:03:54 -08:00
joeduffy acc9147ea1 Lock gRPC to v1.7.2 2017-12-27 06:35:52 -08:00
Joe Duffy 8cce92ff27
Humanize some outputs a little (#723)
This does three things:

* Use nice humanized times for update times, to avoid ridiculously
  long timestamps consuming lots of horizontal space.  Instead of

       LAST UPDATE
       2017-12-12 12:22:59.994163319 -0800 PST

  we now see

       LAST UPDATE
       1 day ago

* Use the longest config key for the horizontal spacing when the key
  exceeds the default alignment size.  This avoids individual lines
  wrapping in awkward ways.

* Do the same for stack names and output properties.
2017-12-14 11:51:58 -08:00
Joe Duffy b83588a0b8
Add a Dep [[constraint]] to gRPC v1.7.2
See https://github.com/pulumi/pulumi/issues/701 for more details.
2017-12-11 16:57:58 -08:00
joeduffy 22c1f819e6 Better progress reporting
This change does two things:

    1) Adds progress reporting to our uploads.

    2) Eliminate the sleeps that burned 7 seconds at the front of
       any cloud update, needlessly.  It's actually impressively
       fast without these!
2017-12-02 15:17:59 -08:00
joeduffy 17ab1120e5 Integrate parent/child pointer changes with ops pkg 2017-11-27 11:08:04 -08:00
Matt Ellis f953794363 Support .pulumiignore
When deploying a project via the Pulumi.com service, we have to upload
the entire "context" of your project to Pulumi.com. The context of the
program is all files in the directory tree rooted by the `Pulumi.yaml`
file, which will often contain stuff we don't want to upload, but
previously we had no control over what would be updated (and so folks
would do hacky things like delete folders before running `pulumi
update`).

This change adds support for `.pulumiignore` files which should behave
like `.gitignore`. In addition, we were not previously compressing
files when we added them to the zip archive we uploaded and now.

By default, every .pulumiignore file is treated as if it had an
exclusion for `.git/` at the top of the file (users can override this
by adding an explicit `!.git/` to their file) since it is very
unlikely for there to ever be a reason to upload the .git folder to
the service.

Fixes pulumi/pulumi-service#122
2017-11-21 12:09:18 -08:00
CyrusNajmabadi 269004afb4
Show a nicer diff of our serialized functions when doing a 'pulumi update'
Also refactor and clean up a lot of the diff printing code.
2017-11-20 11:39:49 -08:00
Matt Ellis a749ac1102 Use go-yaml directly
Instead of doing the logic to see if a type has YAML tags and then
dispatching based on that to use either the direct go-yaml marshaller
or the one that works in terms of JSON tags, let's just say that we
always add YAML tags as well, and use go-yaml directly.
2017-10-20 14:01:37 -07:00
Joe Duffy 5da78c036b Convert to Dep 2017-08-01 18:37:06 -07:00