Commit graph

1749 commits

Author SHA1 Message Date
joeduffy
66b4c2df66 Add a Windows build badge 2017-10-10 13:40:11 -07:00
Matt Ellis
6f4537010c Fix typo 2017-10-10 12:16:41 -07:00
joeduffy
d52c29b763 Make "up" a short-alias for "update" 2017-10-10 08:52:04 -07:00
CyrusNajmabadi
556345c68e Include environment when computing the hash of closure. (#403)
* Include environment when computing the hash of closure.
2017-10-09 21:46:24 -07:00
Matt Ellis
377eb61e32 Always emit debug events into the stream 2017-10-09 18:27:05 -07:00
Matt Ellis
7587bcd7ec Have engine emit "events" instead of writing to streams
Previously, the engine would write to io.Writer's to display output.
When hosted in `pulumi` these writers were tied to os.Stdout and
os.Stderr, but other applications hosting the engine could send them
other places (e.g. a log to be sent to an another application later).

While much better than just using the ambient streams, this was still
not the best. It would be ideal if the engine could just emit strongly
typed events and whatever is hosting the engine could care about
displaying them.

As a first step down that road, we move to a model where operations on
the engine now take a `chan engine.Event` and during the course of the
operation, events are written to this channel. It is the
responsibility of the caller of the method to read from the channel
until it is closed (singifying that the operation is complete).

The events we do emit are still intermingle presentation with data,
which is unfortunate, but can be improved over time. Most of the
events today are just colorized in the client and printed to stdout or
stderr without much thought.
2017-10-09 18:24:56 -07:00
Matt Ellis
5fd0ada303 Remove Checkpoint return value from GetEnvironment 2017-10-09 18:21:55 -07:00
Matt Ellis
e7e4e75af3 Don't examine the Checkpoint in the CLI
The checkpoint is an implementation detail of the storage of an
environment. Instead of interacting with it, make sure that all the
data we need from it either hangs off the Snapshot or Target
objects (which you can get from a Checkpoint) and then start consuming
that data.
2017-10-09 18:21:55 -07:00
Matt Ellis
6e8185884e Remove GetEnvironmentInfo from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
7e4a1f515b Remove GetEnvironments from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
bd92f8eaed Remove RemoveEnv from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
7fdbdb2152 Remove InitEnv from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
76663d30fa Remove SetConfig from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
02a33a4384 Remove DeleteConfig from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
242eb929fb Remove GetConfiguration from Engine 2017-10-09 18:21:55 -07:00
Matt Ellis
1e133cda59 Bump allowed line length to 140 characters
140 characters still fits on the screen on my laptop (with VS Code and
a wideish explorer pane so I'm bumping this up because I hit it and
others have often)
2017-10-09 18:21:55 -07:00
Matt Ellis
acd35b9916 Remove Checkpoint from planContext
Nothing actually consumed the Checkpoint property of the planContext,
so just remove it.
2017-10-09 18:21:55 -07:00
Matt Ellis
6bab1dbad4 Pass $(YARNFLAGS) to all yarn invocations
This let's you set things like YARNFLAGS==--offline which is helpful
when you are on an airplane. Yarn can still pick up stuff that you had
pulled down recently from its local cache
2017-10-09 18:21:55 -07:00
joeduffy
c5281d29f7 Expose a log module
This exposes the existing runtime logging functionality in a way meant
for 3rd-parties to consume.  This can be useful if we want to introduce
debug logging, warnings, or other things, that fit nicely with the
Pulumi CLI and overall developer workflow.
2017-10-08 12:10:46 -07:00
joeduffy
661ceacc9d Fail gracefully when there is no current environment 2017-10-08 10:18:53 -04:00
Luke Hoban
4af1345d4c Move serialization of Closures to JavaScript text to pulumi SDK (#402)
This logic was previously in the `@pulumi/aws` pacakge.  Moving it into the `pulumi` SDK as part of the overall closure serialization logic to make it more broadly accessible, and to centralize this functionality.

Now that it's all in one place, we may decide to remove the publically exposed `Closure` abstraction completely, which may also enable significant simplicifcation to the logic in closure serialization.

Also add one initial test case for this code.

Fixes pulumi/pulumi-aws#14.
2017-10-07 14:29:56 -07:00
Matt Ellis
f121de5571 Make pulumi -C <verb> <args> work
Internally we end up using flag to parse our command lines because of
our dependency on glog. When flag does not know about -C, if someone
passes -C before the sub command name (as is common for folks coming
from Git) the flag package terminates the program because -C was not
defined. So just teach flag this exists until we takle #301 and rid
ourselves of glog.
2017-10-06 14:28:59 -07:00
Matt Ellis
065f6f2b42 Support -C/--cwd instead of path to package
Previously, you could pass an explicit path to a Pulumi program when
running preview or update and the tool would use that program when
planning or deploying, but continue to write state in the cwd. While
being able to operate on a specific package without having to cd'd all
over over the place is nice, this specific implemntation was a little
scary because it made it easier to run two different programs with the
same local state (e.g config and checkpoints) which would lead to
surprising results.

Let's move to a model that some tools have where you can pass a
working directory and the tool chdir's to that directory before
running. This way any local state that is stored will be stored
relative to the package we are operating on instead of whatever the
current working directory is.

Fixes #398
2017-10-06 11:27:18 -07:00
CyrusNajmabadi
b6f5d75ac0 Merge pull request #396 from pulumi/includeKey
Include the actual key that we were unable to find on the error.
2017-10-05 14:11:30 -07:00
Cyrus Najmabadi
cd48ca2254 Include the actual key that we were unable to find on the error. 2017-10-05 13:55:20 -07:00
joeduffy
7e30dde8f4 Update plan test to new interface 2017-10-04 08:30:50 -04:00
joeduffy
b7576b9b14 Add a notion of stable properties
This change adds the capability for a resource provider to indicate
that, where an action carried out in response to a diff, a certain set
of properties would be "stable"; that is to say, they are guaranteed
not to change.  As a result, properties may be resolved to their final
values during previewing, avoiding erroneous cascading impacts.

This avoids the ever-annoying situation I keep running into when demoing:
when adding or removing an ingress rule to a security group, we ripple
the impact through the instance, and claim it must be replaced, because
that instance depends on the security group via its name.  Well, the name
is a great example of a stable property, in that it will never change, and
so this is truly unfortunate and always adds uncertainty into the demos.
Particularly since the actual update doesn't need to perform replacements.

This resolves pulumi/pulumi#330.
2017-10-04 08:22:21 -04:00
Pat Gavlin
26bf9e197b Merge pull request #394 from pulumi/DontIncrementallyCheckpoint
Remove incremental checkpointing.
2017-10-03 16:32:33 -07:00
pat@pulumi.com
3121284117 Remove incremental checkpointing.
This is currently broken in the case of resource replacements, in which
case we may have multiple resources with the same URN.
2017-10-03 16:21:53 -07:00
Pat Gavlin
94c7b33e7a Merge pull request #393 from pulumi/ReportSaveEnvErrors
Report `SaveEnvironment` errors.
2017-10-03 15:43:29 -07:00
pat@pulumi.com
f78aa02a54 Report SaveEnvironment errors.
Furthermore, only save the environment in `deployActions.Run`. Fixes #388.
2017-10-03 15:18:08 -07:00
Pat Gavlin
1a4e071403 Merge pull request #392 from pulumi/SimplifyStepActions
Simplify `deploy.StepActions`.
2017-10-03 13:35:18 -07:00
pat@pulumi.com
15be0a8b83 Simplify deploy.StepActions.
Now that `deploy.Step.Pre` is no more, we can simplify the `StepActions`
interface down to a single method, `Run`, which performs all actions
associated with the step. This feeds into #388.
2017-10-03 11:10:06 -07:00
Pat Gavlin
b35c7af0c7 Merge pull request #391 from pulumi/RemovePreStep
Remove `deploy.Step.Pre`.
2017-10-03 10:42:34 -07:00
pat@pulumi.com
252fd8e6bb Remove deploy.Step.Pre.
As per @joeduffy, this is an artifact of the prior runtime model.
2017-10-03 10:03:05 -07:00
Matt Ellis
daa083636c Rename envCmdInfo to planContext
This name is still not great, but the old name was really, really bad.
2017-10-02 18:03:07 -07:00
Pat Gavlin
5f203e7f15 Merge pull request #384 from pulumi/IncrementalCheckpoint
Incrementally update the checkpoint file during `pulumi update`.
2017-10-02 17:25:24 -07:00
pat@pulumi.com
967414117a PR feedback 2017-10-02 17:18:16 -07:00
Matt Ellis
2d74d9e606 Merge pull request #386 from pulumi/pulumi-service-interface
Have the CLI keep track of the current environment
2017-10-02 17:07:19 -07:00
Matt Ellis
93ab134bbb Have the CLI keep track of the current environment
Previously, the engine was concered with maintaing information about
the currently active environment. Now, the CLI is in charge of
this. As part of this change, the engine can now assume that every
environment has a non empty name (and I've added asserts on the
entrypoints of the engine API to ensure that any consumer of the
engine passes a non empty environment name)
2017-10-02 16:57:41 -07:00
Matt Ellis
ae8f2a84c2 Merge pull request #385 from pulumi/pulumi-service-interface
More pulumi engine refactoring
2017-10-02 16:16:55 -07:00
pat@pulumi.com
11114bd243 Incrementally update the checkpoint file during pulumi update.
Simply write the current snapshot after each step. We should probably be
more clever about this in the future (i.e. write only the changes rather
than the entire file).
2017-10-02 15:53:13 -07:00
Matt Ellis
2a16a198f6 Move environment info printing into the CLI
The engine now provides a strongly typed view of an environment and
the CLI decides how to display it
2017-10-02 15:50:08 -07:00
Matt Ellis
a704750714 Remove Workspace dependency on diag.Sink
It was only being used for two cases where we would issue warnings for
cases where the file system casing did not match expected casing. I
think it's probably better if we don't try to be smart here and just
treat these cases the same as if the file had not existed. Removing
the dependncy on diag also makes it a little clearer that this stuff
should be pulled out from the engine.
2017-10-02 15:25:22 -07:00
Matt Ellis
d29f6fc4e5 Use tokens.QName instead of string as the type for environment
Internally, the engine deals with tokens.QName and not raw
strings. Push that up to the API boundary
2017-10-02 15:14:55 -07:00
Pat Gavlin
ff2a3fa242 Replace Plan.Apply with planResult.Walk. (#383)
`deploy.Plan.Apply` was only consumed by the engine, and seemed to be in
the wrong place given the API exported by the rest of `Plan` (i.e.
`Plan.Start` + `PlanIterator`). Furthermore, we were missing a reasonable
opportunity to share code between `update` and `preview`, both of which
need to walk the plan. These changes move the plan walk into `package engine`
as `planResult.Walk` and replace the `Progress` interface with a new interface,
`StepActions`, which subsumes the functionality of the former and adds support
for implementation-specific step execution. `planResult.Walk` is then
consumed by both `Engine.Deploy` and `Engine.PrintPlan`.
2017-10-02 14:26:51 -07:00
Matt Ellis
69ebfcd809 Merge pull request #382 from pulumi/pulumi-service-interface
Refactor some engine/CLI stuff
2017-10-02 13:56:50 -07:00
Matt Ellis
ff758e7de6 Merge pull request #370 from pulumi/app-veyor-wip
Get a subset of the build working on Windows
2017-10-02 13:54:09 -07:00
Matt Ellis
cb6ac2785e Build, integration tests and publishing on Windows 2017-10-02 13:40:58 -07:00
Matt Ellis
aa6c6d6617 Move some configuration logic into the CLI
The CLI is now responsible for actually displaying information and the
engine is only concerned with getting the configuration. As part of
this change, I've removed the display a single configuration value API
from the engine. It can now be done in terms of getting all the config
for an environment and selecting the value the user is interested in
2017-10-02 13:35:39 -07:00