Commit graph

881 commits

Author SHA1 Message Date
joeduffy efd8065e97 Add some warnings to out-of-date docs 2017-03-10 22:03:50 -08:00
joeduffy 3b730211d6 Revamp the packages design document 2017-03-10 21:57:33 -08:00
joeduffy 374bcbe4d4 Tidy up the graphs design note 2017-03-10 21:13:08 -08:00
joeduffy 758ec2976b Fix a typo 2017-03-10 20:49:59 -08:00
joeduffy 807d355d5a Rename plugin prefix from coco-ressrv to coco-resource 2017-03-10 20:48:09 -08:00
joeduffy 6530eda346 Update the resources document 2017-03-10 20:45:23 -08:00
joeduffy 75ad4b4160 Overhaul the deps document 2017-03-10 20:19:05 -08:00
joeduffy f674d24ac7 Fix a src/dst mixup 2017-03-10 20:00:11 -08:00
joeduffy 4ca8ac9b8d Add a missing ` 2017-03-10 19:57:59 -08:00
joeduffy 6924e71861 Add more sample code 2017-03-10 19:36:45 -08:00
joeduffy 8670fd42a6 Merge branch 'master' of github.com:pulumi/coconut 2017-03-10 14:47:49 -08:00
joeduffy 8233357d5b Tidy up the formats document 2017-03-10 14:43:34 -08:00
Eric Rudder f32430cabd slight wording changes and WS edit 2017-03-10 13:50:55 -08:00
joeduffy 384e347115 No more nuts! 2017-03-10 13:27:19 -08:00
joeduffy 361eb62e7b Move coco env deploy to the top-level, coco deploy
Deployments are central to the entire system; although technically
a deployment is indeed associated with an environment, the deployment
is the focus, not the environment, so it makes sense to put the
deployment command at the top-level.

Before, you'd say:

    $ coco env deploy production

And now, you will say:

    $ coco deploy production
2017-03-10 13:17:55 -08:00
joeduffy 9bf279ceae Overhaul the overview document
This change brings the overview doc up to date with respect to the
changes we've made recently.
2017-03-10 13:14:32 -08:00
joeduffy cfd06083f5 Add a basic Riffmart sample
This checks in part of the Riffmart sample.

warning: this is a work-in-progress, and is incomplete.
2017-03-10 09:49:20 -08:00
joeduffy e3e62e55b2 Fix install scripts to use coco pack verify 2017-03-10 09:37:16 -08:00
joeduffy 08c1b10e75 Fix some CocoJS runtime issues
This change fixes up a handful of CocoJS runtime issues preventing
it from compiling; we aren't using much of this yet, but I hope to
resurrect it soon (so more legal ECMAScript code can run).
2017-03-10 09:35:52 -08:00
joeduffy e2c68daae5 Fix named import references
This change fixes named import references of the style

    import {foo} from "bar";
    ...foo...;

Previously, we incorrectly assumed all naked variables of the sort
referred to members inside of the current module.  Instead, we can
just refer to the existing logic that will use the bound symbol to
resolve the fully resolved module reference.
2017-03-09 16:23:42 +00:00
joeduffy 15ffa4141f Rename CocoJS's Nut* test files to Coconut* 2017-03-09 16:21:46 +00:00
joeduffy 7e68e47e9d Implement NonNullExpressions in CocoJS
This is there for static typechecking, and so we can safely erase it.
2017-03-09 16:02:54 +00:00
joeduffy 783f9534c8 Add the ability to specify and env config during eval
This adds the --config-env flag which can be used to apply configuration
before performing evaluation of a package.
2017-03-09 15:52:50 +00:00
joeduffy cbf5407a53 Print results only if non-nil, during eval 2017-03-09 15:45:24 +00:00
joeduffy bfee271087 Rename the coco nut command to coco pack 2017-03-09 15:43:28 +00:00
joeduffy 9f524e4c8c Organize all package management commands
This change organizes all package management commands underneath
the top-level subcommand `nut`; so, for example:

    $ nut get ...
    $ nut eval ...
    and so on
2017-03-08 11:41:13 +00:00
joeduffy 3b3b56a836 Properly reap child processes
This change reaps child plugin processes before exiting.  It also hardens
some of the exit paths to avoid os.Exiting from the middle of a callstack.
2017-03-07 13:47:42 +00:00
joeduffy d94f9d4768 Implement a very basic env config command
This change implements a very basic `coco env config` command, that
lets you read, set, or unset configuration values for an environment.

For a single environment, these four usage styles are supported:

    # query all values in a given environment <env>:
    $ coco env config <env>

    # query a single value with key <key> in a given environment <env>:
    $ coco env config <env> <key>

    # set a single value with key <key> and value <value> in <env>:
    $ coco env config <env> <key> <value>

    # unset a single value with key <key> in the environment <env>:
    $ coco env config <env> <key> --unset

This is a vast subset of pulumi/coconut#113.
2017-03-06 15:07:24 +00:00
joeduffy 86dc13ed5b More term rotations
This changes a few naming things:

* Rename "husk" to "environment" (`coco env` for short).

* Rename NutPack/NutIL to CocoPack/CocoIL.

* Rename the primary Nut.yaml/json project file to Coconut.yaml/json.

* Rename the compiled Nutpack.yaml/json file to Cocopack.yaml/json.

* Rename the package asset directory from nutpack/ to .coconut/.
2017-03-06 14:32:39 +00:00
joeduffy 5318d5af57 Merge branch 'master' of github.com:pulumi/coconut 2017-03-06 14:20:34 +00:00
joeduffy 800f3dd388 Eliminate superfluous copy of ec2instance 2017-03-06 13:04:25 +00:00
joeduffy 9044047b84 Fix a go vet failure 2017-03-06 13:02:48 +00:00
joeduffy 7cb9ce2663 Implement some AWS provider checking
This change refactors the existing property verification logic for
the AWS provider to use the new checking capabilities.  Beyond just
checking for required properties, there isn't much here yet.  There
is a single check for security group description length that goes
beyond this, mostly for illustration purposes.

This is part of pulumi/coconut#115, although there is clearly more
to do here for something sufficiently snazzy and demoable.
2017-03-03 12:13:19 -08:00
joeduffy 6194a59798 Add a pre-pass to validate resources before creating/updating
This change adds a new Check RPC method on the provider interface,
permitting resource providers to perform arbitrary verification on
the values of properties.  This is useful for validating things
that might be difficult to express in the type system, and it runs
before *any* modifications are run (so failures can be caight early
before it's too late).  My favorite motivating example is verifying
that an AWS EC2 instance's AMI is available within the target region.

This resolves pulumi/coconut#107, although we aren't using this
in any resource providers just yet.  I'll add a work item now for that...
2017-03-02 18:15:38 -08:00
joeduffy adf852dd84 Fix an off by one (duhhh) 2017-03-02 17:15:13 -08:00
joeduffy 076d689a05 Rename Monikers to URNs
This change is mostly just a rename of Moniker to URN.  It does also
prefix resource URNs to have a standard URN namespace; in other words,
"urn🥥<name>", where <name> is the same as the prior Moniker.

This is a minor step that helps to prepare us for pulumi/coconut#109.
2017-03-02 17:10:10 -08:00
joeduffy 2ce75cb946 Make security group changes imply replacement 2017-03-02 16:16:18 -08:00
joeduffy 966969945b Add a resource.NewUniqueHex API (and use it)
This change adds a new resource.NewUniqueHex API, that simply generates
a unique hex string with the given prefix, with a specific count of
random bytes, and optionally capped to a maximum length.

This is used in the AWS SecurityGroup resource provider to avoid name
collisions, which is especially important during replacements (otherwise
we cannot possibly create a new instance before deleting the old one).

This resolves pulumi/coconut#108.
2017-03-02 16:02:41 -08:00
joeduffy 341c30f0c8 Issue deploy errors in the after callback
This just orders the output more nicely; previously, "step #n failed"
would come *before* the error detailing the reason.  This was a bit
confusing.  This change reorders them so the error reads more naturally.
2017-03-02 15:46:14 -08:00
joeduffy 523c669a03 Track which updates triggered a replacement
This change tracks which updates triggered a replacement.  This enables
better output and diagnostics.  For example, we now colorize those
properties differently in the output.  This makes it easier to diagnose
why an unexpected resource might be getting deleted and recreated.
2017-03-02 15:24:39 -08:00
joeduffy f0d9b12a3c Don't emit logical step resources while checkpointing 2017-03-02 13:14:57 -08:00
joeduffy c633d0ceb0 Add "still waiting" messages to retries 2017-03-02 13:12:40 -08:00
joeduffy e3715ef836 Add some handy aliases for deploy and init 2017-03-02 11:50:29 -08:00
joeduffy da5e737e08 Update EC2 resources to new Update model 2017-03-02 10:02:05 -08:00
joeduffy bd613a33e6 Make replacement first class
This change, part of pulumi/coconut#105, rearranges support for
resource replacement.  The old model didn't properly account for
the cascading updates and possible replacement of dependencies.

Namely, we need to model a replacement as a creation followed by
a deletion, inserted into the overall DAG correctly so that any
resources that must be updated are updated after the creation but
prior to the deletion.  This is done by inserting *three* nodes
into the graph per replacement: a physical creation step, a
physical deletion step, and a logical replacement step.  The logical
step simply makes it nicer in the output (the plan output shows
a single "replacement" rather than the fine-grained outputs, unless
they are requested with --show-replace-steps).  It also makes it
easier to fold all of the edges into a single linchpin node.

As part of this, the update step no longer gets to choose whether
to recreate the resource.  Instead, the engine takes care of
orchestrating the replacement through actual create and delete calls.
2017-03-02 09:52:08 -08:00
joeduffy 8698e5abeb Implement replacement for EC2 instances 2017-03-01 13:42:10 -08:00
joeduffy df3c0dcb7d Display and colorize replacements distinctly 2017-03-01 13:34:29 -08:00
joeduffy f93e093ab3 Unify some CLI error reporting
This unifies some of the CLI error reporting logic.  It's still
not perfect, but this tidies up some minor issues that were starting
to annoy me (e.g., inconsistencies in message formatting, message
colorization, and exit code handling).
2017-03-01 10:09:27 -08:00
joeduffy 49f5f3debc Add a distinct husk rm command
This changes the workflow for destroying a husk slightly.  Rather than
`coco husk destroy` actually removing the husk and its associated config
information, `coco husk destroy` just destroys the resources.  Then,
afterwards, to permanently remove the husk, you use `coco husk rm`.

As usual with `rm`-style commands, it refues to remove the husk if there
are any resources still associated with it; however, `--force` overrides
this default.
2017-03-01 09:57:14 -08:00
joeduffy fe0bb4a265 Support replacement IDs
This change introduces a new RPC function to the provider interface;
in pseudo-code:

    UpdateImpact(id ID, t Type, olds PropertyMap, news PropertyMap)
        (bool, PropertyMap, error)

Essentially, during the planning phase, we will consult each provider
about the nature of a proposed update.  This update includes a set of
old properties and the new ones and, if the resource provider will need
to replace the property as a result of the update, it will return true;
in general, the PropertyMap will eventually contain a list of all
properties that will be modified as a result of the operation (see below).

The planning phase reacts to this by propagating the change to dependent
resources, so that they know that the ID will change (and so that they
can recalculate their own state accordingly, possibly leading to a ripple
effect).  This ensures the overall DAG / schedule is ordered correctly.

This change is most of pulumi/coconut#105.  The only missing piece
is to generalize replacing the "ID" property with replacing arbitrary
properties; there are hooks in here for this, but until pulumi/coconut#90
is addressed, it doesn't make sense to make much progress on this.
2017-03-01 09:08:53 -08:00