Commit graph

1576 commits

Author SHA1 Message Date
joeduffy 2952c3624d Copy NPM package files
This change copies the NPM package files to the installation directory
so that the result is a valid NPM package.  This is a temporary workaround
until (😨) the day that we actually publish/consume real NPM packages...
2017-07-23 12:13:44 -06:00
joeduffy d6b6cbf4ff Build/test the minimal Lumi program as a nightly integration test 2017-07-23 12:12:43 -06:00
joeduffy cfb98291bc Link NPM packages on install 2017-07-23 11:17:18 -06:00
joeduffy 29aa488628 Publish binaries under the tag, branch, and commit 2017-07-21 15:33:03 -07:00
Joe Duffy 7adf3ef0f4 Eliminate custom AWS provider in favor of bridge 2017-07-21 14:54:01 -07:00
joeduffy 232ed7e248 Goodbye, custom AWS provider code
😥

Preparing to RI the tfbridge branch into master.
2017-07-21 14:41:01 -07:00
joeduffy 10dc68090d Add an install script
This can be used to install pre-built Lumi release packages.
2017-07-21 14:11:39 -07:00
joeduffy e35bfc35b2 Remove AWS examples
These are moving to their respective repos.
2017-07-21 14:00:30 -07:00
joeduffy 00442b73b4 Alter the way unknown properties are serialized
This change serializes unknown properties anywhere in the entire
property structure, including deeply embedded inside object maps, etc.

This is now done in such a way that we can recover both the computed
nature of the serialized property, along with its expected eventual
type, on the other side of the RPC boundary.

This will let us have perfect fidelity with the new bridge's view on
computed properties, rather than special casing them on "one side".
2017-07-21 14:00:30 -07:00
joeduffy b8be7fa5e6 Add a handy Copy function to PropertyMap 2017-07-21 14:00:30 -07:00
Luke Hoban 844b2bf1ea Support for string.split
Adds the string.split intrinsic function and places
it on the String protoype object.
2017-07-21 14:00:30 -07:00
Luke Hoban 18c3caf093 Fix continue in loops
Make sure that continue runs post expression
before looping.
2017-07-21 14:00:30 -07:00
Luke Hoban 9243bd5f3f Fix tests after previous commit 2017-07-21 14:00:30 -07:00
joeduffy 40747a94bf Merge inputs with outputs
For Update and Delete operations, we provided just the input state
for a resource.  This is insufficient, because the provider may need
to depend on output state from the Create or prior Update operations.
This change merges the output atop the input during the step application.
2017-07-21 14:00:30 -07:00
joeduffy 4e02105355 Pass old state to the provider's API 2017-07-21 14:00:30 -07:00
joeduffy ae92e68902 Return state as part of Create and Update¬
As part of the bridge bringup, I've discoverd that the property state
returned from Creates does *not* always equal the state that is then
read from calls to Get.  (I suspect this is a bug and that they should
be equivalent, but I doubt it's fruitfal to try and track down all
occurrences of this; I bet it's widespread).  To cope with this, we will
return state from Create and Update, instead of issuing a call to Get.
This was a design we considered to start with and frankly didn't have
a super strong reason to do it the current way, other than that it seemed
elegant to place all of the Get logic in one place.

Note that providers may choose to return nil, in which case we will read
state from the provider in the usual Get style.
2017-07-21 14:00:29 -07:00
joeduffy 87b7091b35 Remove serverless examples
These have moved to [pulumi/aws-serverless/examples](
https://github.com/pulumi/aws-serverless/examples/).
2017-07-21 14:00:29 -07:00
joeduffy dffdb29799 Install the AWS CLI as a prerequisite 2017-07-21 10:18:55 -07:00
joeduffy f314ab5a36 Let LUMIROOT be overridden during publishes 2017-07-21 09:57:40 -07:00
joeduffy fc1cd2c01e Make a publish script; fix sed for multi-OS compat
This change creates a scripts/ folder, moves our existing shell
script, gocover.sh, underneath it, and factors the publish logic
out of the Makefile and into the publish.sh file.

The syntax for sed differs between Mac OS X and GNU versions of
the tool, which is rather annoying.  This fixes it by leveraging
the fact that `sed -i.bak ...` works, although we now need to
clean up the *.bak file left behind.  (No big deal and way better
than maintaining OS-dependent logic.)
2017-07-21 09:37:14 -07:00
joeduffy f2537ecab8 Force publishes
To workaround the fact that our repos end in a dirty state after
the CI job finishes, I'm adding PUBFORCE=true to the CI script.
pulumi/lumi#300 tracks figuring out the root cause and removing it.
2017-07-21 08:09:23 -07:00
joeduffy 4b505acbcc Also package up LumiJS compiler in binary releases 2017-07-20 15:17:10 -07:00
joeduffy 2670e42c93 Publish built binaries upon successful push CI to master
This adds a new make target, publish, that will create a release
package and upload it to an S3 bucket.  This package simply contains
the built CLI plus the core library packages, lumi, lumirt, and lumijs.

This target is invoked automatically at the end of a successful
Travis run against a push to master.
2017-07-20 14:52:40 -07:00
joeduffy 3b4afc0346 Eliminate a superfluous warning 2017-07-20 13:21:30 -07:00
joeduffy ea3b530434 Delete lib/mantle
You served your purpose, but are no longer useful.  R.I.P.
2017-07-20 10:16:15 -07:00
joeduffy ba1b27a657 Make a few tweaks for better demos
* Alias "run" for "deploy".

* Alias "stop" for "destroy".

* Respect --summary for outputs.
2017-07-18 09:45:04 -07:00
joeduffy ceb32b9e2b Add a sig field to Asset/Archive
This change mirrors the dynamic marshaling structure on the static
definition of the Asset and Archive types.  This ensures that they
marshal correctly even when deeply embedded inside other structures.
2017-07-18 09:30:31 -07:00
joeduffy e518f1ad86 Adopt new pointerless Asset APIs in tests 2017-07-17 17:58:22 -07:00
joeduffy 5bf43743ab Add a rudimentary toString runtime helper
This just works around some limitations that will exist until
we do the runtime work next sprint, and achieve pulumi/lumi#169.
2017-07-17 13:43:59 -07:00
joeduffy 91c90cf2a9 Add diffing logic for assets/archives 2017-07-17 12:11:15 -07:00
joeduffy 002618e605 Add some more asset serialization round-tripping tests 2017-07-17 11:30:10 -07:00
joeduffy 4d708c8567 Fix asset diffing
This change brings the same typed serialization we use for RPC
to the serialization of deployments.  This ensures that we get
repeatable diffs from one deployment to the next.
2017-07-17 10:38:57 -07:00
joeduffy ee1acd365c Add a defaultIfComputed intrinsic
Until we support output-conditional code (pulumi/lumi#170), we
run into cases where we want to make a decision based on a computed
property if it is available, but can't possible know the value.  In
such cases, we get an error ("Unexpected computed value").

In fact, our generated code currently includes client side validation
of properties, since it leads to a(n admittedly only slightly) better
developer experience.  But that triggers the error for required
properties that are computed, basically hosing our ability to plan.

This change introduces a defaultIfComputed intrinsic to the lumirt
library that can be used to work around this.  It takes two arguments,
obj and def, and returns the actual property value obj if it is NOT
computed; if it is computed, def will be substituted in its stead.

The generated code changes to use this.  It's possible it will miss
validation, of course, if a computed property turns out not to match
the precondition.  But this is strictly better than the alternative
of not trying to validate any of them to begin with.
2017-07-16 15:16:48 -07:00
joeduffy f11b06f57b Pretty print assets during planning 2017-07-16 08:28:50 -07:00
joeduffy bda607abd8 Permit -1 for randlen and maxlen
This allows -1 for randlen and maxlen to use defaults.  The default
behavior is that randlen uses sha1.Size and maxlen is "no max".
2017-07-15 09:59:44 -07:00
joeduffy c61dcb5206 Revert "Rename Lumi resource properties"
This reverts commit c3db70849d.

I've opted to take a new strategy to ensure the bridge properties
don't conflict (with manual renames), similar to the name property.
2017-07-15 09:33:23 -07:00
joeduffy 0f18bb40b2 Tolerate some nils in important places 2017-07-14 18:08:33 -07:00
joeduffy a6caef973a Make assets and archives 1st class
This change recognizes assets and archives as 1st class resource
property values.  This is necessary to support them in the new bridge
work, and lays the foundation for fixing pulumi/lumi#153.

I also took the opportunity to clean up some old cruft in the
resource properties area.
2017-07-14 12:28:43 -07:00
joeduffy 84d4840fb9 Rename PID type to ID
We want to change the property name, but not the type.
2017-07-14 09:44:08 -07:00
joeduffy c3db70849d Rename Lumi resource properties
This renames the basemost resource properties, id and urn, to
names that are less likely to conflict with properties that real
resources will want to use, pid and upn (provider ID and Universal
Pulumi Name, respectively).

I actually ran into this with the current bridge work.  An alternative
solution would be to require derived resources to pick different names,
however this is unfortunate because usually they are more "user-facing"
than ours.  Another alternative is to not hijack the object properties
at all, but that too is problematic because we use these properties
during the evaluation of plans and deployments.

This seems like a reasonable middle ground.
2017-07-14 08:55:07 -07:00
Luke Hoban 3efcf91933 Addres PR feedback on #288
Move ByName into the shared tokens package.
2017-07-13 23:03:28 -07:00
Luke Hoban e9f6fbeed0 Merge pull request #288 from pulumi/closure-fixes
Closure fixes
2017-07-13 23:00:10 -07:00
joeduffy 539ccc8f04 Add a --debug option to plan, deploy, and destroy
This change introduces a --debug option to the plan, deploy, and
destroy commands.  Unlike --logtostderr, which merely hooks into the
copious Glogging that we perform (and is therefore meant for developers
of the tools themselves and not end users), --debug hooks into the
user-facing debug stream.  This now includes any debug messages coming
from the resource providers as they perform their tasks.
2017-07-13 17:13:19 -07:00
Luke Hoban 31c62ec8e6 Function update improvements
Remove duplicative call to UpdateFunctionConfiguration.

Also ensure that free variables returns stable variable order
to avoid unnecessary lambda updates.
2017-07-13 17:01:11 -07:00
Luke Hoban 61bcf1d704 Support captured reference to this in lambdas
Lumi returns references to the `this` variable as
`.this`, so we need to rewrite these when emitting
into Lambdas.  In addition, the TypeScript compilation
of lambda functions requires that we create an environment
for executing the generated code where `this` has the
right value, which requires some subtle changes to our code
generation.
2017-07-13 15:51:21 -07:00
Luke Hoban c6ef2f6c66 Fix golint errors in previous commit 2017-07-13 12:40:10 -07:00
Luke Hoban 92418cf687 Refactor integration testing framework
Generalizes Lumi program validation so that it can be applied
to integration testing for other packages (such as the
pulumi/lumi-platform package examples).
2017-07-13 12:20:57 -07:00
joeduffy 8465d39a02 Tidy up some planning/deployment messages 2017-07-13 09:56:49 -07:00
Luke Hoban 0b24ab7070 Serialize lambdas nested in captured objects
Adds support for serializing lambdas which are
properties of captured objects.

For example:

```
let o = {
  f: () => 12
};
let func = new aws.serverless.Function("func", {policies: [aws.iam.AWSLambdaFullAccess]}, (ev, ctx, cb) => {
    console.log(o.f());
    cb(null, null);
});
```
2017-07-12 17:43:17 -07:00
Luke Hoban ac21b5bd82 Add test for serializeClosure 2017-07-12 15:19:20 -07:00