Commit graph

1898 commits

Author SHA1 Message Date
Pat Gavlin eec99c3ca9
Merge pull request #547 from pulumi/AssetBugs
Fix an archive-related bug.
2017-11-10 20:42:33 -08:00
pat@pulumi.com 8c7932c1b5 Fix an archive-related bug.
Properly skip the .pulumi when dealing with directory-backed archives.
2017-11-10 19:56:25 -08:00
Pat Gavlin f2e658e1b7
Merge pull request #546 from pulumi/TarArchiveError
Log actual and expected sizes on ErrWriteTooLong.
2017-11-10 12:23:57 -08:00
Pat Gavlin db2f802d34 Log actual and expected sizes on ErrWriteTooLong.
If a blob's reported size is incorrect, `archiveTar` may attempt to
write more bytes to an entry than it reported in that entry's header.
These changes provide a bit more context with the resulting error as
well as removing an unnecessary `LimitReader`.
2017-11-10 11:46:49 -08:00
Luke Hoban af5298f4aa
Initial work on tracing support (#521)
Adds OpenTracing in the Pulumi engine and plugin + langhost subprocesses.

We currently create a single root span for any `Enging.plan` operation - which is a single `preview`, `update`, `destroy`, etc.

The only sub-spans we currently create are at gRPC boundaries, both on the client and server sides and on both the langhost and provider plugin interfaces.

We could extend this to include spans for any other semantically meaningful sections of compute inside the engine, though initial examples show we get pretty good granularity of coverage by focusing on the gRPC boundaries.

In the future, this should be easily extensible to HTTP boundaries and to track other bulky I/O like datastore read/writes once we hook up to the PPC and Pulumi Cloud.

We expose a `--trace <endpoint>` option to enable tracing on the CLI, which we will aim to thread through to subprocesses.

We currently support sending tracing data to a Zipkin-compatible endpoint.  This has been validated with both Zipkin and Jaeger UIs.

We do not yet have any tracing inside the TypeScript side of the JS langhost RPC interface.  There is not yet automatic gRPC OpenTracing instrumentation (though it looks like it's in progress now) - so we would need to manually create meaningful spans on that side of the interface.
2017-11-08 17:08:51 -08:00
pat@pulumi.com 0b6b211e69 Do not delete temp directories during tests.
This interacts badly with the deferred destroy.
2017-11-08 16:51:55 -08:00
joeduffy 4d26cf4f2c Fix a function comment 2017-11-08 16:20:27 -08:00
Pat Gavlin d01465cf6d
Make archive assets stream their contents. (#542)
We currently have a nasty issue with archive assets wherein they read
their entire contents into memory each time they are accessed (e.g. for
hashing or translation). This interacts badly with scenarios that
place large amounts of data in an archive: aside from limiting the size
of an archive the engine can handle, it also bloats the engine's memory
requirements. This appears to have caused issues when running the PPC in
AWS: evidence suggests that the very high peak memory requirements this
approach implies caused high swap traffic that impacted the service's
availability.

In order to fix this issue, these changes move archives onto a
streaming read model. In order to read an archive, a user:
- Opens the archive with `Archive.Open`. This returns an ArchiveReader.
- Iterates over its contents using `ArchiveReader.Next`. Each returned
  blob must be read in full between successive calls to
  `ArchiveReader.Next`. This requirement is essentially forced upon us
  by the streaming nature of TAR archives.
- Closes the ArchiveReader with `ArchiveReader.Close`.

This model does not require that the complete contents of the archive or
any of its constituent files are in memory at any given time.

Fixes #325.
2017-11-08 15:28:41 -08:00
Joe Duffy 73d627edca
Fix an erroneous error condition
This code was swallowing an error incorrectly, rather than returning
it.  As a result, certain commands would fail with assertions rather
than the intended error message (like trying to config without a stack).
2017-11-08 14:37:01 -08:00
Matt Ellis 33a032b5c2 Trim whitespace around user input before comparing
Doing it this way will make things work on both *nix and Windows

Fixes #534
2017-11-07 14:24:49 -08:00
Matt Ellis f0d2dfb1c9 Use Getenv instead of LookupEnv 2017-11-06 15:18:35 -08:00
Chris Smith 5085c7eef8
Rework polling (#531)
Rework the polling code for `pulumi` when targeting hosted scenarios. (i.e. absorb https://github.com/pulumi/pulumi-service/pull/282.) We now return an `updateID` for update, preview, and destroy. And use bake that into the URL.

This PR also silently ignores 504 errors which are now returned from the Pulumi Service if the PPC request times out.

Combined, this should ameliorate some of the symptoms we see from https://github.com/pulumi/pulumi-ppc/issues/60. Though we'll continue to try to identify and fix the root cause.
2017-11-06 14:12:20 -08:00
Matt Ellis fbb3887343
Merge pull request #472 from pulumi/clean-temp-on-test-pass
Integration testing improvements
2017-11-06 12:21:33 -08:00
Matt Ellis 098b2b8401 Remove integration test working folder if tests pass 2017-11-06 11:50:21 -08:00
Matt Ellis aa80b7dee9 Don't pass PULUMI_API when running integration tests
We are not ready to start running integration tests against
Pulumi.com, but `pulumi` uses `PULUMI_API` to decide what backend to
target. Remove it when running `pulumi` in the integration tests so we
always get the local behavior.

pulumi/pulumi#471 tracks the work to actually be able to choose what
backend you want when an integration test runs.
2017-11-06 11:50:16 -08:00
Matt Ellis c20caeefb7
Merge pull request #522 from pulumi/publishing-fixes
Publishing fixes
2017-11-06 11:46:20 -08:00
Matt Ellis 34fa7f7151 Fetch entire history 2017-11-06 11:07:57 -08:00
Joe Duffy d5ef7a8538
Exit early during integration tests (#530)
This changes the overall flow to exit early when a failure occurs.
We will try to clean up if we believe to have gotten far enough to
actually have provisioned any resources.
2017-11-06 09:04:38 -08:00
joeduffy 8fd4770dcf Cap test/host names at 10 chars, to keep names reasonable 2017-11-06 08:22:45 -08:00
joeduffy 145cdf1f71 Also use stack names as temp dir names 2017-11-06 07:50:28 -08:00
Joe Duffy 68e23f03c1
Add hostname and testdir to integration test stack names (#529)
This should help us attribute resources allocated (and orphaned) by
tests a little easier, including tracking down any leaking resources.
2017-11-06 07:23:07 -08:00
joeduffy 4d19a71efb Remove extra newline to shorten logs 2017-11-05 17:52:40 -08:00
joeduffy 7b045bd7af Retain stdout/stderr for integration test commands
...and only print it upon error, as part of pulumi/pulumi#518.
2017-11-05 17:28:12 -08:00
joeduffy 7917c693f0 Improve "passphrase:" prompts 2017-11-04 08:23:16 -07:00
Joe Duffy fbf13ec4d7
Use full state during updates (#526)
In our existing code, we only use the input state for old and new
properties.  This is incorrect and I'm astonished we've been flying
blind for so long here.  Some resources require the output properties
from the prior operation in order to perform updates.  Interestingly,
we did correclty use the full synthesized state during deletes.

I ran into this with the AWS Cloudfront Distribution resource,
which requires the etag from the prior operation in order to
successfully apply any subsequent operations.
2017-11-03 19:45:19 -07:00
Matt Ellis 62ad82ec02 Pass version number when go build'ing during publishing 2017-11-03 17:30:50 -07:00
Matt Ellis 20199a2400 Publish to "amd64" instead of "x64"
Windows was the odd man out here, everything else used amd64 except
for this repo's windows build.
2017-11-03 17:30:50 -07:00
Luke Hoban 13b10490c2
Only call Configure on a package once (#520)
We were previously calling configure on each package once per time it was mentioned in the config.  We only need to call it once ever as we pass the full bag of relevent config through on that one call.
2017-11-03 13:52:59 -07:00
Joe Duffy 0290283e6f
Skip unknown properties (#524)
It's legal and possible for undefined properties to show up in
objects, since that's an idiomatic JavaScript way of initializing
missing properties.  Instead of failing for these during deployment,
we should simply skip marshaling them to Terraform and let it do
its thing as usual.  This came up during our customer workload.
2017-11-03 13:40:15 -07:00
Matt Ellis 5067d77db1 Pass branch name to AppVeyor badge
Without this, we were getting the status for the most recent run,
which could include a broken run from a topic branch someone was using
for a PR.
2017-11-03 11:40:39 -07:00
joeduffy 5bf8b5cd3b Fix an error message typo 2017-11-03 11:20:33 -07:00
Pat Gavlin 6cd074fc38 Fix a test.
This test was not updated for the change to EventIndex.
2017-11-03 11:07:19 -07:00
Pat Gavlin ab9eae439b Update the type of EventIndex to match the API./service type. 2017-11-03 11:02:22 -07:00
Matt Ellis 538c45a744
Merge pull request #486 from pulumi/local-config
Suport workspace local configuration and use it by default
2017-11-02 13:21:19 -07:00
Matt Ellis 44d432a559 Suport workspace local configuration and use it by default
Previously, we stored configuration information in the Pulumi.yaml
file. This was a change from the old model where configuration was
stored in a special section of the checkpoint file.

While doing things this way has some upsides with being able to flow
configuration changes with your source code (e.g. fixed values for a
production stack that version with the code) it caused some friction
for the local development scinerio. In this case, setting
configuration values would pend changes to Pulumi.yaml and if you
didn't want to publish these changes, you'd have to remember to remove
them before commiting. It also was problematic for our examples, where
it was not clear if we wanted to actually include values like
`aws:config:region` in our samples.  Finally, we found that for our
own pulumi service, we'd have values that would differ across each
individual dev stack, and publishing these values to a global
Pulumi.yaml file would just be adding noise to things.

We now adopt a hybrid model, where by default configuration is stored
locally, in the workspace's settings per project. A new flag `--save`
tests commands to actual operate on the configuration information
stored in Pulumi.yaml.

With the following change, we have have four "slots" configuration
values can end up in:

1. In the Pulumi.yaml file, applies to all stacks
2. In the Pulumi.yaml file, applied to a specific stack
3. In the local workspace.json file, applied to all stacks
4. In the local workspace.json file, applied to a specific stack

When computing the configuration information for a stack, we apply
configuration in the above order, overriding values as we go
along.

We also invert the default behavior of the `pulumi config` commands so
they operate on a specific stack (i.e. how they did before
e3610989). If you want to apply configuration to all stacks, `--all`
can be passed to any configuration command.
2017-11-02 13:05:01 -07:00
Matt Ellis ede8f303f9
Merge pull request #506 from pulumi/pulumi-cli-to-cloud
Add cloud variants to remaining pulumi CLI commands
2017-11-02 11:41:10 -07:00
Matt Ellis a27d2bde72 Pass cloud name in options bag instead of an explicit parameter 2017-11-02 11:19:00 -07:00
Matt Ellis ab7c4c121f Do not expect a response from the destory endpoint
On success, the POST returns 204 (No Content)
2017-11-02 11:19:00 -07:00
Matt Ellis 07b4d9b36b Add Pulumi.com backend, unify cobra Commands
As part of the unification it became clear where we did not support
features that we had for the local backend. I opened issues and added
comments.
2017-11-02 11:19:00 -07:00
Matt Ellis 328734f874 Define backend interface, move local implementation behind it
This change introduces an abstraction for a `backend` which manages
the implementation of some CLI commands. As part of defining the
interface, we introduce a new local backend implementation that just
uses data local to the machine.

This will let us share argument parsing and some display information
between the local case and the pulumi.com case in the CLI. We can
continue to refine this interface over time (e.g. today we have the
implementation of the Destroy/Update/Preview actually writing output
but instead they should be returning strongly typed data that the CLI
knows how to display and is unified across Pulumi.com deploys and
local deploys).

But this is a good first step.
2017-11-02 11:19:00 -07:00
Chris Smith e0b67e1060 Address PR feedback 2017-11-02 11:19:00 -07:00
Chris Smith 693d940ee5 Fix lint warnings 2017-11-02 11:19:00 -07:00
Chris Smith 1557eb9f2e Add 'pulumi destroy' 2017-11-02 11:19:00 -07:00
Chris Smith 9f19c89397 Add 'pulumi preview' 2017-11-02 11:19:00 -07:00
Chris Smith fc82e71f21 Update Stack tests 2017-11-02 11:19:00 -07:00
Chris Smith 8b99c9a63f Bring in API types from the Pulumi Service 2017-11-02 11:19:00 -07:00
Chris Smith 11e217b869 Add 'stack select' 2017-11-02 11:19:00 -07:00
Chris Smith d66b792ecc Add 'stack rm' 2017-11-02 11:19:00 -07:00
Chris Smith 71f44f40b4 Add 'pulumi ls' 2017-11-02 11:19:00 -07:00
Chris Smith 76f5e832c2 Add 'pulumi login' test 2017-11-02 11:19:00 -07:00