Commit graph

1447 commits

Author SHA1 Message Date
Luke Hoban
99499792b3 Serialize lambda environment variables in stable order
When serializing a closure, we serialize the lambda environment into the
aws.lambda.Function Environment property.  We need to serialize the lambda
environment in a stable order to ensure that we don't cause Lumi to require
updates to the aws.lambda.Function resource.
2017-05-31 11:40:22 -07:00
joeduffy
ab6e2466c7 Flow logging information to plugins
This change flows --logtostderr and -v=x settings to any dynamically
loaded plugins so that running Lumi's command line with these flags
will also result in the plugins logging at the requested levels.  I've
found this handy for debugging purposes.
2017-05-30 10:19:33 -07:00
Luke Hoban
75c25e0ce6 Add documentation for HashSets APIs 2017-05-29 10:11:47 -07:00
Luke Hoban
8bbf48bf87 Support for AWS DynamoDB Table GlobalSecondaryIndexes
Adds support for global secondary indexes on DynamoDB Tables.

Also adds a HashSet API to the AWS provider library.  This handles part of #178,
providing a standard way for AWS provider implementations to compute set-based
diffs. This new API is used in both aws.dynamodb.Table and aws.elasticbeanstalk.Environment
currently.
2017-05-26 14:54:35 -07:00
Luke Hoban
7f8b1e59c1 Support for lambdas (#158)
Resolves #137.

This is an initial pass for supporting JavaScript lambda syntax for defining an AWS Lambda Function.

A higher level API for defining AWS Lambda Function objects `aws.lambda.FunctionX` is added which accepts a Lumi lambda as an argument, and uses that lambda to generate the AWS Lambda Function code package.

LumiJS lambdas are serialized as the JavaScript text of the lambda body, along with a serialized version of the environment that is deserialized at runtime and used as the context for the body of the lambda.

Remaining work to further improve support for lambdas is being tracked in #173, #174, #175, and #177.
2017-05-25 16:55:14 -07:00
Luke Hoban
6015c96fda Add jsonStringify intrinsic
This will eventually be used as the implementation of JSON.stringify in LumiJS.
2017-05-25 12:19:58 -07:00
Luke Hoban
b8d978b22c Move Intrinsic into eval/rt package
Unifies the notion of BuiltinFunctions with the existing Intrinsic.

Intrinsic is now only a wrapper type, used to indicate the need to lookup the symbol in the
eval pacakges table of registered intrinsics.  It does not carry the invoker function used
to eval the intrinsic.
2017-05-25 12:06:13 -07:00
Luke Hoban
a625117e72 Add a length property to Array objects
Also adds a `lumi.runtime.printf` function for debugging Lumi scripts and fixes a couple issues with getter/setter references.
2017-05-25 12:06:13 -07:00
joeduffy
28c9c80b74 Enable Slack notifications for Travis CI 2017-05-25 07:36:17 -07:00
joeduffy
9f9e885c87 Fence some CONTRIBUTING.md code correctly 2017-05-24 18:10:30 -07:00
joeduffy
dfee663ccc Create a CONTRIBUTING.md file
This change creates a CONTRIBUTING.md file, closing pulumi/lumi#160.
2017-05-24 18:06:59 -07:00
joeduffy
e9cc0acb05 Update instructions for Govet 2017-05-24 13:25:28 -07:00
Joe Duffy
dd706ca4e4 Merge pull request #163 from pulumi/lumi-162-cicd
Enable Travis CI/CD
2017-05-24 13:23:20 -07:00
joeduffy
dba4e2258c Add a build badge 2017-05-24 12:50:29 -07:00
joeduffy
e39d1c5ada Skip -printf checks in Govet
Due to https://github.com/golang/go/issues/12294, our Travis jobs are
failing with

    pkg/compiler/binder/stmtexpr.go:160: no formatting directive in Errorf call

etc, etc.  Perplexingly, this is supposedly fixed as of Go 1.7.5, and we are
running Go 1.8.2 in Travis.  However, vet is a separate binary tool, so it seems
either (1) Go's Linux distro doesn't contain the right version or (2) Travis's
image doesn't contain the right version.  I have to imagine (2) is more likely,
except that I can't actually look at the machine (and go vet doesn't have a version)!

For now, we will just skip the -printf checks.
2017-05-24 12:50:29 -07:00
joeduffy
9aa1d8147b Remove master from the list of valid Go versions 2017-05-24 12:50:28 -07:00
joeduffy
a1cf0c2a6c Update to Go 1.8.2 2017-05-24 12:50:28 -07:00
joeduffy
8f1fa79230 Rewrite eval test to be self-contained
The eval test in its current form depends on the Lumi standard library
as an external dependency.  This means that, in order to run the test,
you must first install the standard library.  Not only is this poor
practice, it is also interfering with our ability to get our new CI/CD
system up and running.  This change fixes all of that by mocking the one
standard library runtime function that we need in order to hook the intrinsic.
2017-05-24 12:50:28 -07:00
joeduffy
d92ccc9cb5 Add -v flag to godep restore
This change adds the -v flag so that verbose output is emitted in the
CI/CD logs.  Since restore can take a little while, this at least lets
you monitor what it's doing and how long what it's doing is taking...
2017-05-24 12:50:28 -07:00
joeduffy
efdfa42527 Manually install Godep in pre-install 2017-05-24 12:50:28 -07:00
joeduffy
c18ae86cc8 Manually godep restore during install 2017-05-24 12:50:28 -07:00
joeduffy
88ea603551 Switch from Glide to Godep for dependency management
There isn't a pre-canned Glide distribution for amd64 linux, and the
integration with Glide and Travis isn't nearly as swanky as with Godep
(which essentially works out of the box).  Furthermore, Godep has caught
up with Go's vendoring changes since last time I looked, which was the
primary reason I ended up going with Glide in the first place.
2017-05-24 12:50:28 -07:00
joeduffy
9ed22eba6f Prep the $GOPATH/bin directory
The Glide installation script requires that the $GOPATH/bin directory
already exists, but because it is pre-install, it doesn't.  Make it so.
2017-05-24 12:50:28 -07:00
joeduffy
f93f8f0510 Add a basic Travis CI/CD file
This is the beginning of pulumi/lumi#162.
2017-05-24 12:50:28 -07:00
Luke Hoban
5768a372d1 Support updates which remove Environment on AWS Lambda Function
If the Environment is removed, we must pass an empty map of variables to `UpdateFunctionConfiguration`.
2017-05-23 21:45:58 -07:00
Luke Hoban
1bab33064a Support for AWS Lambda Function Environment property 2017-05-23 17:35:51 -07:00
Luke Hoban
ced90154e0 Add support for AWS IAM Managed Policies
We now support the `ManagedPolicyARNs` property on `aws.iam.Role`, enabling pre-defined policies to be attaced to an IAM role as part of it's definition.

To make it easier to discover and work with AWS managed policies, constants for all currently defined AWS managed policy ARNs are provided in the IAM module.

Inline policies are still not yet supported.
2017-05-23 13:57:51 -07:00
Joe Duffy
f541853226 Merge pull request #157 from pulumi/intrinsic-fix
Fix a few intrinsics bugs
2017-05-23 08:05:19 -07:00
joeduffy
2bbc4739bd Add some intrinsics tests
This change adds some machinery to make it easier to write evaluator tests,
and also implements some tests for the lumi:runtime/dynamic:isFunction intrinsic.
2017-05-23 08:03:14 -07:00
Luke Hoban
35a41f9e4a Support Update on IAM Role and Lambda Function 2017-05-22 22:57:55 -07:00
joeduffy
bad62854a9 Fix a few intrinsics bugs
During various refactorings pertaining to dynamic vs static invoke, the
intrinsics machinery broke in a few ways:

* MaybeIntrinsic needs to happen elsewhere.  Rather than doing it at binding
  time, we can do it when populating the properties in the first place,
  reusing the same property symbol from one access to the next.

* Last week, I refactored the intrinsics module to also have a dynamic sub-
  module.  The tokens in the Intrinsics map needed to also get updated.

* As a result of the tokens now containing member parts, we can't use
  tokens.Token.Name, since it is assumed to be a simple name; instead, we
  need to convert to tokens.ModuleMember, and then fetch Name.  To be honest,
  this is probably worth revisiting, since I think most people would expect
  Name to just work regardless of the Token kind.  The assert that it be
  Simple might be a little overly aggressive...

This checkin fixes these issues.  I'm not pushing to master just yet,
however, until there are some solid tests in here to prevent future breakage.
2017-05-22 16:16:53 -07:00
joeduffy
ecd9a953d0 Remove @code annotation on asset.Code
This is triggering the need for all downstream consumers of the Lumi
library to enable experimental decorators support.  Given that it's not
even clear where we'll land on this (pending pulumi/lumi#137), and in
fact are actively revisiting the relationship between functions and
assets, I'm removing this annotation.
2017-05-22 14:14:21 -07:00
joeduffy
6e0d388c90 Make argument objects optional when no required properties
If a resource has no required properties, there's no need for an
argument object.  (In the extreme case, perhaps the resource has
*no* properties.)  This is a minor usability thing, but it's far
nicer to write code like

    let buck = new Bucket("images");

than it is to write code like

    let buck = new Bucket("images", {});
2017-05-22 14:08:32 -07:00
joeduffy
3bad4fde98 Disable storing output properties
The storing of output properties won't work correctly until pulumi/lumi#90
is completed.  The update logic sees properties that weren't supplied by the
developer and thinks this means an update is required; this is easy to fix
but better to just roll into the overall pending change that will land soon.
2017-05-22 13:20:57 -07:00
joeduffy
94786ee1a2 Add an ast.WalkChildren function
This adds a WalkChildren function that can be useful when you want to
walk an AST node's children, but not the node itself.
2017-05-22 11:06:12 -07:00
Luke Hoban
9a898d88fd Add AWS DynamoDB Table provider (#151)
Adds support for Table resources, along with the beginnings of a Serverless example that uses Tables.
2017-05-21 22:17:56 -07:00
Luke Hoban
0f99762e2e Add AWS Elastic Beanstalk resource providers (#154)
Includes support for:
* Application
* ApplicationVersion
* Environment
2017-05-21 21:45:28 -07:00
joeduffy
bb0822f2df Remove the Kube Fission provider
This code has moved out into its own distinct repo at pulumi/kubefission-lumipack.
2017-05-19 16:44:33 -07:00
joeduffy
ed092213d2 Remove deprecated lumix package 2017-05-19 16:27:34 -07:00
joeduffy
423e84df6e Fix workspace tests 2017-05-19 08:24:44 -07:00
Luke Hoban
0b8d534caf Merge pull request #149 from lukehoban/master
More CLIDL -> LUMIDL updates
2017-05-18 18:40:03 -07:00
Luke Hoban
2a036c8693 More CLIDL -> LUMIDL updates 2017-05-18 17:21:08 -07:00
joeduffy
ce1dc4e30b Fix an erroneous reference to lumi env deploy 2017-05-18 15:54:40 -07:00
joeduffy
558d35e9cd Add back a missing package ec2
This was mistakenly lopped off during the license conversation.
2017-05-18 15:54:07 -07:00
joeduffy
4108c51549 Reclassify Lumi under the Apache 2.0 license
This is part of pulumi/lumi#147.
2017-05-18 14:51:52 -07:00
Joe Duffy
59d56d3503 Merge pull request #148 from pulumi/lumi-rename
Rename Coconut to Lumi
2017-05-18 13:42:43 -07:00
joeduffy
b7f3d447a1 Preserve the lumi prefix on our CLI tools
This change keeps the lumi prefix on our CLI tools.

As @lukehoban pointed out in person, as soon as we do pulumi/coconut#98,
most people (other than compiler authors themselves) won't actually be
typing the commands.  And, furthermore, the commands aren't all that bad.

Eventually I assume we'll want something like `lumi-js`, or
`lumi-js-compiler`, so that binaries are discovered dynamically in a way
that is extensible for future languages.  We can tackle this during #98.
2017-05-18 12:38:58 -07:00
joeduffy
dafeb77dff Rename Coconut to Lumi
This is part of pulumi/coconut#147.

After it has landed, I will rename the repo on GitHub.
2017-05-18 11:38:28 -07:00
joeduffy
ec27cfd22c Update object test to use new pointer constructor 2017-05-16 15:27:32 -07:00
joeduffy
8d6f4c0d69 Fix a minor error message typo 2017-05-15 17:50:13 -07:00